dell/PyU4V

OSError('Tunnel connection failed: 502 Bad Gateway')

uwekerner opened this issue · 4 comments

Hello,

I have been writing some scripts in Python using PyU4V. I did my POC on Windows without any issues. I am now trying to port this to Redhat (Red Hat Enterprise Linux Server release 5.11 (Tikanga)) to integrate the Python scripts with a webserver.

I am pretty sure my config on RH is solid but I am getting a "OSError: Tunnel connection failed: 502 Bad Gateway" error when trying to connect. I am using PyU4V 9.1.5.0 due to Unisphere for Powermax being V9.1.0.14. I am suspecting one of the modules not being the correct versions.

This is the detailed error:
[root@simtcvnd4907 ~]# python3 test.py | more
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 696, in urlopen self._prepare_proxy(conn)
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 964, in _prepare_proxy conn.connect()
File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 366, in connect self._tunnel()
File "/usr/local/lib/python3.9/http/client.py", line 904, in _tunnel
raise OSError("Tunnel connection failed: %d %s" % (code,OSError: Tunnel connection failed: 502 Bad Gateway

pip3 list

Package Version


certifi 2020.12.5
chardet 4.0.0
idna 2.10
pip 20.2.3
prettytable 2.1.0
PyU4V 9.1.5.0
requests 2.25.1
setuptools 49.2.1
six 1.15.0
urllib3 1.26.4
wcwidth 0.2.5

python3 --version

Python 3.9.2

I was wondering if someone could be me in the right direction how to resolve this. Let me know if you need any additional information or details.

Thank you very much.

I had a RedHat server so I've setup the same as you, my unisphere server is 9.2 but I'm using version 9.1.5.0 of PyU4V meaning I'm going to the same endpoints and get same behavior as you. Everything works as expected
[root@localhost /]# python3 test.py
No array id specified. Please set array ID using U4VConn.set_array_id(array_id).
('V9.2.1.1', '92')
[root@localhost /]# python3 -V
Python 3.9.1
[root@localhost /]# pip3 list
Package Version


certifi 2020.12.5
chardet 4.0.0
idna 2.10
pip 20.2.3
prettytable 2.1.0
PyU4V 9.1.5.0
requests 2.25.1
setuptools 49.2.1
six 1.15.0
urllib3 1.26.4
wcwidth 0.2.5
WARNING: You are using pip version 20.2.3; however, version 21.1 is available.
You should consider upgrading via the '/usr/local/bin/python3.9 -m pip install --upgrade pip' command.
[root@localhost /]# python3 test.py
No array id specified. Please set array ID using U4VConn.set_array_id(array_id).
('V9.2.1.1', '92')

Are you running through a proxy server?

Thank you for your answer. I logged on to the VM to capture the output to answer your questions and guess what, it is working now! I am wondering if it was the proxy which I turned off but maybe not in all of the terminal windows. So this could have been an user issue. Thank you again.

No worries, glad to have been able to help, let us know how you're doing with PyU4V and any feedback is always appreciated.