Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

qnamaker ignores proxy settings #712

Closed
mplwork opened this issue Oct 26, 2018 · 9 comments · Fixed by #770
Closed

qnamaker ignores proxy settings #712

mplwork opened this issue Oct 26, 2018 · 9 comments · Fixed by #770
Assignees
Labels
4.2 December 15, 2018 Release investigate qnamaker-cli Issues related to qnamaker CLI Support Requesting assistance from the Support Team

Comments

@mplwork
Copy link

mplwork commented Oct 26, 2018

Tool

Name: QnAMaker
Version: 1.0.33
OS: Windows 10

Describe the bug

qnamaker doesn't use any of the node/npm proxy settings:

NODE_TLS_REJECT_UNAUTHORIZED=0
HTTP_PROXY=http://localhost:8888
HTTPS_PROXY=http://localhost:8888
 pc> qnamaker create kb --in cognitiveModels/dispatch.qna --subscriptionKey aXXXXXXX95 --msbot

FetchError: request to https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/knowledgebases/createasync failed, reason: connect ECONNREFUSED 40.112.254.71:443
 pc> npm config list
; cli configs
metrics-registry = "http://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.4.1 node/v8.12.0 win32 x64"

; userconfig C:\Users\mplwork\.npmrc
https-proxy = "http://localhost:8888/"
proxy = "http://localhost:8888/"
registry = "http://registry.npmjs.org/"
strict-ssl = false

Any valid ECONNREFUSED would list 127.0.0.1:8888 as the address.

To Reproduce

See above, set the environment variables and run the qnamaker command.

Expected behavior

It should connect using the proxy.

Additional context

Settings in .npmrc aren't used either.

[bug]

@sgellock sgellock added 4.2 December 15, 2018 Release investigate labels Oct 26, 2018
@sgellock
Copy link
Member

we need to update our auto-rest version, and see where we land on this.

@dmvtech
Copy link
Contributor

dmvtech commented Oct 27, 2018

I noticed your SSL proxy was not https. If you change that, does it work?

https-proxy = "http://localhost:8888/"

To:

https-proxy = "https://localhost:8888/"

@stevengum
Copy link
Member

I set the environment variables:

NODE_TLS_REJECT_UNAUTHORIZED=0
HTTP_PROXY=http://localhost:8888
HTTPS_PROXY=http://localhost:8888

And used the following command in the Node.js dispatch sample:

qnamaker create kb --in cognitiveModels/dispatch.qna --subscriptionKey aXXXXXXX95 --msbot

Which succeeded with no problems...

I couldn't get a repro; @Zerryth, @stevkan or @nyxsys can any of you get a repro on this?

@stevengum stevengum added the Support Requesting assistance from the Support Team label Oct 31, 2018
@Zerryth Zerryth assigned Zerryth and stevkan and unassigned Zerryth Nov 1, 2018
@CoHealer
Copy link

CoHealer commented Nov 1, 2018

@dmvtech set his https-proxy config to "https://localhost:8888/". @stevengum, it looks like you didn't:

HTTPS_PROXY=http://localhost:8888

Does this repro with that configuration set to https?

@dmvtech
Copy link
Contributor

dmvtech commented Nov 1, 2018

I've ran a few more tests, just to make sure I had all my own ducks in a row.

I configured:
NODE_TLS_REJECT_UNAUTHORIZED=0
HTTP_PROXY=http://localhost:8888
HTTPS_PROXY=http://localhost:8888

Tested, no Fiddler running. Success.
Tested, with Fiddler running/capturing (port 8888). Success. But do not see traffic in Fiddler.

Changed configuration:
NODE_TLS_REJECT_UNAUTHORIZED=0
HTTP_PROXY=http://localhost:8888
HTTPS_PROXY=https://localhost:8888

Tested, no Fiddler running. Success.
Tested, with Fiddler running/capturing (port 8888). Success. But do not see traffic in Fiddler.

@stevkan
Copy link

stevkan commented Nov 6, 2018

@dmvtech, I noticed your using Node v8.12.0. I just tried to repro and it succeeded in creating the kb with no errors. I am using Node v10.3.0. Could you update and try again?

@mplwork
Copy link
Author

mplwork commented Nov 7, 2018

I'd want to maybe clarify my report a little. If you don't see traffic in Fiddler then Fiddler isn't used and if you don't have a corporate proxy to block Internet access qnamaker will always succeed. So not seeing traffic in Fiddler proves my point.

@vishwacsena vishwacsena added the qnamaker-cli Issues related to qnamaker CLI label Nov 7, 2018
@stevengum stevengum removed their assignment Nov 7, 2018
@tomlm
Copy link
Contributor

tomlm commented Nov 9, 2018

Azure/ms-rest-js#169

@justinwilaby
Copy link
Contributor

justinwilaby commented Nov 15, 2018

Careful here! QnAMaker does not use ms-rest-js and implementing Node specific proxy settings will break the library when used on Web clients.

The approach here should take into account that both web and node compatibility should be preserved.

@justinwilaby justinwilaby self-assigned this Nov 15, 2018
justinwilaby pushed a commit that referenced this issue Nov 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4.2 December 15, 2018 Release investigate qnamaker-cli Issues related to qnamaker CLI Support Requesting assistance from the Support Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants