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

Can not connect to REST services on local network and domain-joined hosts #11

Closed
azunyuuuuuuu opened this issue Sep 18, 2019 · 28 comments
Closed
Labels
bug Something isn't working

Comments

@azunyuuuuuuu
Copy link

When trying to call a REST service residing on the local or domain-joined network I get the following error message:

An error occurred while sending the request. The text associated with this error code could not be found.

A connection with the server could not be established

Using the command checknetisolation debug -p=S-1-15-2-2472482401-1297737560-3464812208-2778208509-1273584065-1826830168-474783446 I was able to get the following output which basically states that the capabilities for PrivateNetworkClientServer are not enabled in the .appxmanifest file:

C:\WINDOWS\system32> checknetisolation debug -p=S-1-15-2-2472482401-1297737560-3464812208-2778208509-1273584065-1826830168-474783446

Network Isolation Debug Session started.
Reproduce your scenario, then press Ctrl-C when done.
      Collecting Logs.....

Summary Report

Network Capabilities Status
----------------------------------------------------------------------
    InternetClient                Not Used and Insecure
    PrivateNetworkClientServer    Missing, maybe intended


Detailed Traffic Report
----------------------------------------------------------------------

    InternetClient                Not Used and Insecure

 ------------------------------------------------------------------


    PrivateNetworkClientServer    Missing, maybe intended

 ------------------------------------------------------------------
      <ip address of host>

OK.

Please enable this capability for us to be able to call REST services on the local network.

@dpaulino
Copy link
Contributor

Hi @azunyuuuuuuu thanks for reaching out.

Nightingale should be capable of connecting to your localhost on the same machine. Have you tried turning this off in the settings menu?

image

@dpaulino
Copy link
Contributor

Also, regarding domain-joined hosts, yes that's a known issue. I have an upcoming update to add the PrivateNetworkClientServer capability to the app manifest. I'll ping this issue again once that update is live, and I will ask you at that time to check if the issue was fixed.

@dpaulino dpaulino added the bug Something isn't working label Sep 18, 2019
@azunyuuuuuuu
Copy link
Author

azunyuuuuuuu commented Sep 18, 2019

Hi @azunyuuuuuuu thanks for reaching out.

Nightingale should be capable of connecting to your localhost on the same machine. Have you tried turning this off in the settings menu?

image

This was the first thing I tried, as I suspected it is the ssl certificate. It didn't work :( But querying REST interfaces outside of the local network worked fine with this activated and deactivated.

Also, regarding domain-joined hosts, yes that's a known issue. I have an upcoming update to add the PrivateNetworkClientServer capability to the app manifest. I'll ping this issue again once that update is live, and I will ask you at that time to check if the issue was fixed.

