Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a module not included in the server configuration

Dear PrivacyIdea Community,

I am genuinely grateful for any assistance that you can provide and I have spent most of yesterday looking at this issue with no success.

I am trying to install privacyIdea within a Python 3.8.12 virtual environment sat on top of a Red Hat 8.4 operating system.

I have followed the documentation and successfully installed the application using pip as well as the requirements, created the MySQL database, configured the ‘pi’ db user and corresponding permissions, configured the ‘PEPPER’ & ‘SECRET’ values, created the tables and admin user.

So far, so good and almost there! :slight_smile:

I then installed http(apache2) and configured the ‘/etc/privacyidea/pi.cfg’ and attempted to start the httpd service and received the following errors:

Aug 07 09:15:09 otp-i0b7e78298bae47504 systemd[1]: Starting The Apache HTTP Server...
Aug 07 09:15:09 otp-i0b7e78298bae47504 httpd[274527]: AH00526: Syntax error on line 23 of /etc/httpd/conf.d/privacyidea.conf:
Aug 07 09:15:09 otp-i0b7e78298bae47504 httpd[274527]: Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a module not included in the server configuration
Aug 07 09:15:09 otp-i0b7e78298bae47504 systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Aug 07 09:15:09 otp-i0b7e78298bae47504 systemd[1]: httpd.service: Failed with result 'exit-code'.
Aug 07 09:15:09 otp-i0b7e78298bae47504 systemd[1]: Failed to start The Apache HTTP Server.

It appears to suggest that a module, possibly ‘wsgi’, could be missing…?

Here’s my ‘/etc/httpd/conf.d/privacyidea.conf’ file:

(privacyidea) [root@otp-i0b7e78298bae47504 conf.d]# cat privacyidea.conf
<VirtualHost _default_:443>
        ServerAdmin webmaster@localhost
        # You might want to change this
        ServerName localhost

        DocumentRoot /var/www
        <Directory />
                # For Apache 2.4 you need to set this:
                Require all granted
                Options FollowSymLinks
                AllowOverride None
        </Directory>

        # Yubico servers use /wsapi/2.0/verify as the path in the
        # validation URL. Some tools (e.g. Kolab 2fa) let the
        # user/admin change the api host, but not the rest of
        # the URL. Uncomment the following two lines to reroute
        # the api URL internally to privacyideas /ttype/yubikey.
        #RewriteEngine  on
        #RewriteRule    "^/wsapi/2.0/verify"  "/ttype/yubikey" [PT]

        # We can run several instances on different paths with different configurations
        WSGIScriptAlias /      /etc/privacyidea/privacyideaapp.wsgi
        #WSGIScriptAlias /instance1      /home/cornelius/src/privacyidea/deploy/privacyideaapp1.wsgi
        #WSGIScriptAlias /instance2      /home/cornelius/src/privacyidea/deploy/privacyideaapp2.wsgi
        #WSGIScriptAlias /instance3      /home/cornelius/src/privacyidea/deploy/privacyideaapp3.wsgi
        #
        # The daemon is running as user 'privacyidea'
        # This user should have access to the encKey database encryption file
        WSGIDaemonProcess privacyidea processes=1 threads=15 display-name=%{GROUP} user=privacyidea
        WSGIProcessGroup privacyidea
        WSGIApplicationGroup %{GLOBAL}
        WSGIPassAuthorization On

        ErrorLog /var/log/apache2/error.log

        LogLevel warn
        # Do not use %q! This will reveal all parameters, including setting PINs and Keys!
        # Using SSL_CLINET_S_DN_CN will show you, which administrator did what task
        LogFormat "%h %l %u %t %>s \"%m %U %H\"  %b \"%{Referer}i\" \"%{User-agent}i\"" privacyIDEA
        CustomLog /var/log/apache2/ssl_access.log privacyIDEA

        #   SSL Engine Switch:
        #   Enable/Disable SSL for this virtual host.
        SSLEngine on
        SSLProtocol ALL -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
        SSLHonorCipherOrder On
        SSLCipherSuite          ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
        SSLCompression          off
        SSLSessionTickets       off

        # You can turn on HSTS. But as long as you have no valid certificate, this can cause
        # some trouble
        # HSTS (mod_headers is required) (1209600 seconds = 2 weeks)
        # Header always set Strict-Transport-Security "max-age=1209600"


        #   If both key and certificate are stored in the same file, only the
        #   SSLCertificateFile directive is needed.
        SSLCertificateFile    /etc/ssl/certs/privacyideaserver.pem
        SSLCertificateKeyFile /etc/ssl/private/privacyideaserver.key

        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>
        <Directory /usr/lib/cgi-bin>
                SSLOptions +StdEnvVars
        </Directory>
        BrowserMatch ".*MSIE.*" \
                nokeepalive ssl-unclean-shutdown \
                downgrade-1.0 force-response-1.0


</VirtualHost>

# If you want to forward http request to https enable the
# following virtual host.
<VirtualHost _default_:80>
        # This will enable the Rewrite capabilities
        RewriteEngine On

        # This checks to make sure the connection is not already HTTPS
        RewriteCond %{HTTPS} !=on
        RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Here’s a pip list from my virtual enviroment:

(privacyidea) [root@otp-i0b7e78298bae47504 privacyidea]# pip list
Package              Version
-------------------- ------------------
alembic              1.7.7
argon2-cffi          21.3.0
argon2-cffi-bindings 21.2.0
async-timeout        4.0.2
Babel                2.10.1
bcrypt               3.2.2
beautifulsoup4       4.11.1
cachetools           5.0.0
cbor2                5.4.3
certifi              2022.12.7
cffi                 1.15.0
charset-normalizer   2.0.12
click                7.1.2
configobj            5.0.6
croniter             1.3.4
cryptography         38.0.3
defusedxml           0.7.1
Deprecated           1.2.13
Flask                1.1.4
Flask-Babel          2.0.0
Flask-Migrate        2.7.0
Flask-Script         2.0.6
Flask-SQLAlchemy     2.5.1
Flask-Versioned      0.9.4.post20101221
google-auth          2.6.6
grpcio               1.46.0
grpcio-tools         1.46.0
huey                 2.4.3
idna                 3.3
importlib-metadata   4.11.3
importlib-resources  6.0.0
itsdangerous         1.1.0
Jinja2               2.11.3
ldap3                2.8.1
lxml                 4.9.1
Mako                 1.2.2
MarkupSafe           2.0.1
mod-wsgi             4.9.4
mysqlclient          2.2.0
netaddr              0.8.0
packaging            21.3
passlib              1.7.4
pip                  23.2.1
privacyIDEA          3.8.1
protobuf             3.20.2
pyasn1               0.4.8
pyasn1-modules       0.2.8
pycparser            2.21
pydash               5.1.0
PyJWT                2.4.0
PyMySQL              1.0.2
pyOpenSSL            22.0.0
pyparsing            3.0.8
pyrad                2.4
python-dateutil      2.8.2
python-gnupg         0.4.8
pytz                 2022.1
PyYAML               6.0
redis                4.2.2
requests             2.27.1
rsa                  4.8
segno                1.5.2
setuptools           41.6.0
six                  1.16.0
smpplib              2.2.1
soupsieve            2.3.2.post1
SQLAlchemy           1.3.24
sqlsoup              0.9.1
typing_extensions    4.7.1
urllib3              1.26.9
Werkzeug             1.0.1
wrapt                1.14.1
zipp                 3.8.0

