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

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]#

Hi,

the ownership should look like this:

-rw-r–r–. 1 privacyidea root 4109 Feb 7 2023 dictionary
-rw-------. 1 privacyidea root 96 Aug 9 11:33 enckey
drwxr-xr-x. 4 privacyidea root 4096 Aug 9 11:33 gpg
-rw-r–r–. 1 privacyidea root 451 Feb 7 2023 NetKnights.pem
-rw-r-----. 1 privacyidea root 1041 Aug 9 11:33 pi.cfg
-rw-r–r–. 1 privacyidea root 201 Feb 7 2023 privacyideaapp.wsgi
-rw-------. 1 privacyidea root 1679 Aug 9 11:33 private.pem
-rw-r–r–. 1 privacyidea root 451 Aug 9 11:33 public.pem

Please use our documentation!!

Add a dedicated user for the privacyIDEA server and change some ownerships:

$ chown privacyidea:privacyidea /opt/privacyidea /etc/privacyidea /var/log/privacyidea

br

Julio

1 Like

I actually have a signon screen …

Feeling quite emotional… :rofl: :joy:

I tried to authenticate but received the following error:

Authentication failed. 500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

I will investigate further but thanks for your assistance.

Congratulations,

from this point, you can continue in the documentation:
https://privacyidea.readthedocs.io/en/latest/firststeps/add_admin.html

On youtube you can also find some videos.

br

Julio

1 Like

I had previously executed all of the pi-manage command line commands. They worked out of the box…

I just need to workout why the initial http authentication is failing.

Also, we already use privacyidea on Red Hat 7, so configuring the LDAP connection and generating the tokens etc should be fairly straightforward once I have logged in.

:crossed_fingers:

Hi Julio,

The application is up and running and configured with connectivity to our Active Directory server.

I have also generated a QR token for my user account but havent yet tested it.

Its been an emotional rollercoaster of a journey but its done now and I am delighted. :grin: :grin:

Thanks again for all your help.

Regards,
Cossy

1 Like