Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
34.84k stars 1.97k forks source link

Insomnia 10.0.0: Cannot login "Network failed" #7969

Closed phsc84 closed 1 month ago

phsc84 commented 1 month ago

Expected Behavior

I would expect, that I get logged in.

Actual Behavior

I can only start the local scratchpad and get the error "Network failed, please try again."

Reproduction Steps

  1. Install Insomnia 10.0.0 => OK
  2. Open Insomnia. Insomnia asks to authenticate in the Insomnia web portal. => OK https://app.insomnia.rest/app/auth-app/?loginKey=xxx (obfuscated)
  3. Enter passphrase in Insomnia web portal. Insomnia provides you with the login token. => OK
  4. Enter the login token in the locally installed Insomnia. => NOK "Network failed, please try again."

Is there an existing issue for this?

Additional Information

main.log: [2024-09-17 11:17:12.548] [info] Running version 10.0.0 [2024-09-17 11:17:12.551] [info] [electron client protocol] successfully set default protocol 'insomnia://' [2024-09-17 11:17:12.668] [info] [fix] Running database repairs [2024-09-17 11:17:12.743] [info] [db] Initialized DB at C:\Users\user\AppData\Roaming\Insomnia\insomnia.$TYPE.db [2024-09-17 11:17:12.744] [info] [db] Init responses DB [2024-09-17 11:17:12.745] [info] [db] Init websocket-responses DB [2024-09-17 11:17:12.748] [info] [localstorage] Initialized at C:\Users\user\AppData\Roaming\Insomnia\localStorage [2024-09-17 11:17:12.861] [info] [main] Loading file:///C:/Users/user/AppData/Local/insomnia/app-10.0.0/resources/app.asar/index.html [2024-09-17 11:17:12.876] [info] [main] Registering the hidden window restarting handler [2024-09-17 11:17:12.878] [info] [updater] Using url https://updates.insomnia.rest/updates/win?v=10.0.0&app=com.insomnia.app&channel=stable [2024-09-17 11:17:12.879] [info] [updater] Checking for updates url=https://updates.insomnia.rest/updates/win?v=10.0.0&app=com.insomnia.app&channel=stable [2024-09-17 11:17:13.897] [error] Error: net::ERR_NAME_NOT_RESOLVED at SimpleURLLoaderWrapper. (node:electron/js2c/browser_init:2:115482) at SimpleURLLoaderWrapper.emit (node:events:519:28) [2024-09-17 11:17:14.286] [info] [main] Window ready, handling command line arguments [ 'C:\Users\uppc\AppData\Local\insomnia\app-10.0.0\Insomnia.exe' ] [2024-09-17 11:17:14.288] [info] [main] Check args and create windows [] [2024-09-17 11:17:14.288] [info] [main] Checking for newer version than 10.0.0 [2024-09-17 11:17:14.298] [error] Error: net::ERR_NAME_NOT_RESOLVED at SimpleURLLoaderWrapper. (node:electron/js2c/browser_init:2:115482) at SimpleURLLoaderWrapper.emit (node:events:519:28) [2024-09-17 11:17:14.303] [info] [main] Error checking for newer version Error: net::ERR_UNEXPECTED at SimpleURLLoaderWrapper. (node:electron/js2c/browser_init:2:115482) at SimpleURLLoaderWrapper.emit (node:events:519:28) [2024-09-17 11:17:15.301] [warn] [updater] Error: Command failed: 4294967295 System.AggregateException: Mindestens ein Fehler ist aufgetreten. ---> System.Net.WebException: Der Remoteserver hat einen Fehler zur�ckgegeben: (403) Unzul�ssig. bei System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) bei System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result) bei System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result) --- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde --- bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Squirrel.Utility.d43`1.MoveNext() --- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde --- bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Squirrel.FileDownloader.d3.MoveNext() --- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde --- bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) bei Squirrel.UpdateManager.CheckForUpdateImpl.d2.MoveNext() --- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde --- bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Squirrel.UpdateManager.d7.MoveNext() --- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde --- bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Squirrel.Update.Program.d__8.MoveNext() --- Ende der internen Ausnahmestapel�berwachung --- bei System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) bei System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) bei System.Threading.Tasks.Task1.get_Result() bei Squirrel.Update.Program.executeCommandLine(String[] args) bei Squirrel.Update.Program.main(String[] args) bei Squirrel.Update.Program.Main(String[] args) ---> (Interne Ausnahme #0) System.Net.WebException: Der Remoteserver hat einen Fehler zur�ckgegeben: (403) Unzul�ssig. bei System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) bei System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result) bei System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result) --- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde --- bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Squirrel.Utility.d43`1.MoveNext() --- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde --- bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Squirrel.FileDownloader.d3.MoveNext() --- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde --- bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) bei Squirrel.UpdateManager.CheckForUpdateImpl.d2.MoveNext() --- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde --- bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Squirrel.UpdateManager.d7.MoveNext() --- Ende der Stapel�berwachung vom vorhergehenden Ort, an dem die Ausnahme ausgel�st wurde --- bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Squirrel.Update.Program.d__8.MoveNext()<---

