Galaxy Client Install Issue

Hello, I am trying to locally install an instance of Galaxy on a MacOSX (High Sierra), and am getting the following error when I try the following command. Please help!

sh run.sh

Installing node into /usr/local/Cellar/galaxy/.venv with nodeenv.
 * Install prebuilt node (10.13.0) .Traceback (most recent call last):
  File "/usr/local/Cellar/galaxy/.venv/bin/nodeenv", line 10, in <module>
    sys.exit(main())
  File "/usr/local/Cellar/galaxy/.venv/lib/python2.7/site-packages/nodeenv.py", line 1076, in main
    create_environment(env_dir, opt)
  File "/usr/local/Cellar/galaxy/.venv/lib/python2.7/site-packages/nodeenv.py", line 905, in create_environment
    install_node(env_dir, src_dir, opt)
  File "/usr/local/Cellar/galaxy/.venv/lib/python2.7/site-packages/nodeenv.py", line 692, in install_node
    download_node_src(node_url, src_dir, opt, prefix)
  File "/usr/local/Cellar/galaxy/.venv/lib/python2.7/site-packages/nodeenv.py", line 542, in download_node_src
    dl_contents = io.BytesIO(urlopen(node_url).read())
  File "/usr/local/Cellar/galaxy/.venv/lib/python2.7/site-packages/nodeenv.py", line 564, in urlopen
    return urllib2.urlopen(req)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1241, in https_open
    context=self._context)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1198, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)>

Not sure I understand what’s going on with the paths here – is this a brew (based on /usr/local/Cellar) or system (/Library/Frameworks/…) Python?

A bit of digging leads me to think this error can arise when Python isn’t compiled with SSL support.

This is a System Python, v2.7 installed in /Library/Frameworks and usually comes with SSL support.

The galaxy was cloned into /usr/local/Cellar though, would this affect it?

Ok, that clears up the path question. /usr/local/Cellar is usually only used for homebrew related stuff, so I probably wouldn’t leave Galaxy here long term, but I don’t think that’s the problem here.

From /usr/local/Cellar/galaxy can you execute these two commands?
source .venv/bin/activate python -c "import ssl; print(ssl.OPENSSL_VERSION)"

I get the following:

OpenSSL 1.0.2q 20 Nov 2018

As far as I can tell, the SSL support is working, but it is unable to connect to the URL?

Yeah, seems like your python isn’t likely the culprit based on that. Any institutional or local firewalls? Is it the same error when you retry?

Can you manually source .venv/bin/activate and then try to do a nodeenv -p -n 10.13.0, and see what that output is?

I am at a University Institution - if we have firewalls, I am not sure what they are.

Again, I get the same error. It has not changed during any of these attempts to sh run.sh

  • Install prebuilt node (10.13.0) .Traceback (most recent call last):
    File “/usr/local/Cellar/galaxy/.venv/bin/nodeenv”, line 10, in
    sys.exit(main())
    File “/usr/local/Cellar/galaxy/.venv/lib/python2.7/site-packages/nodeenv.py”, line 1076, in main
    create_environment(env_dir, opt)
    File “/usr/local/Cellar/galaxy/.venv/lib/python2.7/site-packages/nodeenv.py”, line 905, in create_environment
    install_node(env_dir, src_dir, opt)
    File “/usr/local/Cellar/galaxy/.venv/lib/python2.7/site-packages/nodeenv.py”, line 692, in install_node
    download_node_src(node_url, src_dir, opt, prefix)
    File “/usr/local/Cellar/galaxy/.venv/lib/python2.7/site-packages/nodeenv.py”, line 542, in download_node_src
    dl_contents = io.BytesIO(urlopen(node_url).read())
    File “/usr/local/Cellar/galaxy/.venv/lib/python2.7/site-packages/nodeenv.py”, line 564, in urlopen
    return urllib2.urlopen(req)
    File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py”, line 154, in urlopen
    return opener.open(url, data, timeout)
    File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py”, line 429, in open
    response = self._open(req, data)
    File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py”, line 447, in _open
    ‘_open’, req)
    File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py”, line 407, in _call_chain
    result = func(*args)
    File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py”, line 1241, in https_open
    context=self._context)
    File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py”, line 1198, in do_open
    raise URLError(err)
    urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:727)>

Update on this, my issue was that I have urllib3 installed, but it was looking for urllib2, hence the errors. I have updated the galaxy path to use urllib3 and it is now installed successfully

1 Like

Thanks for the followup on your fix here, good to know what happened!

1 Like

I think I ran into the same issue as you had. Could you elaborate on how to change the galaxy path to use urllib3?

can you explain how you did it?

I worked around it another way on mac OS 10.12.6 (Sierra)

I first used brew to install openssl (although I already have one version of openssl installed)

$brew install openssl

Then I used a script that came with a previous python 3.6 installation that I have done earlier, “InstallCertificates.command” (code is copied below).

After doing these two steps I didnt get more certificate verify failed, and the virtual machine started without more problems

###comments:!/bin/sh

/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 << “EOF”

###comments: install_certifi.py

###comments: sample script to install or update a set of default Root Certificates
###comments: for the ssl module. Uses the certificates provided by the certifi ##comments: package:
###comments: https://pypi.org/project/certifi/

import os
import os.path
import ssl
import stat
import subprocess
import sys

STAT_0o775 = ( stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
| stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP
| stat.S_IROTH | stat.S_IXOTH )

def main():
openssl_dir, openssl_cafile = os.path.split(
ssl.get_default_verify_paths().openssl_cafile)

print(" -- pip install --upgrade certifi")
subprocess.check_call([sys.executable,
    "-E", "-s", "-m", "pip", "install", "--upgrade", "certifi"])

import certifi

# change working directory to the default SSL directory
os.chdir(openssl_dir)
relpath_to_certifi_cafile = os.path.relpath(certifi.where())
print(" -- removing any existing file or link")
try:
    os.remove(openssl_cafile)
except FileNotFoundError:
    pass
print(" -- creating symlink to certifi certificate bundle")
os.symlink(relpath_to_certifi_cafile, openssl_cafile)
print(" -- setting permissions")
os.chmod(openssl_cafile, STAT_0o775)
print(" -- update complete")

if name == ‘main’:
main()
EOF