…and error handling
2024-11-13 23:29:37,091 DEBUG [ckanext.schemingdcat.statistics.model] SchemingDCAT statistics table dropped from DB
2024-11-13 23:29:37,108 DEBUG [ckanext.schemingdcat.statistics.model] SchemingDCAT statistics table defined in DB
Traceback (most recent call last):
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
self.dialect.do_execute(
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.DuplicateTable: relation "schemingdcat_statistics" already exists
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/etc/ckan/default/wsgi.py", line 20, in <module>
application = make_app(config)
File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware/__init__.py", line 27, in make_app
load_environment(conf)
File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 69, in load_environment
p.load_all()
File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 222, in load_all
load(*plugins)
File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 253, in load
plugins_update()
File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 210, in plugins_update
environment.update_config()
File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 227, in update_config
plugin.configure(config)
File "/usr/lib/ckan/default/src/ckanext-schemingdcat/ckanext/schemingdcat/plugin.py", line 259, in configure
sdct_model.clean()
File "/usr/lib/ckan/default/src/ckanext-schemingdcat/ckanext/schemingdcat/statistics/model.py", line 69, in clean
setup()
File "/usr/lib/ckan/default/src/ckanext-schemingdcat/ckanext/schemingdcat/statistics/model.py", line 49, in setup
statistics_table.create()
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/sql/schema.py", line 960, in create
bind._run_ddl_visitor(ddl.SchemaGenerator, self, checkfirst=checkfirst)
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 3228, in _run_ddl_visitor
conn._run_ddl_visitor(visitorcallable, element, **kwargs)
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 2211, in _run_ddl_visitor
visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/sql/visitors.py", line 524, in traverse_single
return meth(obj, **kw)
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/sql/ddl.py", line 895, in visit_table
self.connection.execute(
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1380, in execute
return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS)
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/sql/ddl.py", line 80, in _execute_on_connection
return connection._execute_ddl(
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1472, in _execute_ddl
ret = self._execute_context(
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1943, in _execute_context
self._handle_dbapi_exception(
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 2124, in _handle_dbapi_exception
util.raise_(
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/util/compat.py", line 208, in raise_
raise exception
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
self.dialect.do_execute(
File "/usr/lib/ckan/default/lib64/python3.9/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.DuplicateTable) relation "schemingdcat_statistics" already exists
[SQL:
CREATE TABLE schemingdcat_statistics (
id TEXT NOT NULL,
stat_count INTEGER NOT NULL,
stat_type TEXT NOT NULL,
value TEXT NOT NULL,
icon TEXT,
label TEXT,
PRIMARY KEY (id)
)
]
(Background on this error at: https://sqlalche.me/e/14/f405)
unable to load app 0 (mountpoint='') (callable not found or import error)