[2024-09-17 11:17:17.528] [error] Error: net::ERR_NAME_NOT_RESOLVED at SimpleURLLoaderWrapper. (node:electron/js2c/browser_init:2:115482) at SimpleURLLoaderWrapper.emit (node:events:519:28)

Insomnia Version

10.0.0

What operating system are you using?

Windows

Operating System Version

Windows 10 Enterprise, 22H2

Installation method

download "Insomnia.Core-10.0.0.exe" from Github

Last Known Working Insomnia version

No response

notjaywu commented 1 month ago

@phsc84 are there any security policies or plugins on your end that would block sending requests to domains updates.insomnia.rest and api.insomnia.rest?

phsc84 commented 1 month ago

We whitelisted everything for Insomnia, so the domains you mentioned are accessible from the local desktop directly. image image

notjaywu commented 1 month ago

Thanks for your information! Could you join this Slack channel https://chat.insomnia.rest? So I can DM for more details.

phsc84 commented 1 month ago

Ok, I'm now on Slack. You will find me under the same username as here on Github.

phsc84 commented 1 month ago

We found the reason, why the URLs api.insomnia.rest and updates.insomnia.rest are accessible from Chrome but not from Insomnia.

As proxy settings are usually hidden in an enterprise environment, it would be awesome if this "copy the proxy settings" feature could be implemented in Insomnia as well.

notjaywu commented 1 month ago

I will close this issue and link other similar issues to this answer. Thanks @phsc84 !

phsc84 commented 1 month ago

@notjaywu Regarding the "copy the proxy settings" feature, should I open a new feature request issue?

notjaywu commented 1 month ago

@notjaywu Regarding the "copy the proxy settings" feature, should I open a new feature request issue?

Yes, please.

phsc84 commented 1 month ago

There are already two feature requests about using the system proxy:

3590 and #5564

That's why I did not create another one but gave the existing ones an upvote.

subnetmarco commented 1 month ago

@notjaywu do you know if there is a way from Electron to fetch then system proxy settings like Chrome does and automatically apply them? (cc @jackkav @gatzjames)

phsc84 commented 1 month ago

No idea, if this helps, but this is what ChatGPT told me:

Steps:

  1. Accessing Proxy Settings:

    • Electron provides a way to get and set proxy settings through the session object.
    • Use session.defaultSession.resolveProxy() to get the proxy information for a URL. This method works for all platforms (Windows, Linux, macOS).
  2. Implementation: You can fetch the proxy settings and pass them to your app like this:

    const { session } = require('electron');
    
    // Fetch the system proxy settings for a specific URL
    session.defaultSession.resolveProxy('http://example.com', (proxy) => {
     console.log('Proxy settings:', proxy);
    
     if (proxy.startsWith('DIRECT')) {
       console.log('No proxy configured.');
     } else {
       console.log('Proxy configured:', proxy);
       // Pass proxy information to your application
     }
    });
    • proxy will return values like DIRECT (no proxy) or proxy server addresses like PROXY example.com:8080.
  3. Handling OS Differences:

    • Electron abstracts the platform-specific proxy configuration. resolveProxy() uses the system’s proxy settings, which means it will respect the system configuration across Windows, macOS, and Linux without needing additional platform-specific code.

    • On Windows and macOS, it retrieves proxy settings from system preferences.

    • On Linux, it respects environment variables such as http_proxy and https_proxy.

Additional Configuration (if needed):

You can also manually set the proxy using setProxy() if the system settings need to be overridden or customized.

   session.defaultSession.setProxy({
     proxyRules: 'http=proxy.example.com:8080;https=secure-proxy.example.com:8443',
     proxyBypassRules: '<local>' // Bypass proxy for local addresses
   }, () => {
     console.log('Proxy has been set.');
   });

Platform-Specific Considerations:

This should cover all the platforms for your Electron app! Let me know if you need more help with this.

subnetmarco commented 1 month ago

@gatzjames please create a preview beta release and link it here, so that we people can try it to confirm the resolution of the issue.

phsc84 commented 1 month ago

The fix is part of release 10.1.0-beta.1.

I just tested it and it works like a charm without having to set the proxy manually. Many thanks to the Insomnia guys for this amazing support!