1

I don't have much experience working with network related stuff, please excuse me if my question is too lame.

I created an executable file with a python script (using pyinstaller). Basically the script uses Rest services to look up data.

I passed this exe to two of my colleagues and tested in their machines. The first machine passed the test (exe file executed as expected).

But the second machine failed with

File "site-packages\TM1py\Services\TM1Service.py", line 12, in __init__
File "site-packages\TM1py\Services\RESTService.py", line 96, in __init__
File "site-packages\TM1py\Services\RESTService.py", line 169, in _start_session
File "site-packages\requests\sessions.py", line 525, in get
File "site-packages\requests\sessions.py", line 512, in request
File "site-packages\requests\sessions.py", line 622, in send
File "site-packages\requests\adapters.py", line 388, in send
File "site-packages\requests\adapters.py", line 292, in get_connection
requests.exceptions.InvalidProxyURL: Please check proxy URL. It is malformed and could be missing the host.

I could see that there is some issue with the proxy settings. So, when I checked the proxy settings I found something weird. I'm attaching screenshots of the proxy settings. The first screenshot is from the successful machine and the latter from failure.

enter image description here

Please advice me how to resolve this issue, what am I missing here?

Thanks,

User1493
  • 481
  • 2
  • 7
  • 23
  • What is the value of the actual proxy URL? Is it set via `os.environ['http_proxy']` or by some other mechanism? – tripleee Feb 14 '19 at 13:59
  • These two are virtual machines (VDI), I didn't setup any proxy URL. Not sure what the actual proxy URL is, as the 'settings' option in the 'connections' tab is hidden. – User1493 Feb 14 '19 at 14:37
  • The traceback tells you exactly which code lines to inspect. But if this is set in the environment, `echo "$http_proxy"` at the command line prompt is all you need. – tripleee Feb 14 '19 at 15:42
  • 1
    Usually this happens when someone sets `http_proxy=localhost:3128` instead of `http_proxy=http://localhost:3128/` – tripleee Feb 14 '19 at 15:43
  • Any idea how to resolve this situation? – User1493 Feb 15 '19 at 06:59
  • Figure out where it's set and what it's set to, but the information in your question is not sufficient to tell you anything more at this point. Again, the code around line 292 in `requests/adapters.py` might contain hints. – tripleee Feb 15 '19 at 07:17
  • ... I looked through the call chain and nothing obvious jumped out. Again, I would suggest you check for common proxy settings, and/or increase the `requests` debug level to see what it's doing. See e.g. https://stackoverflow.com/questions/10588644/how-can-i-see-the-entire-http-request-thats-being-sent-by-my-python-application (not sure if that's current). – tripleee Feb 15 '19 at 07:26
  • Is there a way to check the proxy settings? As the provided screenshot doesn't help. Do we have another way? – User1493 Feb 15 '19 at 07:48
  • This looks like Windows, so not really my turf, but quick googling suggests something like `netsh winhttp show proxy` at the administrator's `cmd` prompt should display the current proxy settings. See also https://superuser.com/questions/346372/how-do-i-know-what-proxy-server-im-using – tripleee Feb 15 '19 at 08:10
  • Googled the same command and got the below results from both the machines: **Current WinHTTP proxy settings: Direct access (no proxy server).** – User1493 Feb 15 '19 at 09:38
  • Then try the other answers in the SuperUser question. – tripleee Feb 15 '19 at 09:44

0 Answers0