Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install with Python3 #252

Closed
initrd opened this issue Sep 25, 2019 · 4 comments · Fixed by #272
Closed

Install with Python3 #252

initrd opened this issue Sep 25, 2019 · 4 comments · Fixed by #272

Comments

@initrd
Copy link

initrd commented Sep 25, 2019

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5
  • Ruby: 2.0.0
  • Distribution: CentOS 7.7
  • Module version: master/8b828b695ce1322ee9857ff3f1dcc2eaabb4afe2 with puppet-python 3.0.1

How to reproduce (e.g Puppet code you use)

How do I make the module use the python3/python36 on CentOS 7? With manage_virtualenv, the module uses the 'system' version of Python - 2.7.

Thanks!

@cleverlight
Copy link

I can confirm this is an issue for me too. Since Puppetboard upgraded from release tag v1.0.0 to v1.1.0 and dropped support for Python 2.7, this module no longer support CentOS / RHEL.

Support is notionally possible using SCL rh-python3.6 but there are a number of interlinked issues:

  1. the virtualenv command, which originates from the puppetlabs-python module, prefixes the passed virtualenv_version parameter with 'python'. This makes it impossible to pass a path to /opt/rh/rh-python36/root/usr/bin/python.

  2. I did try symlinking /usr/bin/python3 -> /opt/rh/rh-python36/root/usr/bin/python3.6. The command line python3 --version then correctly reports 3.6.3. I then set the virtualenv_version parameter to 3, which meant that the virtualenv call passed -p python3. /srv/puppetboard/virtenv-puppetboard seems to build out correctly. It contains chardetect, cmark, flask, easy_install, pip etc. and a python3 binary, which reports version 3.6.3.

  3. RHSCL installs Python in a non-standard location then, if enabled, appends that new location to the PATH environment variable for all users. Even though Update module dependencies #2 means it runs the right binary, I think Puppetboard is still struggling to see its package directory, because HTTP requests against Puppetboard return a 500 Internal Error. The error log reports:

mod_wsgi (pid=6227): Target WSGI script '/srv/puppetboard/puppetboard/wsgi.py' cannot be loaded as Python module.
mod_wsgi (pid=6227): Exception occurred processing WSGI script '/srv/puppetboard/puppetboard/wsgi.py'.
Traceback (most recent call last):
  File "/srv/puppetboard/puppetboard/wsgi.py", line 15, in <module>
    from puppetboard.app import app as application
  File "/srv/puppetboard/puppetboard/puppetboard/app.py", line 5, in <module>
    from urllib.parse import unquote, unquote_plus, quote_plus
ImportError: No module named parse

In answer to the OP question, @initrd it is possible to get Puppetboard running on CentOS if you force the Puppetboard web interface (not this Puppetboard Puppet module) back to revision v1.0.0:

  class { '::puppetboard':
    manage_git => false,
    manage_virtualenv => true,
    # doesn't like using symlinked python 3.6, I suspect because of the environment variables/path
    # virtualenv_version => '3',
    # lock to puppetboard 1.0.0 because 1.1.0 breaks virtualenv/parse module
    revision => 'v1.0.0',
  }

There are several ways to resolve this issue:
A. Grapple with an SCL install on CentOS7 and work out how to get Puppetboard v1.1.0 running using /opt/rh/rh-python36/root/usr/bin/python3.6.
B. Make Puppetboard v1.0.0 the default for CentOS/RedHat and flag in the docs that v1.1.0 is incompatible because it requires Python > 3.5.
C. Remove the "CentOS" and "RedHat" tags from this module.

I think these are broadly in order of preference, but I'm sorry to say I haven't been able to find a way to implement fix A.

@dd5154
Copy link

dd5154 commented Jan 8, 2020

I also have this issue and used the workaround to force the web interface back to revision v1.0.0

@vegaaz
Copy link

vegaaz commented Feb 21, 2020

I also have this issue.
OS: Debian 10 (Buster)
Back to revision v1.0.0 solved the problem.

@nmaludy
Copy link
Member

nmaludy commented Mar 17, 2020

+1 having this same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants