Closed user1493 closed 5 years ago
Did you try running the original python script on the second machine ?
The second machine does not have python installed in it. I would like to spread my script with many users, that is the reason I created an executable file (python installation not needed).
I tested this in two more machine and facing the same issue.
Is something broken with this url ?https://wa01399d:9049/api/v1/Configuration/ProductVersion/$value
This is the URL passed to the below line of code in RESTServices.py (line 169)
self._s.get(url=url, headers=self._headers, data='', verify=self._verify)
This URL works https://wa01399d:9049/api/v1/, but the above one throws error "HTTP error 401".
Does this ring any bell?
Upon updating TM1py to the latest version, getting the below errors:
Traceback (most recent call last):
File "find_unused_dimensions.py", line 10, in <module>
File "site-packages\TM1py\Services\TM1Service.py", line 12, in __init__
File "site-packages\TM1py\Services\RESTService.py", line 99, in __init__
File "site-packages\TM1py\Services\RESTService.py", line 177, in _start_session
File "site-packages\TM1py\Services\RESTService.py", line 30, in wrapper
File "site-packages\TM1py\Services\RESTService.py", line 119, in GET
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.
[13820] Failed to execute script find_unused_dimensions
My second machine has no proxy enabled, I confirmed the same with netsh winhttp show proxy
Output:
Current WinHTTP proxy settings: Direct access (no proxy server)
Not sure why the control is getting into if proxy:
after proxy = select_proxy(url, proxies)
So I removed the below lines (288 - 296) from adapters.py and created the executable file again. I used this new executable file in the second machine, now the file worked successfully.
if proxy:
proxy = prepend_scheme_if_needed(proxy, 'http')
proxy_url = parse_url(proxy)
if not proxy_url.host:
raise InvalidProxyURL("Please check proxy URL. It is malformed"
" and could be missing the host.")
proxy_manager = self.proxy_manager_for(proxy)
conn = proxy_manager.connection_from_url(url)
else:
I used this as a workaround, please let me know how to fix this permanently.
This seems to be an issue in the underlying requests library. You can open an issue here.
I raised an issue there some four days back, but not getting any response.
Have added a comment. Let's hope for the best outcome.
OK. Thanks for the update. I will close this issue.
Please try to replicate the issue from your end if possible and provide your comments there.
Thank you very much for your valuable support!
Hi,
I created a python script to export a dimension structure. This script was then converted to an exe file using pyinstaller.
I then called this exe file via cmd in my machine. The exe worked and exported the data. But when I used this exe in another machine, it gave out the highlighted error. Any idea how to sort this out?
code:
Error:
Traceback (most recent call last): File "dim.py", line 16, in
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.
[10048] Failed to execute script dim