IDE hangs on startup: "wsarecv: A connection attempt failed"

Continuing the discussion from Arduino 2.0.3 stuck on loading screen:

PS C:\Program Files\Arduino IDE> & ".\Arduino IDE"
PS C:\Program Files\Arduino IDE>
Arduino IDE 2.2.1
Checking for frontend application configuration customizations. Module path: C:\Program Files\Arduino IDE\resources\app\lib\backend\electron-main.js, destination 'package.json': C:\Program Files\Arduino IDE\resources\app\package.json
Setting 'theia.frontend.config.appVersion' application configuration value to: "2.2.1" (type of string)
Setting 'theia.frontend.config.cliVersion' application configuration value to: "0.34.0" (type of string)
Setting 'theia.frontend.config.buildDate' application configuration value to: "2023-08-31T14:35:44.802Z" (type of string)
Frontend application configuration after modifications: {"applicationName":"Arduino IDE","defaultTheme":{"light":"arduino-theme","dark":"arduino-theme-dark"},"defaultIconTheme":"none","electron":{"windowOptions":{}},"defaultLocale":"","validatePreferencesSchema":false,"preferences":{"window.title":"${rootName}${activeEditorShort}${appName}","files.autoSave":"afterDelay","editor.minimap.enabled":false,"editor.tabSize":2,"editor.scrollBeyondLastLine":false,"editor.quickSuggestions":{"other":false,"comments":false,"strings":false},"editor.maxTokenizationLineLength":500,"editor.bracketPairColorization.enabled":false,"breadcrumbs.enabled":false,"workbench.tree.renderIndentGuides":"none","explorer.compactFolders":false},"appVersion":"2.2.1","cliVersion":"0.34.0","buildDate":"2023-08-31T14:35:44.802Z"}
Starting backend process. PID: 10032
Using browser-only version of superagent in non-browser environment
Configuration directory URI: 'file:///c%3A/Users/malit/.arduinoIDE'
Configuring to accept webviews on '^.+\.webview\..+$' hostname.
2023-09-26T08:18:49.793Z root INFO Backend Object.initialize: 9.5 ms [Finished 0.945 s after backend start]
2023-09-26T08:18:49.794Z root INFO Backend Object.configure: 7.9 ms [Finished 0.945 s after backend start]
2023-09-26T08:18:49.794Z root INFO Backend a.onStart: 2.5 ms [Finished 0.945 s after backend start]
2023-09-26T08:18:49.795Z root INFO Backend a.configure: 0.5 ms [Finished 0.987 s after backend start]
2023-09-26T08:18:49.796Z root INFO Backend u.onStart: 0.4 ms [Finished 0.987 s after backend start]
2023-09-26T08:18:49.797Z root INFO Backend d.configure: 0.1 ms [Finished 0.988 s after backend start]
2023-09-26T08:18:49.799Z root INFO Backend d.initialize: 42.2 ms [Finished 0.988 s after backend start]
2023-09-26T08:18:49.799Z root INFO Backend c.onStart: 0.4 ms [Finished 0.988 s after backend start]
2023-09-26T08:18:49.801Z root INFO Backend s.configure: 1.9 ms [Finished 0.990 s after backend start]
2023-09-26T08:18:49.803Z config INFO >>> Initializing CLI configuration...
2023-09-26T08:18:49.804Z root INFO Backend c.initialize: 0.6 ms [Finished 0.991 s after backend start]
2023-09-26T08:18:49.804Z root INFO Backend P.onStart: 1.1 ms [Finished 0.992 s after backend start]
2023-09-26T08:18:49.806Z config INFO Loading CLI configuration from c:\Users\malit\.arduinoIDE\arduino-cli.yaml...
2023-09-26T08:18:49.807Z daemon INFO Starting daemon from C:\Program Files\Arduino IDE\resources\app\lib\backend\resources\arduino-cli.exe...
2023-09-26T08:18:49.808Z root INFO Backend s.initialize: 0.5 ms [Finished 0.993 s after backend start]
2023-09-26T08:18:49.808Z root INFO Backend w.onStart: 1.9 ms [Finished 0.994 s after backend start]
2023-09-26T08:18:49.810Z root INFO Backend r.configure: 3.4 ms [Finished 0.995 s after backend start]
2023-09-26T08:18:49.813Z discovery-log INFO start
2023-09-26T08:18:49.815Z discovery-log INFO start new deferred
2023-09-26T08:18:49.816Z root INFO Backend d.initialize: 0.8 ms [Finished 0.996 s after backend start]
2023-09-26T08:18:49.817Z root INFO Backend y.onStart: 3.6 ms [Finished 0.999 s after backend start]
2023-09-26T08:18:49.818Z root INFO Backend r.configure: 3.4 ms [Finished 1.000 s after backend start]
2023-09-26T08:18:49.819Z root INFO Backend s.onStart: 1.0 ms [Finished 1.003 s after backend start]
2023-09-26T08:18:49.819Z root INFO Backend h.configure: 1.5 ms [Finished 1.004 s after backend start]
2023-09-26T08:18:49.820Z root INFO Backend a.configure: 3.7 ms [Finished 1.012 s after backend start]
2023-09-26T08:18:49.821Z root INFO Backend s.configure: 0.2 ms [Finished 1.015 s after backend start]
2023-09-26T08:18:49.821Z root INFO Backend l.configure: 0.2 ms [Finished 1.016 s after backend start]
2023-09-26T08:18:49.830Z root INFO Theia app listening on http://localhost:52647.
2023-09-26T08:18:49.831Z root INFO Finished starting backend application: 17.1 ms [Finished 1.026 s after backend start]
2023-09-26T08:18:49.855Z root WARN The local plugin referenced by local-dir:/c%3A/Users/malit/.arduinoIDE/plugins does not exist.
2023-09-26T08:18:49.862Z root WARN The local plugin referenced by local-dir:/c%3A/Users/malit/.arduinoIDE/extensions does not exist.
2023-09-26T08:18:49.870Z root WARN The local plugin referenced by local-dir:C:\Users\malit\.arduinoIDE\plugins does not exist.
2023-09-26T08:18:49.924Z config INFO Loaded CLI configuration: {"board_manager":{"additional_urls":[]},"build_cache":{"compilations_before_purge":10,"ttl":"720h0m0s"},"daemon":{"port":"50051"},"directories":{"data":"C:\\Users\\malit\\AppData\\Local\\Arduino15","downloads":"C:\\Users\\malit\\AppData\\Local\\Arduino15\\staging","user":"C:\\Users\\malit\\OneDrive\\Documents\\Arduino"},"library":{"enable_unsafe_install":false},"logging":{"file":"","format":"text","level":"info"},"metrics":{"addr":":9090","enabled":true},"output":{"no_color":false},"sketch":{"always_export_binaries":false},"updater":{"enable_notification":true}}
2023-09-26T08:18:49.925Z config INFO 'directories.data' and 'directories.user' are set in the CLI configuration model.
2023-09-26T08:18:49.930Z config INFO Loaded the CLI configuration.
2023-09-26T08:18:49.932Z config INFO Mapped the CLI configuration: {"dataDirUri":"file:///c%3A/Users/malit/AppData/Local/Arduino15","sketchDirUri":"file:///c%3A/Users/malit/OneDrive/Documents/Arduino","additionalUrls":[],"network":"none","locale":"en"}
2023-09-26T08:18:49.933Z config INFO Validating the CLI configuration...
2023-09-26T08:18:49.938Z config INFO The CLI config is valid.
2023-09-26T08:18:49.939Z config INFO <<< Initialized the CLI configuration.
2023-09-26T08:18:50.028Z root INFO Resolve plugins list: 222.6 ms [Finished 1.223 s after backend start]
2023-09-26T08:18:50.091Z daemon INFO time="2023-09-26T13:48:50+05:30" level=info msg="Using config file: c:\\Users\\malit\\.arduinoIDE\\arduino-cli.yaml"
time="2023-09-26T13:48:50+05:30" level=info msg="arduino-cli.exe version 0.34.0"
time="2023-09-26T13:48:50+05:30" level=info msg="Executing `arduino-cli daemon`"
2023-09-26T08:18:50.106Z daemon INFO Daemon is now listening on 127.0.0.1:52648
{"IP":"127.0.0.1","Port":"52648"}
2023-09-26T08:18:50.107Z daemon INFO Daemon is running.
2023-09-26T08:18:50.441Z daemon INFO time="2023-09-26T13:48:50+05:30" level=info msg="Updating libraries index"
time="2023-09-26T13:48:50+05:30" level=info msg="Starting download" url="https://downloads.arduino.cc/libraries/library_index.tar.bz2"
2023-09-26T08:18:52.365Z root INFO Deploy plugins list: 222.6 ms [Finished 3.560 s after backend start]
Opening channel for service path '/services/electron-window'.
Opening channel for service path '/services/ide-updater'.
2023-09-26T08:18:53.005Z root WARN Frontend a.configure took longer than the expected maximum 100 milliseconds: 336.1 ms [Finished 2.995 s after frontend start]
2023-09-26T08:18:53.019Z root WARN A command editor.action.toggleStickyScroll is already registered.
2023-09-26T08:19:09.664Z root ERROR Detected an error response during the gRPC core client initialization: code: 3, message: Error downloading index 'https://downloads.arduino.cc/libraries/library_index.tar.bz2': Get "https://downloads.arduino.cc/libraries/library_index.tar.bz2": read tcp [2402:4000:1241:c66a:d45e:7f55:a116:6d62]:52653->[2606:4700:4400::ac40:9b37]:443: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
2023-09-26T08:19:09.666Z root ERROR Detected an error response during the gRPC core client initialization: code: 9, message: Loading index file: loading json index file C:\Users\malit\AppData\Local\Arduino15\package_index.json: open C:\Users\malit\AppData\Local\Arduino15\package_index.json: The system cannot find the file specified.
2023-09-26T08:19:09.670Z root ERROR Detected an error response during the gRPC core client initialization: code: 9, message: Error loading hardware platform: discovery builtin:serial-discovery not found
2023-09-26T08:19:09.674Z root ERROR Detected an error response during the gRPC core client initialization: code: 9, message: Error loading hardware platform: discovery builtin:mdns-discovery not found
2023-09-26T08:19:09.676Z root ERROR Detected an error response during the gRPC core client initialization: code: 9, message: Loading index file: reading library_index.json: open C:\Users\malit\AppData\Local\Arduino15\library_index.json: The system cannot find the file specified.
2023-09-26T08:19:09.684Z root ERROR The primary packages indexes are missing. Running indexes update before initializing the core gRPC client The index of the cores and libraries must be updated before initializing the core gRPC client.
The following problems were detected during the gRPC client initialization:
[platform-index] - code: 9, message: Loading index file: loading json index file C:\Users\malit\AppData\Local\Arduino15\package_index.json: open C:\Users\malit\AppData\Local\Arduino15\package_index.json: The system cannot find the file specified.
[platform-index] - code: 9, message: Error loading hardware platform: discovery builtin:serial-discovery not found
[platform-index] - code: 9, message: Error loading hardware platform: discovery builtin:mdns-discovery not found
[library-index] - code: 9, message: Loading index file: reading library_index.json: open C:\Users\malit\AppData\Local\Arduino15\library_index.json: The system cannot find the file specified.

2023-09-26T08:19:09.687Z daemon INFO time="2023-09-26T13:49:09+05:30" level=info msg="Loading hardware from: C:\\Users\\malit\\AppData\\Local\\Arduino15\\packages"
time="2023-09-26T13:49:09+05:30" level=info msg="Loading libraries index file" index="C:\\Users\\malit\\AppData\\Local\\Arduino15\\library_index.json"
time="2023-09-26T13:49:09+05:30" level=info msg="Adding libraries dir" dir="C:\\Users\\malit\\AppData\\Local\\Arduino15\\libraries" location=ide
time="2023-09-26T13:49:09+05:30" level=info msg="Adding libraries dir" dir="C:\\Users\\malit\\OneDrive\\Documents\\Arduino\\libraries" location=user
time="2023-09-26T13:49:09+05:30" level=info msg="Updating libraries index"
2023-09-26T08:19:09.691Z daemon INFO time="2023-09-26T13:49:09+05:30" level=info msg="Updating index" url="https://downloads.arduino.cc/packages/package_index.tar.bz2"
2023-09-26T08:19:09.700Z root INFO core-client-provider [platform-index] Downloading index: package_index.tar.bz2

2023-09-26T08:19:09.702Z root INFO core-client-provider [library-index] Downloading index: library_index.tar.bz2

