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

ModuleNotFoundError: No module named 'flask' on RHEL 8 #680

Closed
bschonec opened this issue Mar 29, 2022 · 1 comment
Closed

ModuleNotFoundError: No module named 'flask' on RHEL 8 #680

bschonec opened this issue Mar 29, 2022 · 1 comment

Comments

@bschonec
Copy link

bschonec commented Mar 29, 2022

After days of attempting to solve the problem myself I'm forced to realize that I don't have the skills to debug Python or Apache.

On a brand new RHEL8 system with @minimal installed, I am unable to get Puppetboard installed properly due to an error about the flask module not being found.

Using a simple:

class { 'puppetboard':
  manage_git        => true,       
  manage_virtualenv => true,
}

Apache barks with:

[Tue Mar 29 08:57:24.729351 2022] [wsgi:error] [pid 6074] [remote 1.17.1.5:58516] mod_wsgi (pid=6074): Failed to exec Python script file '/srv/puppetboard/puppetboard/wsgi.py'.
[Tue Mar 29 08:57:24.729453 2022] [wsgi:error] [pid 6074] [remote 1.17.1.5:58516] mod_wsgi (pid=6074): Exception occurred processing WSGI script '/srv/puppetboard/puppetboard/wsgi.py'.
[Tue Mar 29 08:57:24.729764 2022] [wsgi:error] [pid 6074] [remote 1.17.1.5:58516] Traceback (most recent call last):
[Tue Mar 29 08:57:24.729823 2022] [wsgi:error] [pid 6074] [remote 1.17.1.5:58516]   File "/srv/puppetboard/puppetboard/wsgi.py", line 14, in <module>
[Tue Mar 29 08:57:24.729831 2022] [wsgi:error] [pid 6074] [remote 1.17.1.5:58516]     from puppetboard.app import app as application
[Tue Mar 29 08:57:24.729840 2022] [wsgi:error] [pid 6074] [remote 1.17.1.5:58516]   File "/srv/puppetboard/puppetboard/puppetboard/app.py", line 7, in <module>
[Tue Mar 29 08:57:24.729845 2022] [wsgi:error] [pid 6074] [remote 1.17.1.5:58516]     from flask import render_template, Response
[Tue Mar 29 08:57:24.729863 2022] [wsgi:error] [pid 6074] [remote 1.17.1.5:58516] ModuleNotFoundError: No module named 'flask'

Now, Puppetboard does seem to install properly but it's the Python module (I hope I'm describing it properly) that's giving me trouble.

Apache is running, but I get the following from curl/browser:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

A manual run of the WSGI yeilds:

[root@rhel8gold ~]# python3.8 /srv/puppetboard/puppetboard/wsgi.py
Traceback (most recent call last):
  File "/srv/puppetboard/puppetboard/wsgi.py", line 14, in <module>
    from puppetboard.app import app as application
  File "/srv/puppetboard/puppetboard/puppetboard/app.py", line 7, in <module>
    from flask import render_template, Response
ModuleNotFoundError: No module named 'flask'

It's been about four years since I've implemented a Puppet environment so I'm a bit rusty. I've tried the recommendations here:

#527

and here:

#582

but to no avail.

I've had even less success with RHEL7.

SELinux is off and the local firewall allows incoming TCP/80.

Here's my apache vhost config:

<VirtualHost *:80>
  ServerName rhel8gold-puppetboard

  ## Vhost docroot
  DocumentRoot "/srv/puppetboard/puppetboard"

  ## Directories, there should at least be a declaration for /srv/puppetboard/puppetboard

  <Directory "/srv/puppetboard/puppetboard">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Require all granted
  </Directory>

  ## Logging
  ErrorLog "/var/log/httpd/rhel8gold-puppetboard_error.log"
  ServerSignature Off
  CustomLog "/var/log/httpd/rhel8gold-puppetboard_access.log" combined

  ## WSGI configuration
  WSGIDaemonProcess puppetboard group=puppetboard python-home=/srv/puppetboard/virtenv-puppetboard threads=5 user=puppetboard
  WSGIProcessGroup puppetboard
  WSGIScriptAlias / "/srv/puppetboard/puppetboard/wsgi.py"
</VirtualHost>
@gdubicki
Copy link
Contributor

Hi @bschonec!

Please recreate the issue in voxpupuli/puppet-puppetboard as it’s a problem with the module, not the app.

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

No branches or pull requests

2 participants