Here’s my redacted ‘/etc/privacyidea/privacyideaapp.wsgi’ file:

(privacyidea) [root@otp-i0b7e78298bae47504 privacyidea]# cat privacyideaapp.wsgi
import sys
sys.stdout = sys.stderr
from privacyidea.app import create_app
# Now we can select the config file:
application = create_app(config_name="production", config_file="/etc/privacyidea/pi.cfg")

Here’s my redacted ‘/etc/privacyidea/pi.cfg’ file:

(privacyidea) [root@otp-i0b7e78298bae47504 privacyidea]# cat pi.cfg
# The realm, where users are allowed to login as administrators
#SUPERUSER_REALM = ['super', 'administrators']
# Your database
SQLALCHEMY_DATABASE_URI = 'mysql://pi:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.rds.amazonaws.com:3310/pi'
# Set maximum identifier length to 128
# SQLALCHEMY_ENGINE_OPTIONS = {"max_identifier_length": 128}
# This is used to encrypt the auth_token
SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxx'
# This is used to encrypt the admin passwords
PI_PEPPER = "xxxxxxxxxxxxxxxxxxxxxx"
# This is used to encrypt the token data and token passwords
PI_ENCFILE = '/etc/privacyidea/enckey'
# This is used to sign the audit log
PI_AUDIT_KEY_PRIVATE = '/etc/privacyidea/private.pem'
PI_AUDIT_KEY_PUBLIC = '/etc/privacyidea/public.pem'
# PI_AUDIT_MODULE = <python audit module>
# PI_AUDIT_SQL_URI = <special audit log DB uri>
# Options passed to the Audit DB engine (supersedes SQLALCHEMY_ENGINE_OPTIONS)
# PI_AUDIT_SQL_OPTIONS = {}
# Truncate Audit entries to fit into DB columns
PI_AUDIT_SQL_TRUNCATE = True
PI_LOGFILE = '/var/log/privacyidea/privacyidea.log'
PI_LOGLEVEL = 20
# PI_INIT_CHECK_HOOK = 'your.module.function'
# PI_CSS = '/location/of/theme.css'
# PI_UI_DEACTIVATED = True

I feel as though I am very close to completing the installation just lacking a little knowledge around the WSGI(Web Server Gateway Interface) that sits between apache2 and the privacyIdea application. The pip listing above suggests that the module mod-wsgi(4.9.4) is installed but Im not sure if this installation, which is within the virtual environment, is not accessible to apache process?

A yum listing of all installed packages, searching for entries with the text ‘wsgi’ yields no results:

(privacyidea) [root@otp-i0b7e78298bae47504 privacyidea]# yum list --installed  | grep -i wsgi
(privacyidea) [root@otp-i0b7e78298bae47504 privacyidea]#

However, a listing of available packages, yields multiple potential ‘wsgi’ packages.

(privacyidea) [root@otp-i0b7e78298bae47504 privacyidea]# yum list | grep -i wsgi
python2-WSGIProxy2.noarch                                         0.4.1-14.el8                                                epel_mirror                       
python2-WSGIProxy2.noarch                                         0.4.1-14.el8                                                epel8                             
python3-WSGIProxy2.noarch                                         0.4.1-14.el8                                                epel_mirror                       
python3-WSGIProxy2.noarch                                         0.4.1-14.el8                                                epel8                             
python3-mod_wsgi.x86_64                                           4.6.4-4.el8                                                 rhel-8-appstream-rhui-rpms        
python3-uwsgidecorators.x86_64                                    2.0.20-1.el8                                                epel8                             
python38-mod_wsgi.x86_64                                          4.6.8-3.module+el8.4.0+8888+89bc7e79                        rhel-8-appstream-rhui-rpms        
python39-mod_wsgi.x86_64                                          4.7.1-4.module+el8.4.0+9822+20bf1249                        rhel-8-appstream-rhui-rpms        
uwsgi.x86_64                                                      2.0.20-1.el8                                                epel8                             
uwsgi-alarm-curl.x86_64                                           2.0.20-1.el8                                                epel8                             
uwsgi-alarm-xmpp.x86_64                                           2.0.20-1.el8                                                epel8                             
uwsgi-devel.x86_64                                                2.0.20-1.el8                                                epel8                             
uwsgi-docs.x86_64                                                 2.0.20-1.el8                                                epel8                             
uwsgi-log-encoder-msgpack.x86_64                                  2.0.20-1.el8                                                epel8                             
uwsgi-logger-crypto.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-logger-file.x86_64                                          2.0.20-1.el8                                                epel8                             
uwsgi-logger-graylog2.x86_64                                      2.0.20-1.el8                                                epel8                             
uwsgi-logger-pipe.x86_64                                          2.0.20-1.el8                                                epel8                             
uwsgi-logger-redis.x86_64                                         2.0.20-1.el8                                                epel8                             
uwsgi-logger-rsyslog.x86_64                                       2.0.20-1.el8                                                epel8                             
uwsgi-logger-socket.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-logger-syslog.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-logger-systemd.x86_64                                       2.0.20-1.el8                                                epel8                             
uwsgi-logger-zeromq.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-plugin-airbrake.x86_64                                      2.0.20-1.el8                                                epel8                             
uwsgi-plugin-cache.x86_64                                         2.0.20-1.el8                                                epel8                             
uwsgi-plugin-carbon.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-plugin-cheaper-busyness.x86_64                              2.0.20-1.el8                                                epel8                             
uwsgi-plugin-common.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-plugin-coroae.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-plugin-cplusplus.x86_64                                     2.0.20-1.el8                                                epel8                             
uwsgi-plugin-curl-cron.x86_64                                     2.0.20-1.el8                                                epel8                             
uwsgi-plugin-dumbloop.x86_64                                      2.0.20-1.el8                                                epel8                             
uwsgi-plugin-dummy.x86_64                                         2.0.20-1.el8                                                epel8                             
uwsgi-plugin-fiber.x86_64                                         2.0.20-1.el8                                                epel8                             
uwsgi-plugin-gccgo.x86_64                                         2.0.20-1.el8                                                epel8                             
uwsgi-plugin-geoip.x86_64                                         2.0.20-1.el8                                                epel8                             
uwsgi-plugin-glusterfs.x86_64                                     2.0.20-1.el8                                                epel8                             
uwsgi-plugin-ldap.x86_64                                          2.0.20-1.el8                                                epel8                             
uwsgi-plugin-lua.x86_64                                           2.0.20-1.el8                                                epel8                             
uwsgi-plugin-mongrel2.x86_64                                      2.0.20-1.el8                                                epel8                             
uwsgi-plugin-mono.x86_64                                          2.0.20-1.el8                                                epel8                             
uwsgi-plugin-nagios.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-plugin-notfound.x86_64                                      2.0.20-1.el8                                                epel8                             
uwsgi-plugin-pam.x86_64                                           2.0.20-1.el8                                                epel8                             
uwsgi-plugin-php.x86_64                                           2.0.20-1.el8                                                epel8                             
uwsgi-plugin-psgi.x86_64                                          2.0.20-1.el8                                                epel8                             
uwsgi-plugin-pty.x86_64                                           2.0.20-1.el8                                                epel8                             
uwsgi-plugin-python3.x86_64                                       2.0.20-1.el8                                                epel8                             
uwsgi-plugin-python3-gevent.x86_64                                2.0.20-1.el8                                                epel8                             
uwsgi-plugin-python3-greenlet.x86_64                              2.0.20-1.el8                                                epel8                             
uwsgi-plugin-python3-tornado.x86_64                               2.0.20-1.el8                                                epel8                             
uwsgi-plugin-rack.x86_64                                          2.0.20-1.el8                                                epel8                             
uwsgi-plugin-rbthreads.x86_64                                     2.0.20-1.el8                                                epel8                             
uwsgi-plugin-rpc.x86_64                                           2.0.20-1.el8                                                epel8                             
uwsgi-plugin-rrdtool.x86_64                                       2.0.20-1.el8                                                epel8                             
uwsgi-plugin-ruby.x86_64                                          2.0.20-1.el8                                                epel8                             
uwsgi-plugin-spooler.x86_64                                       2.0.20-1.el8                                                epel8                             
uwsgi-plugin-sqlite3.x86_64                                       2.0.20-1.el8                                                epel8                             
uwsgi-plugin-ssi.x86_64                                           2.0.20-1.el8                                                epel8                             
uwsgi-plugin-ugreen.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-plugin-webdav.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-plugin-xattr.x86_64                                         2.0.20-1.el8                                                epel8                             
uwsgi-plugin-xslt.x86_64                                          2.0.20-1.el8                                                epel8                             
uwsgi-plugin-zergpool.x86_64                                      2.0.20-1.el8                                                epel8                             
uwsgi-router-basicauth.x86_64                                     2.0.20-1.el8                                                epel8                             
uwsgi-router-cache.x86_64                                         2.0.20-1.el8                                                epel8                             
uwsgi-router-expires.x86_64                                       2.0.20-1.el8                                                epel8                             
uwsgi-router-fast.x86_64                                          2.0.20-1.el8                                                epel8                             
uwsgi-router-forkpty.x86_64                                       2.0.20-1.el8                                                epel8                             
uwsgi-router-hash.x86_64                                          2.0.20-1.el8                                                epel8                             
uwsgi-router-http.x86_64                                          2.0.20-1.el8                                                epel8                             
uwsgi-router-memcached.x86_64                                     2.0.20-1.el8                                                epel8                             
uwsgi-router-metrics.x86_64                                       2.0.20-1.el8                                                epel8                             
uwsgi-router-radius.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-router-raw.x86_64                                           2.0.20-1.el8                                                epel8                             
uwsgi-router-redirect.x86_64                                      2.0.20-1.el8                                                epel8                             
uwsgi-router-redis.x86_64                                         2.0.20-1.el8                                                epel8                             
uwsgi-router-rewrite.x86_64                                       2.0.20-1.el8                                                epel8                             
uwsgi-router-spnego.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-router-ssl.x86_64                                           2.0.20-1.el8                                                epel8                             
uwsgi-router-static.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-router-tuntap.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-router-uwsgi.x86_64                                         2.0.20-1.el8                                                epel8                             
uwsgi-router-xmldir.x86_64                                        2.0.20-1.el8                                                epel8                             
uwsgi-stats-pusher-file.x86_64                                    2.0.20-1.el8                                                epel8                             
uwsgi-stats-pusher-socket.x86_64                                  2.0.20-1.el8                                                epel8                             
uwsgi-stats-pusher-statsd.x86_64                                  2.0.20-1.el8                                                epel8                             
uwsgi-stats-pusher-zabbix.x86_64                                  2.0.20-1.el8                                                epel8                             
uwsgi-transformation-chunked.x86_64                               2.0.20-1.el8                                                epel8                             
uwsgi-transformation-gzip.x86_64                                  2.0.20-1.el8                                                epel8                             
uwsgi-transformation-offload.x86_64                               2.0.20-1.el8                                                epel8                             
uwsgi-transformation-template.x86_64                              2.0.20-1.el8                                                epel8                             
uwsgi-transformation-tofile.x86_64                                2.0.20-1.el8                                                epel8                             
uwsgi-transformation-toupper.x86_64                               2.0.20-1.el8                                                epel8                             

Any advice that you can provide on this matter/issue would be greatly appreciated.

Thank you.

Cossy

Hi and welcome Cossy,

looks like you miss a package:

did you install the package “python3-mod_wsgi” ? (not the pip module)

yum install python3-mod_wsgi

mod_wsgi: This is an Apache module that allows you to embed Python applications within the Apache web server. Instead of using a separate server like Gunicorn or uWSGI to serve Python applications, you can use Apache as the web server and deploy Python applications using mod_wsgi.

python3-mod_wsgi: This is the specific package or module that provides the integration between Python 3 and mod_wsgi. It enables Apache to communicate with Python 3 applications and handle the execution of Python code for web requests.

and don’t forget to take care of SElinux, if active.

Br

Julio

1 Like

Thanks Julio, I will try thta now and update you shortly.

You using python 3.8, so you must use the 3.8 Package:

python38-mod_wsgi

not python3-mod.wsgi

br

Julio

Hi Julio,

That resolved my problem, thank you. :slight_smile:

I now have an error relating to a bad username that I will investigate further:

Aug 07 10:20:34 otp-i0b7e78298bae47504 systemd[1]: Starting The Apache HTTP Server...
Aug 07 10:20:34 otp-i0b7e78298bae47504 httpd[275773]: AH00543: httpd: bad user name privacyidea
Aug 07 10:20:34 otp-i0b7e78298bae47504 systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Aug 07 10:20:34 otp-i0b7e78298bae47504 systemd[1]: httpd.service: Failed with result 'exit-code'.
Aug 07 10:20:34 otp-i0b7e78298bae47504 systemd[1]: Failed to start The Apache HTTP Server.

Thanks again.
Cossy

Hi Julio,

I suspect that this relates to the absence of a local o/s user account called ‘privacyidea’.

Yet, there was no mention of the need to create a local user account called ‘privacyidea’ on the server.

There is no corresponding entry within the ‘/etc/passwd’ file so this could be the issue.

Any thoughts?

Have I missed something on the instalaltion documentation?

Regards,
Cossy

Hi Cossy,

if you followed the documentation, you have to create the user “privacyidea”:
so please read it again.

https://privacyidea.readthedocs.io/en/latest/installation/centos.html

Br

Julio

Will do, thank you Julio.

Regards,
Cossy

Hi Julio,

Can you please point me to the location within the documentation where it explains how to generate the self-signed TLS certificates in pem format as configured within the ‘/etc/httpd/conf.d/privacyidea.conf’ file:

Aug 07 10:50:05 otp-i0b7e78298bae47504 systemd[1]: Starting The Apache HTTP Server...
Aug 07 10:50:05 otp-i0b7e78298bae47504 httpd[276415]: AH00526: Syntax error on line 60 of /etc/httpd/conf.d/privacyidea.conf:
Aug 07 10:50:05 otp-i0b7e78298bae47504 httpd[276415]: SSLCertificateFile: file '/etc/ssl/certs/privacyideaserver.pem' does not exist or is empty
Aug 07 10:50:05 otp-i0b7e78298bae47504 systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Aug 07 10:50:05 otp-i0b7e78298bae47504 systemd[1]: httpd.service: Failed with result 'exit-code'.
Aug 07 10:50:05 otp-i0b7e78298bae47504 systemd[1]: Failed to start The Apache HTTP Server.

There are two required certificate files…

[root@otp-i0b7e78298bae47504 conf.d]# cat /etc/httpd/conf.d/privacyidea.conf | grep -i SSLCert
        #   SSLCertificateFile directive is needed.
        SSLCertificateFile    /etc/ssl/certs/privacyideaserver.pem
        SSLCertificateKeyFile /etc/ssl/private/privacyideaserver.key

Thank you,
Cossy

Hi Cossy,

the web is full of howto’s to make a “self signed certificate”, just search for it.

Br
Julio

Hi Julio,

Thanks for the link.

I generated a self-signed certificate and copied the two files to the respective locations and that resolved that particular issue, thank you. I was then able to start the httpd service.

When I tried conecting to the server on either port 80 or 443, I then received an ‘internal server’ type error with no errors in the joutnalctl log for the httpd service or anything else.

I decided to deploy a new, clean server more closely following the CENTOS installation instructions link that you provided. The deployment has completed successfully however I get the same ‘internal server’ error as before.

The ‘ssl_error_log’ includes errors indicating that there is no module named ‘privacyidea’…

[root@otp-i0a01e224db6a2f3d4 httpd]# cat ssl_error_log
[Mon Aug 07 15:43:51.294670 2023] [ssl:warn] [pid 100046:tid 140394952571200] AH01909: otp-i0a01e224db6a2f3d4.nonlive.global.aws.aevi.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Aug 07 15:43:51.322342 2023] [ssl:warn] [pid 100046:tid 140394952571200] AH01909: otp-i0a01e224db6a2f3d4.nonlive.global.aws.aevi.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Aug 07 16:32:17.147062 2023] [ssl:warn] [pid 104504:tid 140533560953152] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Aug 07 16:32:17.173125 2023] [ssl:warn] [pid 104504:tid 140533560953152] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Mon Aug 07 16:32:52.747648 2023] [wsgi:error] [pid 104506:tid 140533128255232] [remote 172.30.0.158:56914] mod_wsgi (pid=104506): Failed to exec Python script file '/etc/privacyidea/privacyideaapp.wsgi'.
[Mon Aug 07 16:32:52.747758 2023] [wsgi:error] [pid 104506:tid 140533128255232] [remote 172.30.0.158:56914] mod_wsgi (pid=104506): Exception occurred processing WSGI script '/etc/privacyidea/privacyideaapp.wsgi'.
[Mon Aug 07 16:32:52.753053 2023] [wsgi:error] [pid 104506:tid 140533128255232] [remote 172.30.0.158:56914] Traceback (most recent call last):
[Mon Aug 07 16:32:52.753088 2023] [wsgi:error] [pid 104506:tid 140533128255232] [remote 172.30.0.158:56914]   File "/etc/privacyidea/privacyideaapp.wsgi", line 3, in <module>
[Mon Aug 07 16:32:52.753097 2023] [wsgi:error] [pid 104506:tid 140533128255232] [remote 172.30.0.158:56914]     from privacyidea.app import create_app
[Mon Aug 07 16:32:52.753113 2023] [wsgi:error] [pid 104506:tid 140533128255232] [remote 172.30.0.158:56914] ModuleNotFoundError: No module named 'privacyidea'
[Mon Aug 07 16:32:52.854939 2023] [wsgi:error] [pid 104506:tid 140533212182272] [remote 172.30.0.158:56916] mod_wsgi (pid=104506): Failed to exec Python script file '/etc/privacyidea/privacyideaapp.wsgi'.
[Mon Aug 07 16:32:52.854996 2023] [wsgi:error] [pid 104506:tid 140533212182272] [remote 172.30.0.158:56916] mod_wsgi (pid=104506): Exception occurred processing WSGI script '/etc/privacyidea/privacyideaapp.wsgi'.
[Mon Aug 07 16:32:52.855097 2023] [wsgi:error] [pid 104506:tid 140533212182272] [remote 172.30.0.158:56916] Traceback (most recent call last):
[Mon Aug 07 16:32:52.855132 2023] [wsgi:error] [pid 104506:tid 140533212182272] [remote 172.30.0.158:56916]   File "/etc/privacyidea/privacyideaapp.wsgi", line 3, in <module>
[Mon Aug 07 16:32:52.855140 2023] [wsgi:error] [pid 104506:tid 140533212182272] [remote 172.30.0.158:56916]     from privacyidea.app import create_app
[Mon Aug 07 16:32:52.855157 2023] [wsgi:error] [pid 104506:tid 140533212182272] [remote 172.30.0.158:56916] ModuleNotFoundError: No module named 'privacyidea'
[Mon Aug 07 16:34:51.842405 2023] [wsgi:error] [pid 104506:tid 140533128255232] [remote 172.30.0.158:56955] mod_wsgi (pid=104506): Failed to exec Python script file '/etc/privacyidea/privacyideaapp.wsgi'.
[Mon Aug 07 16:34:51.842460 2023] [wsgi:error] [pid 104506:tid 140533128255232] [remote 172.30.0.158:56955] mod_wsgi (pid=104506): Exception occurred processing WSGI script '/etc/privacyidea/privacyideaapp.wsgi'.
[Mon Aug 07 16:34:51.842546 2023] [wsgi:error] [pid 104506:tid 140533128255232] [remote 172.30.0.158:56955] Traceback (most recent call last):
[Mon Aug 07 16:34:51.842571 2023] [wsgi:error] [pid 104506:tid 140533128255232] [remote 172.30.0.158:56955]   File "/etc/privacyidea/privacyideaapp.wsgi", line 3, in <module>
[Mon Aug 07 16:34:51.842578 2023] [wsgi:error] [pid 104506:tid 140533128255232] [remote 172.30.0.158:56955]     from privacyidea.app import create_app
[Mon Aug 07 16:34:51.842595 2023] [wsgi:error] [pid 104506:tid 140533128255232] [remote 172.30.0.158:56955] ModuleNotFoundError: No module named 'privacyidea'
[root@otp-i0a01e224db6a2f3d4 httpd]#

