This is complex and annoying.
We get occasional reports of “Failed to connect to server” issues, which are often solved by just starting a new job. This isn’t a new problem in OOD but it’s thorny.
One of our users just did some nice triage but made it thornier.
Every time she got that error, she found
all of them contain traceback with the following error:
pkg_resources.DistributionNotFound: The 'numpy' distribution was
not found and is required by websockify
Note that the websockify installation docs say numpy
is optional
Download one of the releases or the latest development version, extract it
and run python3 setup.py install as root in the directory where you
extracted the files. Normally, this will also install numpy for better
performance, if you don't have it installed already. However, numpy is
optional. If you don't want to install numpy or if you can't compile it,
you can edit setup.py and remove the install_requires=['numpy'], line
before running python3 setup.py install.
Here’s where it gets messy. We run CentOS 7.x
, which has python3.6
and python-websockify 0.6.0
OnDemand requires >= websockify 0.8.0
websockify
installed from source has install_requires=['numpy']
( websockify/setup.py at master · novnc/websockify · GitHub ) which installs the latest numpy
- currently version 1.20.x.
numpy 1.20.x
deprecates support for python 3.6
and now we have a problem.
So on machines built since December last year, the numpy installation during our websockify installation, has been failing - but not preventing the websockify
installation. It looks like it’s working until it’s not.
The probable short term solution is installing CentOS numpy (python36-numpy
via EPEL
) on all machines - version 1.12.1
But longer term…well moving to CentOS8 has been made difficult. We can’t ask websockify
to pin numpy
to 1.19.x
, numpy
wouldn’t and shouldn’t un-deprecate python3.6
.
Anyway. that’s the rant - and if others come looking for a solution to the “Failed to connect to server” error - this might help?