2023-09-26T08:19:09.703Z daemon INFO time="2023-09-26T13:49:09+05:30" level=info msg="Starting download" url="https://downloads.arduino.cc/packages/package_index.tar.bz2"
time="2023-09-26T13:49:09+05:30" level=info msg="Starting download" url="https://downloads.arduino.cc/libraries/library_index.tar.bz2"
2023-09-26T08:19:42.400Z root ERROR Failed to update platform, library indexes. Error: 13 INTERNAL: Error downloading index 'https://downloads.arduino.cc/libraries/library_index.tar.bz2': Get "https://downloads.arduino.cc/libraries/library_index.tar.bz2": read tcp [2402:4000:1241:c66a:d45e:7f55:a116:6d62]:52680->[2606:4700:4400::ac40:9b37]:443: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
    at t.callErrorFromStatus (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:726940)
    at Object.onReceiveStatus (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:754480)
    at Object.onReceiveStatus (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:747504)
    at C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:833048
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
for call at
    at a.makeServerStreamRequest (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:754247)
    at a.updateLibrariesIndex (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:818456)
    at C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:587296
    at C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:587489
    at new Promise (<anonymous>)
    at _.doUpdateIndex (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:587468)
    at _.updateLibraryIndex (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:587268)
    at _.updateIndex (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:586542)
    at _.initInstanceWithFallback (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:584725)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-09-26T08:19:42.405Z daemon INFO time="2023-09-26T13:49:42+05:30" level=info msg="Updating libraries index"