Thank you very much. I`ll be waiting until then.

Edit:
I also found this while researching this bug: microsoft/testfx@26d82ca#diff-d9ff8be6d8da869ef024d763664ccfc5R43

This commit shows where to put the capability.

@dpaulino
Copy link
Contributor

An update is coming in a few days to the preview program. Any chance you're interested in joining? The fix will be included in there. If you're interested, feel free to sign up here https://forms.office.com/Pages/ResponsePage.aspx?id=DQSIkWdsW0yxEjajBLZtrQAAAAAAAAAAAANAAQduPxpURU8zSUFNUTBYRDVSUkhJS0JQOE8yTFZYTy4u

@azunyuuuuuuu
Copy link
Author

I have signed up for the preview program and will try it as soon as the preview is available.

@dpaulino
Copy link
Contributor

The newest preview build just went live with the PrivateNetworkClientServer capability included. The version of the preview build is 3.0.2. Please let me know if that fixes your issue.

@azunyuuuuuuu
Copy link
Author

The newest release fixes this flawlessly. Tyvm :)

@dpaulino
Copy link
Contributor

Thanks for confirming!

@dpaulino dpaulino added the pending release Work completed. Will be available in a future release. label Sep 20, 2019
@dpaulino dpaulino removed the pending release Work completed. Will be available in a future release. label Oct 1, 2019
@rasmusfjord
Copy link

So im still getting this issue :( On localhost:
An error occurred while sending the request

Have tried the SSL switch off but still getting this. Isnt this released yet?

@zippoxer
Copy link

Getting this problem as well.

@cherepets
Copy link

Still getting same error

@delzac
Copy link

delzac commented Sep 29, 2020

Hi, i'm also getting exceptions when connecting to localhost.


An error occurred while sending the request.
   at System.Net.Http.HttpClientHandler.<SendAsync>d__113.MoveNext() + 0x361
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotificati
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__62.MoveNext() + 0x316
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotificati
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at Nightingale.Core.Client.NightingaleClient.<SendAsync>d__6.MoveNext() + 0x26c
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotificati
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at Nightingale.Core.Services.RequestSender.<SendRequestAsync>d__5.MoveNext() + 0x14e

@dpaulino
Copy link
Contributor

@dpaulino
Copy link
Contributor

image

@delzac
Copy link

delzac commented Sep 30, 2020

@dpaulino Hi, thanks for the suggestion, i just tried it, didn't work. Don't know why. But its okay, i can live with that. No big deal.

Thank for creating the app too, its really great to use :)

@dpaulino
Copy link
Contributor

What does your localhost url look like? And just to double check, you tried turning off ssl validation in Nightingale's settings?

@delzac
Copy link

delzac commented Sep 30, 2020

Yup, i switched off SSL validation and it still didn't work. Restart my computer too.

The url i used was http://localhost/gec/?text=Hi i also tried http://127.0.0.1/gec/?text=Hi didn't work too.

image

@dpaulino
Copy link
Contributor

@delzac what's running on your localhost? An ASP.NET Core app?

@delzac
Copy link

delzac commented Sep 30, 2020

Hi @dpaulino, i'm running Python 3.6 on Uvicorn with FastAPI.

Thanks for taking the time out to maintain this :)

@dpaulino
Copy link
Contributor

@delzac no problem! Any chance you can set up a github repo that is configured the same way as your python project with a quick readme on how to run it on local host? I'd like to try to reproduce this.

@delzac
Copy link

delzac commented Sep 30, 2020

@dpaulino sure thing! Would a docker image be better or do you prefer the github repo with instructions?

@dpaulino
Copy link
Contributor

@delzac github repo with instructions would be best. Thanks in advance

@delzac
Copy link

delzac commented Sep 30, 2020

@dpaulino Okay! I'll get back to you here again once its up :)

@dpaulino
Copy link
Contributor

@delzac whenever you're ready, can you share your repo link using a new issue? It will be easier to track investigations on your specific scenario in a new issue

@delzac
Copy link

delzac commented Oct 1, 2020

Hi @dpaulino I double checked and realised that the worldaround works! I so so so sorry for taking up your time.

The issue was that i didn't add the port 8000 into the url. LOL. With http://localhost:8000/ everything worked fine.

Once again, thank you for taking the time out to help and create this app. :)

@dpaulino dpaulino pinned this issue Oct 6, 2020
@rodrigo-sobral
Copy link

Hi @dpaulino! Firstly congratz for your awesome app, it is exactly what I was needing.
However, I'm having the same issue. I've already done everything that was said here and still not working.
To give you some context, I'm running a NodeJS web server and I also tried with REST Client extension on VSCode and it worked.
The point is that I don't actually want to use it, you app is faraway more organized.

image

image

Thank you in advance! 😃

@dpaulino
Copy link
Contributor

@RodrigoSobral2000 Have you tried this troubleshoot guide? https://github.com/jenius-apps/nightingale-rest-api-client/blob/master/docs/localhost.md

@rodrigo-sobral
Copy link

I'm sorry for bothering you. I actually didn't have seen that file. It worked just fine.
Thank you once again, keep up with the good work! 😃 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants