OpenTreeOfLife / opentree

Opentree browsing and curation web site. For overarching or cross-repo concerns, please see the 'germinator' repo.

Home Page:http://tree.opentreeoflife.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Taxonomy browser is broken in latest deployment

jimallman opened this issue · comments

I'm adding an issue for this (while also trying to fix it) to document the symptoms and possible remedies.

Recently the taxonomy browser was failing on devtree (500 internal error from Apache), for three reasons:

  • apache config was pointing to an old path to find this CGI script
  • system python version has changed from python2 to python3 (updates needed)
  • missing requests module in the system python

Possible fixes include:

  1. Make the #! (shebang) line in browse.py dynamic, to reflect the installed location. Sadly, this requires moving the file into Ansible as a template file, which removes it from its original context in the opentree repo.
  2. Use some kind of wrapper defined in the apache config, to specify an interpreter inside the desired venv (so requests is available).
  3. Force the shebang to python2, and install the requests module in the system python2 environment. (This adds a lot of unneeded junk IMO.)

I'm working toward solution 2 above, since that seems cleanest...

Last deployment of devtree was using dev branch of ot-ansible, using
ansible-playbook playbk-install-webapp.yml -i hosts --limit devtree

What about installing the system package python3-requests? Sorry if this is a dumb suggests, I'm lacking some of the context.

this is probably not the best path to go, but if things get annoying in the other tacts, then I could dust off the taxonomy-browser branch of ws_wrapper https://github.com/OpenTreeOfLife/ws_wrapper/tree/taxonomy-browser/ws_wrapper to use a pyramid-based approach. I can't recall exactly where that branch stands.

For future reference, here's an example CGI wrapper that can be used to launch in a venv. That said, I do think @bredelings 's solution above is simpler and more transparent.