Table 'pi.config' doesn't exist"

Hello,

I am using debian 10, and i get that error when i am accessing the webpage :

[Mon Apr 26 10:04:59.698255 2021] [mpm_event:notice] [pid 15333:tid 139806326588544] AH00489: Apache/2.4.38 (Debian) OpenSSL/1.1.1d mod_wsgi/4.6.5 Python/3.7 configured – resuming normal operations
[Mon Apr 26 10:04:59.698271 2021] [core:notice] [pid 15333:tid 139806326588544] AH00094: Command line: ‘/usr/sbin/apache2’
[Mon Apr 26 10:05:03.298095 2021] [wsgi:error] [pid 15334:tid 139806291396352] The configuration name is: production
[Mon Apr 26 10:05:03.298137 2021] [wsgi:error] [pid 15334:tid 139806291396352] Additional configuration will be read from the file /opt/privacyidea/pi.cfg
[Mon Apr 26 10:05:03.363226 2021] [wsgi:error] [pid 15334:tid 139806291396352] Using PI_LOGLEVEL and PI_LOGFILE.
[Mon Apr 26 10:05:03.363245 2021] [wsgi:error] [pid 15334:tid 139806291396352] Using PI_LOGLEVEL 20.
[Mon Apr 26 10:05:03.363249 2021] [wsgi:error] [pid 15334:tid 139806291396352] Using PI_LOGFILE privacyidea.log.
[Mon Apr 26 10:05:03.419020 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] mod_wsgi (pid=15334): Exception occurred processing WSGI script ‘/opt/privacyidea/etc/privacyidea/privacyideaapp.wsgi’.
[Mon Apr 26 10:05:03.419597 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] Traceback (most recent call last):
[Mon Apr 26 10:05:03.419631 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1246, in _execute_context
[Mon Apr 26 10:05:03.419635 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] cursor, statement, parameters, context
[Mon Apr 26 10:05:03.419639 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 581, in do_execute
[Mon Apr 26 10:05:03.419641 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] cursor.execute(statement, parameters)
[Mon Apr 26 10:05:03.419644 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/usr/lib/python3/dist-packages/MySQLdb/cursors.py”, line 250, in execute
[Mon Apr 26 10:05:03.419646 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] self.errorhandler(self, exc, value)
[Mon Apr 26 10:05:03.419650 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/usr/lib/python3/dist-packages/MySQLdb/connections.py”, line 50, in defaulterrorhandler
[Mon Apr 26 10:05:03.419652 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] raise errorvalue
[Mon Apr 26 10:05:03.419655 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/usr/lib/python3/dist-packages/MySQLdb/cursors.py”, line 247, in execute
[Mon Apr 26 10:05:03.419657 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] res = self._query(query)
[Mon Apr 26 10:05:03.419660 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/usr/lib/python3/dist-packages/MySQLdb/cursors.py”, line 411, in _query
[Mon Apr 26 10:05:03.419662 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] rowcount = self._do_query(q)
[Mon Apr 26 10:05:03.419665 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/usr/lib/python3/dist-packages/MySQLdb/cursors.py”, line 374, in _do_query
[Mon Apr 26 10:05:03.419673 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] db.query(q)
[Mon Apr 26 10:05:03.419676 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/usr/lib/python3/dist-packages/MySQLdb/connections.py”, line 292, in query
[Mon Apr 26 10:05:03.419678 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] _mysql.connection.query(self, query)
[Mon Apr 26 10:05:03.419687 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] _mysql_exceptions.ProgrammingError: (1146, “Table ‘pi.config’ doesn’t exist”)
[Mon Apr 26 10:05:03.419691 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201]
[Mon Apr 26 10:05:03.419693 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] The above exception was the direct cause of the following exception:
[Mon Apr 26 10:05:03.419695 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201]
[Mon Apr 26 10:05:03.419698 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] Traceback (most recent call last):
[Mon Apr 26 10:05:03.419755 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/flask/app.py”, line 2446, in wsgi_app
[Mon Apr 26 10:05:03.419758 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] response = self.full_dispatch_request()
[Mon Apr 26 10:05:03.419761 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/flask/app.py”, line 1951, in full_dispatch_request
[Mon Apr 26 10:05:03.419763 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] rv = self.handle_user_exception(e)
[Mon Apr 26 10:05:03.419766 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/flask/app.py”, line 1820, in handle_user_exception
[Mon Apr 26 10:05:03.419768 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] reraise(exc_type, exc_value, tb)
[Mon Apr 26 10:05:03.419771 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/flask/_compat.py”, line 39, in reraise
[Mon Apr 26 10:05:03.419773 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] raise value
[Mon Apr 26 10:05:03.419776 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/flask/app.py”, line 1947, in full_dispatch_request
[Mon Apr 26 10:05:03.419779 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] rv = self.preprocess_request()
[Mon Apr 26 10:05:03.419782 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/flask/app.py”, line 2241, in preprocess_request
[Mon Apr 26 10:05:03.419784 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] rv = func()
[Mon Apr 26 10:05:03.419786 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/privacyidea/webui/login.py”, line 59, in before_request
[Mon Apr 26 10:05:03.419789 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] g.client_ip = get_client_ip(request, get_from_config(SYSCONF.OVERRIDECLIENT))
[Mon Apr 26 10:05:03.419792 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/privacyidea/lib/log.py”, line 155, in log_wrapper
[Mon Apr 26 10:05:03.419794 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] return func(*args, **kwds)
[Mon Apr 26 10:05:03.419800 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/privacyidea/lib/config.py”, line 345, in get_from_config
[Mon Apr 26 10:05:03.419802 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] config_object = get_config_object()
[Mon Apr 26 10:05:03.419805 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/privacyidea/lib/config.py”, line 325, in get_config_object
[Mon Apr 26 10:05:03.419807 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] store[‘config_object’] = shared_config.reload_and_clone()
[Mon Apr 26 10:05:03.419810 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/privacyidea/lib/config.py”, line 180, in reload_and_clone
[Mon Apr 26 10:05:03.419813 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] self._reload_from_db()
[Mon Apr 26 10:05:03.419816 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/privacyidea/lib/config.py”, line 100, in _reload_from_db
[Mon Apr 26 10:05:03.419818 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] db_ts = Config.query.filter_by(Key=PRIVACYIDEA_TIMESTAMP).first()
[Mon Apr 26 10:05:03.419821 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/orm/query.py”, line 3265, in first
[Mon Apr 26 10:05:03.419823 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] ret = list(self[0:1])
[Mon Apr 26 10:05:03.419826 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/orm/query.py”, line 3043, in getitem
[Mon Apr 26 10:05:03.419828 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] return list(res)
[Mon Apr 26 10:05:03.419831 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/orm/query.py”, line 3367, in iter
[Mon Apr 26 10:05:03.419833 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] return self._execute_and_instances(context)
[Mon Apr 26 10:05:03.419836 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/orm/query.py”, line 3392, in _execute_and_instances
[Mon Apr 26 10:05:03.419838 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] result = conn.execute(querycontext.statement, self._params)
[Mon Apr 26 10:05:03.419841 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 982, in execute
[Mon Apr 26 10:05:03.419843 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] return meth(self, multiparams, params)
[Mon Apr 26 10:05:03.419847 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/sql/elements.py”, line 287, in _execute_on_connection
[Mon Apr 26 10:05:03.419849 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] return connection._execute_clauseelement(self, multiparams, params)
[Mon Apr 26 10:05:03.419852 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1101, in _execute_clauseelement
[Mon Apr 26 10:05:03.419854 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] distilled_params,
[Mon Apr 26 10:05:03.419864 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1250, in _execute_context
[Mon Apr 26 10:05:03.419866 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] e, statement, parameters, cursor, context
[Mon Apr 26 10:05:03.419869 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1476, in _handle_dbapi_exception
[Mon Apr 26 10:05:03.419871 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] util.raise_from_cause(sqlalchemy_exception, exc_info)
[Mon Apr 26 10:05:03.419874 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 398, in raise_from_cause
[Mon Apr 26 10:05:03.419876 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] reraise(type(exception), exception, tb=exc_tb, cause=cause)
[Mon Apr 26 10:05:03.419879 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 152, in reraise
[Mon Apr 26 10:05:03.419881 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] raise value.with_traceback(tb)
[Mon Apr 26 10:05:03.419884 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1246, in _execute_context
[Mon Apr 26 10:05:03.419886 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] cursor, statement, parameters, context
[Mon Apr 26 10:05:03.419889 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 581, in do_execute
[Mon Apr 26 10:05:03.419892 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] cursor.execute(statement, parameters)
[Mon Apr 26 10:05:03.419895 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/usr/lib/python3/dist-packages/MySQLdb/cursors.py”, line 250, in execute
[Mon Apr 26 10:05:03.419897 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] self.errorhandler(self, exc, value)
[Mon Apr 26 10:05:03.419900 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/usr/lib/python3/dist-packages/MySQLdb/connections.py”, line 50, in defaulterrorhandler
[Mon Apr 26 10:05:03.419902 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] raise errorvalue
[Mon Apr 26 10:05:03.419905 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/usr/lib/python3/dist-packages/MySQLdb/cursors.py”, line 247, in execute
[Mon Apr 26 10:05:03.419907 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] res = self._query(query)
[Mon Apr 26 10:05:03.419910 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/usr/lib/python3/dist-packages/MySQLdb/cursors.py”, line 411, in _query
[Mon Apr 26 10:05:03.419912 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] rowcount = self._do_query(q)
[Mon Apr 26 10:05:03.419915 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/usr/lib/python3/dist-packages/MySQLdb/cursors.py”, line 374, in _do_query
[Mon Apr 26 10:05:03.419917 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] db.query(q)
[Mon Apr 26 10:05:03.419920 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/usr/lib/python3/dist-packages/MySQLdb/connections.py”, line 292, in query
[Mon Apr 26 10:05:03.419925 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] _mysql.connection.query(self, query)
[Mon Apr 26 10:05:03.419932 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] sqlalchemy.exc.ProgrammingError: (_mysql_exceptions.ProgrammingError) (1146, “Table ‘pi.config’ doesn’t exist”)
[Mon Apr 26 10:05:03.419935 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] [SQL: SELECT config.Key AS config_Key, config.Value AS config_Value, config.Type AS config_Type, config.Description AS config_Description
[Mon Apr 26 10:05:03.419938 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] FROM config
[Mon Apr 26 10:05:03.419939 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] WHERE config.Key = %s
[Mon Apr 26 10:05:03.419941 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] LIMIT %s]
[Mon Apr 26 10:05:03.419943 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] [parameters: (‘timestamp’, 1)]
[Mon Apr 26 10:05:03.419944 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] (Background on this error at: http://sqlalche.me/e/f405)
[Mon Apr 26 10:05:03.419948 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201]
[Mon Apr 26 10:05:03.419950 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] During handling of the above exception, another exception occurred:
[Mon Apr 26 10:05:03.419952 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201]
[Mon Apr 26 10:05:03.419955 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] Traceback (most recent call last):
[Mon Apr 26 10:05:03.419967 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/flask/app.py”, line 2463, in call
[Mon Apr 26 10:05:03.419970 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] return self.wsgi_app(environ, start_response)
[Mon Apr 26 10:05:03.419973 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/flask/app.py”, line 2449, in wsgi_app
[Mon Apr 26 10:05:03.419975 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] response = self.handle_exception(e)
[Mon Apr 26 10:05:03.419978 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/flask/app.py”, line 1878, in handle_exception
[Mon Apr 26 10:05:03.419980 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] server_error = handler(server_error)
[Mon Apr 26 10:05:03.419983 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/privacyidea/api/lib/postpolicy.py”, line 130, in policy_wrapper
[Mon Apr 26 10:05:03.419985 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] response = wrapped_function(*args, **kwds)
[Mon Apr 26 10:05:03.419988 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] File “/opt/privacyidea/lib/python3.7/site-packages/privacyidea/api/before_after.py”, line 380, in internal_error
[Mon Apr 26 10:05:03.419990 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] g.audit_object.log({“info”: six.text_type(error)})
[Mon Apr 26 10:05:03.419996 2021] [wsgi:error] [pid 15334:tid 139806291396352] [remote 192.168.1.10:22201] AttributeError: ‘NoneType’ object has no attribute ‘log’

Here is my apache site :

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 /      /opt/privacyidea/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
    #WSGIPythonHome /opt/privacyidea/bin/python3.7
    WSGIDaemonProcess privacyidea processes=1 threads=15 display-name=%{GROUP} user=privacyidea python-path=/opt/privacyidea/bin/python3.7:/opt/privacyidea/lib/python3.7/site-packages
    WSGIProcessGroup privacyidea
    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
    SSLHonorCipherOrder On 
    SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS


    #   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

The test server seems to be ok :

(privacyidea) root@freeradius01:/opt/privacyidea# pi-manage runserver

         _                    _______  _______

___ () _____ _______ __/ / _ / __/ _ |
/ _ / __/ / |/ / _ `/ / // // // // / _// __ |
/ .
/
/ /
/|
/_,/_/_, ///// ||
/
/ /___/

  • Serving Flask app “privacyidea.app” (lazy loading)
  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  • Debug mode: off
  • Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

Regards

Hi and welcome to privacyIDEA,

Probably you have not following the install instructions.

Please read this: Is privacyIDEA an open source or a commercial solution

Hello,

I used : 2.1. Python Package Index

I struggled with the Apache2 + WSGI + Python3

Do i miss a point ?

Regards

You probably did not create and set up your database correctly.
But this is just me guessing.

The Mysql database creation is ok :

CREATE DATABASE pi;
CREATE USER “pi”@“localhost” IDENTIFIED BY “s…5”;
GRANT ALL PRIVILEGES ON pi.* TO “pi”@“localhost”;

MariaDB [(none)]> connect pi;
Connection id: 58
Current database: pi

MariaDB [pi]> show tables;
Empty set (0.000 sec)

there is no tables inside.

my pi.cfg has :

SQLALCHEMY_DATABASE_URI = ‘mysql://pi:s…5@localhost/pi’

Does it suppose to populate the database with : " pi-manage createdb " ?

(privacyidea) root@freeradius01:/opt/privacyidea# pi-manage createdb

Regards

Please use mysql+pymysql://pi:...

Correct.

vi /opt/privacyidea/pi.cfg

SQLALCHEMY_DATABASE_URI = ‘mysql+pymysql://pi:s…5@localhost/pi’

then :

pi-manage createdb

the database has still no tables.

When i am running apache i know for sure that " /opt/privacyidea/pi.cfg " is read because when i tune parameters like PI_LOGFILE i can see the effect, but i am not sure about the “pi-manage” maybe it does not take my pi.cfg into account.

Regards

(privacyidea) root@freeradius01:/opt/privacyidea# PRIVACYIDEA_CONFIGFILE=/opt/privacyidea/pi.cfg pi-manage createdb

<SQLAlchemy engine=mysql+pymysql://pi:***@localhost/pi?charset=utf8>
(privacyidea) root@freeradius01:/opt/privacyidea# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 65
Server version: 10.3.27-MariaDB-0+deb10u1 Debian 10

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> connect pi;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Connection id: 66
Current database: pi

MariaDB [pi]> show tables;
±----------------------+
| Tables_in_pi |
±----------------------+
| admin |
| authcache |
| caconnector |
| caconnectorconfig |
| challenge |
| clientapplication |
| config |
| eventcounter |
| eventhandler |
| eventhandlercondition |
| eventhandleroption |
| machineresolver |
| machineresolverconfig |
| machinetoken |
| machinetokenoptions |
| monitoringstats |
| passwordreset |
| periodictask |
| periodictasklastrun |
| periodictaskoption |
| pidea_audit |
| policy |
| policycondition |
| privacyideaserver |
| radiusserver |
| realm |
| resolver |
| resolverconfig |
| resolverrealm |
| smsgateway |
| smsgatewayoption |
| smtpserver |
| subscription |
| token |
| tokeninfo |
| tokenowner |
| tokenrealm |
| usercache |
±----------------------+
38 rows in set (0.001 sec)

Yes !

Note: the default location of pi.cfg is /etc/privacyidea/pi.cfg. Otherwise you will always have to use the environment variable as you stated above.