The ‘ssl_request_log’ looks clean:

[root@otp-i0a01e224db6a2f3d4 httpd]# cat ssl_request_log
[07/Aug/2023:16:32:52 +0100] 172.30.0.158 TLSv1.3 TLS_AES_256_GCM_SHA384 "GET / HTTP/1.1" 532
[07/Aug/2023:16:32:52 +0100] 172.30.0.158 TLSv1.3 TLS_AES_256_GCM_SHA384 "GET /favicon.ico HTTP/1.1" 532
[07/Aug/2023:16:34:51 +0100] 172.30.0.158 TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 "GET / HTTP/1.1" 532
[root@otp-i0a01e224db6a2f3d4 httpd]#

The ssl_access_log loks good too.

[root@otp-i0a01e224db6a2f3d4 httpd]# cat ssl_access_log
172.30.0.158 - - [07/Aug/2023:16:32:52 +0100] "GET / HTTP/1.1" 500 532
172.30.0.158 - - [07/Aug/2023:16:32:52 +0100] "GET /favicon.ico HTTP/1.1" 500 532
172.30.0.158 - - [07/Aug/2023:16:34:51 +0100] "GET / HTTP/1.1" 500 532

The error_log doesnt look too shabby either…

[root@otp-i0a01e224db6a2f3d4 httpd]# cat error_log
[Mon Aug 07 15:43:51.288907 2023] [core:notice] [pid 100046:tid 140394952571200] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Aug 07 15:43:51.293902 2023] [suexec:notice] [pid 100046:tid 140394952571200] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Aug 07 15:43:51.322493 2023] [lbmethod_heartbeat:notice] [pid 100046:tid 140394952571200] AH02282: No slotmem from mod_heartmonitor
[Mon Aug 07 15:43:51.325853 2023] [mpm_event:notice] [pid 100046:tid 140394952571200] AH00489: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 Python/3.6 configured -- resuming normal operations
[Mon Aug 07 15:43:51.325878 2023] [core:notice] [pid 100046:tid 140394952571200] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Aug 07 16:32:05.700545 2023] [mpm_event:notice] [pid 100046:tid 140394952571200] AH00492: caught SIGWINCH, shutting down gracefully
[Mon Aug 07 16:32:17.143595 2023] [core:notice] [pid 104504:tid 140533560953152] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Aug 07 16:32:17.145376 2023] [suexec:notice] [pid 104504:tid 140533560953152] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Aug 07 16:32:17.172514 2023] [ssl:warn] [pid 104504:tid 140533560953152] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Aug 07 16:32:17.173274 2023] [lbmethod_heartbeat:notice] [pid 104504:tid 140533560953152] AH02282: No slotmem from mod_heartmonitor
[Mon Aug 07 16:32:17.181347 2023] [mpm_event:notice] [pid 104504:tid 140533560953152] AH00489: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 Python/3.6 configured -- resuming normal operations
[Mon Aug 07 16:32:17.181375 2023] [core:notice] [pid 104504:tid 140533560953152] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

I think this issue is close to being resolved and it would be a shame to abort the installation now.

Do you, therefore, have any idea as to why I am getting the module not found error?:

 ModuleNotFoundError: No module named 'privacyidea'

The contents of the file named in the error message ‘File “/etc/privacyidea/privacyideaapp.wsgi”, line 3, in ’ is as follows:

[root@otp-i0a01e224db6a2f3d4 conf.d]# cat /etc/privacyidea/privacyideaapp.wsgi
import sys
sys.stdout = sys.stderr
from privacyidea.app import create_app
# Now we can select the config file:
application = create_app(config_name="production", config_file="/etc/privacyidea/pi.cfg")
[root@otp-i0a01e224db6a2f3d4 conf.d]#

I believe that I am very close just need a little of your genius to get me oer the line… :slight_smile: :grimacing: :grimacing:

Hi Cossy,

you can use the search in our community forum.

Br

Julio

Hi Cossy,

Looks like using the “python 3.6”

[Mon Aug 07 15:43:51.325853 2023] [mpm_event:notice] [pid 100046:tid 140394952571200] AH00489: Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k mod_wsgi/4.6.4 Python/3.6 configured -- resuming normal operations

Python 3.6 is no longer supported by the Python core team.

br

Julio

Thanks.

Still invetsigating and checking.

Hi Julio,

I have spent a considerable amount of time investigating the issues that I am facing with no success. :frowning:

The errors that I am facing all appear to relate to compatibility issues with the packages that were installed within the virtual environment using the requirements.txt. The requirements.txt file that I am using, relates to a CentOS 7 installation and I suspect that this might be the source of the problem as I am using Red Hat 8.4.

I would like to create a new ticket in the forum, if that’s okay(?), asking if anyone has successfully installed the privacyidea application on a Red Hat 8 platform and if so could they answer the following questions:

  • Which particular version/release of Red Hat 8 did they use?
  • Which particular version of Apache?
  • Which particular version of Python?
  • Which version of the pip application did they install?
  • Which ‘requirements.txt’ file did they install within the virtual environment?

There may be a forum member who has managed to overcome these issues and they would greatly assist me.

Regards,
Cossy

Hi Cossy,

Maybe you have the wrong mod_wsgi package installed.

Can you give us the output of:

yum list installed | grep python3

the actual requirements of prvacyIDEA 3.8.1 you can get here:

Br

Julio

As requested…

[root@otp-i0a01e224db6a2f3d4 ~]# yum list installed | grep python3
python3-asn1crypto.noarch                      0.24.0-3.el8                                @anaconda
python3-audit.x86_64                           3.0.7-2.el8.2                               @rhel-8-baseos-rhui-rpms
python3-babel.noarch                           2.5.1-7.el8                                 @rhel-8-appstream-rhui-rpms
python3-bind.noarch                            32:9.11.36-3.el8_6.1                        @rhel-8-appstream-rhui-rpms
python3-cffi.x86_64                            1.11.5-5.el8                                @anaconda
python3-chardet.noarch                         3.0.4-7.el8                                 @anaconda
python3-cloud-what.x86_64                      1.28.29-3.el8                               @rhel-8-baseos-rhui-rpms
python3-configobj.noarch                       5.0.6-11.el8                                @anaconda
python3-cryptography.x86_64                    3.2.1-5.el8                                 @rhel-8-baseos-rhui-rpms
python3-dateutil.noarch                        1:2.6.1-6.el8                               @anaconda
python3-dbus.x86_64                            1.2.4-15.el8                                @anaconda
python3-decorator.noarch                       4.2.1-2.el8                                 @anaconda
python3-dmidecode.x86_64                       3.12.2-15.el8                               @anaconda
python3-dnf.noarch                             4.7.0-8.el8                                 @rhel-8-baseos-rhui-rpms
python3-dnf-plugins-core.noarch                4.0.21-11.el8                               @rhel-8-baseos-rhui-rpms
python3-dns.noarch                             1.15.0-10.el8                               @rhel-8-baseos-rhui-rpms
python3-ethtool.x86_64                         0.14-5.el8                                  @rhel-8-baseos-rhui-rpms
python3-gobject-base.x86_64                    3.28.3-2.el8                                @anaconda
python3-gpg.x86_64                             1.13.1-11.el8                               @rhel-8-baseos-rhui-rpms
python3-hawkey.x86_64                          0.63.0-8.2.el8_6                            @rhel-8-baseos-rhui-rpms
python3-idna.noarch                            2.5-5.el8                                   @anaconda
python3-iniparse.noarch                        0.4-31.el8                                  @anaconda
python3-inotify.noarch                         0.9.6-13.el8                                @anaconda
python3-jinja2.noarch                          2.10.1-3.el8                                @rhel-8-appstream-rhui-rpms
python3-jsonpatch.noarch                       1.21-2.el8                                  @koji-override-1
python3-jsonpointer.noarch                     1.10-11.el8                                 @koji-override-1
python3-jsonschema.noarch                      2.6.0-4.el8                                 @koji-override-1
python3-jwt.noarch                             1.6.1-2.el8                                 @anaconda
python3-ldb.x86_64                             2.4.1-1.el8                                 @rhel-8-baseos-rhui-rpms
python3-libcomps.x86_64                        0.1.18-1.el8                                @rhel-8-baseos-rhui-rpms
python3-libdnf.x86_64                          0.63.0-8.2.el8_6                            @rhel-8-baseos-rhui-rpms
python3-librepo.x86_64                         1.14.2-1.el8                                @rhel-8-baseos-rhui-rpms
python3-libs.x86_64                            3.6.8-47.el8_6                              @rhel-8-baseos-rhui-rpms
python3-libselinux.x86_64                      2.9-5.el8                                   @rhel-8-baseos-rhui-rpms
python3-libsemanage.x86_64                     2.9-8.el8                                   @rhel-8-baseos-rhui-rpms
python3-libxml2.x86_64                         2.9.7-13.el8_6.1                            @rhel-8-baseos-rhui-rpms
python3-linux-procfs.noarch                    0.7.0-1.el8                                 @rhel-8-baseos-rhui-rpms
python3-magic.noarch                           5.33-20.el8                                 @rhel-8-baseos-rhui-rpms
python3-markupsafe.x86_64                      0.23-19.el8                                 @koji-override-1
python3-mod_wsgi.x86_64                        4.6.4-3.el8                                 @rhel-8-appstream-rhui-rpms
python3-netifaces.x86_64                       0.10.6-4.el8                                @rhel-8-appstream-rhui-rpms
python3-oauthlib.noarch                        2.1.0-1.el8                                 @anaconda
python3-perf.x86_64                            4.18.0-372.26.1.el8_6                       @rhel-8-baseos-rhui-rpms
python3-pip.noarch                             9.0.3-22.el8                                @rhel-8-appstream-rhui-rpms
python3-pip-wheel.noarch                       9.0.3-22.el8                                @rhel-8-baseos-rhui-rpms
python3-ply.noarch                             3.9-9.el8                                   @rhel-8-baseos-rhui-rpms
python3-policycoreutils.noarch                 2.9-19.el8                                  @rhel-8-baseos-rhui-rpms
python3-prettytable.noarch                     0.7.2-14.el8                                @koji-override-1
python3-pycparser.noarch                       2.14-14.el8                                 @anaconda
python3-pyserial.noarch                        3.1.1-8.el8                                 @koji-override-1
python3-pysocks.noarch                         1.6.8-3.el8                                 @anaconda
python3-pytz.noarch                            2017.2-9.el8                                @koji-override-1
python3-pyudev.noarch                          0.21.0-7.el8                                @anaconda
python3-pyyaml.x86_64                          3.12-12.el8                                 @anaconda
python3-requests.noarch                        2.20.0-2.1.el8_1                            @anaconda
python3-rpm.x86_64                             4.14.3-23.el8                               @rhel-8-baseos-rhui-rpms
python3-rpm-generators.noarch                  5-7.el8                                     @rhel-8-appstream-rhui-rpms
python3-rpm-macros.noarch                      3-41.el8                                    @rhel-8-appstream-rhui-rpms
python3-samba.x86_64                           4.15.5-8.el8_6                              @rhel-8-baseos-rhui-rpms
python3-schedutils.x86_64                      0.6-6.el8                                   @anaconda
python3-setools.x86_64                         4.3.0-3.el8                                 @rhel-8-baseos-rhui-rpms
python3-setuptools.noarch                      39.2.0-6.el8                                @rhel-8-baseos-rhui-rpms
python3-setuptools-wheel.noarch                39.2.0-6.el8                                @anaconda
python3-six.noarch                             1.11.0-8.el8                                @anaconda
python3-sssdconfig.noarch                      2.6.2-4.el8_6.1                             @rhel-8-baseos-rhui-rpms
python3-subscription-manager-rhsm.x86_64       1.28.29-3.el8                               @rhel-8-baseos-rhui-rpms
python3-syspurpose.x86_64                      1.28.29-3.el8                               @rhel-8-baseos-rhui-rpms
python3-talloc.x86_64                          2.3.3-1.el8                                 @rhel-8-baseos-rhui-rpms
python3-tdb.x86_64                             1.4.4-1.el8                                 @rhel-8-baseos-rhui-rpms
python3-tevent.x86_64                          0.11.0-0.el8                                @rhel-8-baseos-rhui-rpms
python3-unbound.x86_64                         1.7.3-17.el8                                @rhel-8-appstream-rhui-rpms
python3-urllib3.noarch                         1.24.2-5.el8                                @rhel-8-baseos-rhui-rpms
python3-virtualenv.noarch                      15.1.0-21.module+el8.5.0+12207+5c5719bc     @rhel-8-appstream-rhui-rpms
python3-wheel-wheel.noarch                     1:0.31.1-3.module+el8.5.0+12207+5c5719bc    @rhel-8-appstream-rhui-rpms
python36.x86_64                                3.6.8-38.module+el8.5.0+12207+5c5719bc      @rhel-8-appstream-rhui-rpms
python36-devel.x86_64                          3.6.8-38.module+el8.5.0+12207+5c5719bc      @rhel-8-appstream-rhui-rpms
python38.x86_64                                3.8.12-1.module+el8.6.0+12642+c3710b74      @rhel-8-appstream-rhui-rpms
python38-devel.x86_64                          3.8.12-1.module+el8.6.0+12642+c3710b74      @rhel-8-appstream-rhui-rpms
python38-libs.x86_64                           3.8.12-1.module+el8.6.0+12642+c3710b74      @rhel-8-appstream-rhui-rpms
python38-pip.noarch                            19.3.1-5.module+el8.6.0+13002+70cfc74a      @rhel-8-appstream-rhui-rpms
python38-pip-wheel.noarch                      19.3.1-5.module+el8.6.0+13002+70cfc74a      @rhel-8-appstream-rhui-rpms
python38-setuptools.noarch                     41.6.0-5.module+el8.5.0+12205+a865257a      @rhel-8-appstream-rhui-rpms
python38-setuptools-wheel.noarch               41.6.0-5.module+el8.5.0+12205+a865257a      @rhel-8-appstream-rhui-rpms
python38-wheel-wheel.noarch                    0.33.6-6.module+el8.5.0+12205+a865257a      @rhel-8-appstream-rhui-rpms
[root@otp-i0a01e224db6a2f3d4 ~]#