2023-09-26T08:19:42.420Z daemon INFO time="2023-09-26T13:49:42+05:30" level=info msg="Starting download" url="https://downloads.arduino.cc/libraries/library_index.tar.bz2"
2023-09-26T08:20:01.634Z root ERROR Detected an error response during the gRPC core client initialization: code: 3, message: Error downloading index 'https://downloads.arduino.cc/libraries/library_index.tar.bz2': Get "https://downloads.arduino.cc/libraries/library_index.tar.bz2": read tcp [2402:4000:1241:c66a:d45e:7f55:a116:6d62]:52723->[2606:4700:4400::ac40:9b37]:443: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
2023-09-26T08:20:01.635Z root ERROR Detected an error response during the gRPC core client initialization: code: 9, message: Loading index file: loading json index file C:\Users\malit\AppData\Local\Arduino15\package_index.json: open C:\Users\malit\AppData\Local\Arduino15\package_index.json: The system cannot find the file specified.
2023-09-26T08:20:01.638Z daemon INFO time="2023-09-26T13:50:01+05:30" level=info msg="Loading hardware from: C:\\Users\\malit\\AppData\\Local\\Arduino15\\packages"
time="2023-09-26T13:50:01+05:30" level=info msg="Loading libraries index file" index="C:\\Users\\malit\\AppData\\Local\\Arduino15\\library_index.json"
time="2023-09-26T13:50:01+05:30" level=info msg="Adding libraries dir" dir="C:\\Users\\malit\\AppData\\Local\\Arduino15\\libraries" location=ide
time="2023-09-26T13:50:01+05:30" level=info msg="Adding libraries dir" dir="C:\\Users\\malit\\OneDrive\\Documents\\Arduino\\libraries" location=user
2023-09-26T08:20:01.640Z root ERROR Detected an error response during the gRPC core client initialization: code: 9, message: Error loading hardware platform: discovery builtin:serial-discovery not found
2023-09-26T08:20:01.644Z root ERROR Detected an error response during the gRPC core client initialization: code: 9, message: Error loading hardware platform: discovery builtin:mdns-discovery not found
2023-09-26T08:20:01.646Z root ERROR Detected an error response during the gRPC core client initialization: code: 9, message: Loading index file: reading library_index.json: open C:\Users\malit\AppData\Local\Arduino15\library_index.json: The system cannot find the file specified.
2023-09-26T08:20:01.648Z root ERROR Uncaught Exception:  Error: The index of the cores and libraries must be updated before initializing the core gRPC client.
The following problems were detected during the gRPC client initialization:
[platform-index] - code: 9, message: Loading index file: loading json index file C:\Users\malit\AppData\Local\Arduino15\package_index.json: open C:\Users\malit\AppData\Local\Arduino15\package_index.json: The system cannot find the file specified.
[platform-index] - code: 9, message: Error loading hardware platform: discovery builtin:serial-discovery not found
[platform-index] - code: 9, message: Error loading hardware platform: discovery builtin:mdns-discovery not found
[library-index] - code: 9, message: Loading index file: reading library_index.json: open C:\Users\malit\AppData\Local\Arduino15\library_index.json: The system cannot find the file specified.

2023-09-26T08:20:01.648Z root ERROR Error: The index of the cores and libraries must be updated before initializing the core gRPC client.
The following problems were detected during the gRPC client initialization:
[platform-index] - code: 9, message: Loading index file: loading json index file C:\Users\malit\AppData\Local\Arduino15\package_index.json: open C:\Users\malit\AppData\Local\Arduino15\package_index.json: The system cannot find the file specified.
[platform-index] - code: 9, message: Error loading hardware platform: discovery builtin:serial-discovery not found
[platform-index] - code: 9, message: Error loading hardware platform: discovery builtin:mdns-discovery not found
[library-index] - code: 9, message: Loading index file: reading library_index.json: open C:\Users\malit\AppData\Local\Arduino15\library_index.json: The system cannot find the file specified.

    at C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:586285
    at _.evaluateErrorStatus (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:586301)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async s.<anonymous> (C:\Program Files\Arduino IDE\resources\app\lib\backend\main.js:2:585971)
[10164:0926/135048.897:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is disabled, ANGLE is


Hi @gmpsankalpa. I see the problem here:

On the first run after a fresh installation, Arduino IDE downloads some additional essential components from the Internet and installs them. If it can't install those components then the startup fails. So the computer must have access to the Internet on the first startup.

The errors indicate Arduino IDE is not able to access the Internet. If it is not already, please connect your computer to the Internet, close the Arduino IDE window, then start Arduino IDE again. This time it should start up successfully.

After that first run, an Internet connection is not required. However, there are some supplemental features such as "Library Manager" that have an inherent dependency on the Internet. Those features will not be usable while your computer is offline. But the essential functionality of editing, compiling, and uploading sketches will be available even without an Internet connection.