Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insomnia 10.0.0: Cannot login "Network failed" #7969

Closed
1 task done
phsc84 opened this issue Sep 17, 2024 · 13 comments · Fixed by #7982
Closed
1 task done

Insomnia 10.0.0: Cannot login "Network failed" #7969

phsc84 opened this issue Sep 17, 2024 · 13 comments · Fixed by #7982
Labels
B-bug Bug: general classification S-unverified Status: Unverified by maintainer

Comments

@phsc84
Copy link

phsc84 commented Sep 17, 2024

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.d__431.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.<DownloadUrl>d__3.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.<CheckForUpdate>d__2.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.<CheckForUpdate>d__7.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.<CheckForUpdate>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.<LogIfThrows>d__431.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.d__3.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.d__2.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.d__7.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

@phsc84 phsc84 added B-bug Bug: general classification S-unverified Status: Unverified by maintainer labels Sep 17, 2024
@notjaywu
Copy link
Contributor

@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
Copy link
Author

phsc84 commented Sep 18, 2024

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

@notjaywu
Copy link
Contributor

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

@phsc84
Copy link
Author

phsc84 commented Sep 18, 2024

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

@phsc84
Copy link
Author

phsc84 commented Sep 18, 2024

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

  • Chrome does copy the proxy settings from Windows automatically and that's why it just works.
  • Insomnia does not and therefore you have to set the correct proxy settings manually in order to get a connection.
    image

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
Copy link
Contributor

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

@phsc84
Copy link
Author

phsc84 commented Sep 19, 2024

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

@notjaywu notjaywu mentioned this issue Sep 19, 2024
1 task
@notjaywu
Copy link
Contributor

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

Yes, please.

@phsc84
Copy link
Author

phsc84 commented Sep 19, 2024

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
Copy link
Member

@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
Copy link
Author

phsc84 commented Sep 19, 2024

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:

  • Windows: System proxy settings are found in Internet Options (Control Panel).
  • macOS: They are in System Preferences > Network.
  • Linux: It often depends on the desktop environment (GNOME, KDE) or is configured via environment variables.

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

@subnetmarco
Copy link
Member

@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
Copy link
Author

phsc84 commented Sep 25, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-bug Bug: general classification S-unverified Status: Unverified by maintainer
Projects
None yet
3 participants