You previously advised me to replace python3-mod_wsgi with python38-mod_wsgi an I will do that now.

It reverted as this is a new server…

Installed and will retest now…

[root@otp-i0a01e224db6a2f3d4 ~]# yum list installed | grep -i wsgi
python38-mod_wsgi.x86_64                       4.6.8-3.module+el8.4.0+8888+89bc7e79        @rhel-8-appstream-rhui-rpms

This looks more promising…access issue?

[root@otp-i0a01e224db6a2f3d4 httpd]# cat ssl_error_log
[Wed Aug 09 11:43:30.853523 2023] [ssl:warn] [pid 153759:tid 140611197184320] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Wed Aug 09 11:43:30.881019 2023] [ssl:warn] [pid 153759:tid 140611197184320] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Wed Aug 09 11:43:45.316140 2023] [wsgi:error] [pid 153761:tid 140610747340544] The configuration name is: production
[Wed Aug 09 11:43:45.316211 2023] [wsgi:error] [pid 153761:tid 140610747340544] Additional configuration will be read from the file /etc/privacyidea/pi.cfg
[Wed Aug 09 11:43:45.318504 2023] [wsgi:error] [pid 153761:tid 140610747340544] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[Wed Aug 09 11:43:45.318530 2023] [wsgi:error] [pid 153761:tid 140610747340544]   WARNING: privacyidea create_app has no access
[Wed Aug 09 11:43:45.318543 2023] [wsgi:error] [pid 153761:tid 140610747340544]   to /etc/privacyidea/pi.cfg!
[Wed Aug 09 11:43:45.318553 2023] [wsgi:error] [pid 153761:tid 140610747340544] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[Wed Aug 09 11:43:45.433974 2023] [wsgi:error] [pid 153761:tid 140610747340544] Using PI_LOGLEVEL and PI_LOGFILE.
[Wed Aug 09 11:43:45.434048 2023] [wsgi:error] [pid 153761:tid 140610747340544] Using PI_LOGLEVEL 20.
[Wed Aug 09 11:43:45.434069 2023] [wsgi:error] [pid 153761:tid 140610747340544] Using PI_LOGFILE privacyidea.log.
[Wed Aug 09 11:43:45.507601 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961] mod_wsgi (pid=153761): Exception occurred processing WSGI script '/etc/privacyidea/privacyideaapp.wsgi'.
[Wed Aug 09 11:43:45.508082 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961] Traceback (most recent call last):
[Wed Aug 09 11:43:45.508124 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
[Wed Aug 09 11:43:45.508133 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     self.dialect.do_execute(
[Wed Aug 09 11:43:45.508145 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
[Wed Aug 09 11:43:45.508152 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     cursor.execute(statement, parameters)
[Wed Aug 09 11:43:45.508170 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961] sqlite3.OperationalError: no such table: config
[Wed Aug 09 11:43:45.508184 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]
[Wed Aug 09 11:43:45.508191 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961] The above exception was the direct cause of the following exception:
[Wed Aug 09 11:43:45.508196 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]
[Wed Aug 09 11:43:45.508207 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961] Traceback (most recent call last):
[Wed Aug 09 11:43:45.508273 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
[Wed Aug 09 11:43:45.508281 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     response = self.full_dispatch_request()
[Wed Aug 09 11:43:45.508292 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
[Wed Aug 09 11:43:45.508299 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     rv = self.handle_user_exception(e)
[Wed Aug 09 11:43:45.508309 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
[Wed Aug 09 11:43:45.508321 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     reraise(exc_type, exc_value, tb)
[Wed Aug 09 11:43:45.508333 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/flask/_compat.py", line 39, in reraise
[Wed Aug 09 11:43:45.508340 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     raise value
[Wed Aug 09 11:43:45.508350 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/flask/app.py", line 1948, in full_dispatch_request
[Wed Aug 09 11:43:45.508356 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     rv = self.preprocess_request()
[Wed Aug 09 11:43:45.508366 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/flask/app.py", line 2242, in preprocess_request
[Wed Aug 09 11:43:45.508372 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     rv = func()
[Wed Aug 09 11:43:45.508382 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/privacyidea/webui/login.py", line 71, in before_request
[Wed Aug 09 11:43:45.508389 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     g.client_ip = get_client_ip(request, get_from_config(SYSCONF.OVERRIDECLIENT))
[Wed Aug 09 11:43:45.508399 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/privacyidea/lib/log.py", line 151, in log_wrapper
[Wed Aug 09 11:43:45.508405 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     return func(*args, **kwds)
[Wed Aug 09 11:43:45.508415 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/privacyidea/lib/config.py", line 369, in get_from_config
[Wed Aug 09 11:43:45.508421 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     config_object = get_config_object()
[Wed Aug 09 11:43:45.508431 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/privacyidea/lib/config.py", line 349, in get_config_object
[Wed Aug 09 11:43:45.508438 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     store['config_object'] = shared_config.reload_and_clone()
[Wed Aug 09 11:43:45.508448 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/privacyidea/lib/config.py", line 203, in reload_and_clone
[Wed Aug 09 11:43:45.508454 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     self._reload_from_db()
[Wed Aug 09 11:43:45.508464 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/privacyidea/lib/config.py", line 106, in _reload_from_db
[Wed Aug 09 11:43:45.508470 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     db_ts = Config.query.filter_by(Key=PRIVACYIDEA_TIMESTAMP).first()
[Wed Aug 09 11:43:45.508480 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/sqlalchemy/orm/query.py", line 3429, in first
[Wed Aug 09 11:43:45.508487 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     ret = list(self[0:1])
[Wed Aug 09 11:43:45.508497 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/sqlalchemy/orm/query.py", line 3203, in __getitem__
[Wed Aug 09 11:43:45.508503 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     return list(res)
[Wed Aug 09 11:43:45.508517 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
[Wed Aug 09 11:43:45.508523 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     return self._execute_and_instances(context)
[Wed Aug 09 11:43:45.508534 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
[Wed Aug 09 11:43:45.508540 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     result = conn.execute(querycontext.statement, self._params)
[Wed Aug 09 11:43:45.508550 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
[Wed Aug 09 11:43:45.508556 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     return meth(self, multiparams, params)
[Wed Aug 09 11:43:45.508566 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
[Wed Aug 09 11:43:45.508572 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     return connection._execute_clauseelement(self, multiparams, params)
[Wed Aug 09 11:43:45.508583 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
[Wed Aug 09 11:43:45.508589 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     ret = self._execute_context(
[Wed Aug 09 11:43:45.508599 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
[Wed Aug 09 11:43:45.508605 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     self._handle_dbapi_exception(
[Wed Aug 09 11:43:45.508615 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
[Wed Aug 09 11:43:45.508621 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     util.raise_(
[Wed Aug 09 11:43:45.508631 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
[Wed Aug 09 11:43:45.508637 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     raise exception
[Wed Aug 09 11:43:45.508647 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
[Wed Aug 09 11:43:45.508653 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     self.dialect.do_execute(
[Wed Aug 09 11:43:45.508663 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
[Wed Aug 09 11:43:45.508670 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     cursor.execute(statement, parameters)
[Wed Aug 09 11:43:45.508687 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961] sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: config
[Wed Aug 09 11:43:45.508695 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961] [SQL: SELECT config."Key" AS "config_Key", config."Value" AS "config_Value", config."Type" AS "config_Type", config."Description" AS "config_Description"
[Wed Aug 09 11:43:45.508704 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961] FROM config
[Wed Aug 09 11:43:45.508709 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961] WHERE config."Key" = ?
[Wed Aug 09 11:43:45.508713 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]  LIMIT ? OFFSET ?]
[Wed Aug 09 11:43:45.508718 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961] [parameters: ('__timestamp__', 1, 0)]
[Wed Aug 09 11:43:45.508723 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961] (Background on this error at: http://sqlalche.me/e/13/e3q8)
[Wed Aug 09 11:43:45.508736 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]
[Wed Aug 09 11:43:45.508742 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961] During handling of the above exception, another exception occurred:
[Wed Aug 09 11:43:45.508747 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]
[Wed Aug 09 11:43:45.508758 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961] Traceback (most recent call last):
[Wed Aug 09 11:43:45.508780 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/flask/app.py", line 2464, in __call__
[Wed Aug 09 11:43:45.508787 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     return self.wsgi_app(environ, start_response)
[Wed Aug 09 11:43:45.508797 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app
[Wed Aug 09 11:43:45.508803 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     response = self.handle_exception(e)
[Wed Aug 09 11:43:45.508813 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/flask/app.py", line 1879, in handle_exception
[Wed Aug 09 11:43:45.508820 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     server_error = handler(server_error)
[Wed Aug 09 11:43:45.508830 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]   File "/opt/privacyidea/lib64/python3.8/site-packages/privacyidea/api/before_after.py", line 411, in internal_error
[Wed Aug 09 11:43:45.508836 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961]     g.audit_object.log({"info": six.text_type(error)})
[Wed Aug 09 11:43:45.508850 2023] [wsgi:error] [pid 153761:tid 140610747340544] [remote 172.30.0.158:53961] AttributeError: 'NoneType' object has no attribute 'log'
[root@otp-i0a01e224db6a2f3d4 httpd]#