Skip to content

Export SIA 405 Abwasser: Error #82

@urskaufmann

Description

@urskaufmann

Export just 3 reach records out of the demo dataset (with datenherr): OK

Export all records, new digitized records not all with datenherr: Error

Ein Fehler trat bei der Ausführung von Python-Code auf:

sqlalchemy.exc.IntegrityError: (psycopg2.errors.NotNullViolation) null value in column "datenherrref" of relation "vsa_baseclass" violates not-null constraint DETAIL: Failing row contains (10, null, null). [SQL: INSERT INTO pg2ili_abwasser.vsa_baseclass (t_id, datenherrref, datenlieferantref) VALUES (%(t_id)s, %(datenherrref)s, %(datenlieferantref)s)] [parameters: ({'t_id': 10, 'datenherrref': None, 'datenlieferantref': None}, {'t_id': 11, 'datenherrref': None, 'datenlieferantref': None}, {'t_id': 12, 'datenherrref': None, 'datenlieferantref': None}, {'t_id': 13, 'datenherrref': None, 'datenlieferantref': None}, {'t_id': 14, 'datenherrref': 5, 'datenlieferantref': 6}, {'t_id': 15, 'datenherrref': 5, 'datenlieferantref': 6}, {'t_id': 16, 'datenherrref': 5, 'datenlieferantref': 6}, {'t_id': 17, 'datenherrref': 5, 'datenlieferantref': 6} ... displaying 10 of 106 total bound parameter sets ... {'t_id': 114, 'datenherrref': 5, 'datenlieferantref': 6}, {'t_id': 115, 'datenherrref': 5, 'datenlieferantref': 6})] (Background on this error at: http://sqlalche.me/e/13/gkpj)
Traceback (most recent call last):
File "C:\PROGRA1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\engine\base.py", line 1256, in _execute_context
self.dialect.do_executemany(
File "C:\PROGRA
1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\dialects\postgresql\psycopg2.py", line 912, in do_executemany
cursor.executemany(statement, parameters)
psycopg2.errors.NotNullViolation: null value in column "datenherrref" of relation "vsa_baseclass" violates not-null constraint
DETAIL: Failing row contains (10, null, null).

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\tww_test/python/plugins\teksi_wastewater\teksi_wastewater_plugin.py", line 474, in actionExportClicked
self.interlisImporterExporter.action_export()
File "C:\Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\tww_test/python/plugins\teksi_wastewater\interlis\gui\interlis_importer_exporter.py", line 129, in action_export
raise exception
File "C:\Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\tww_test/python/plugins\teksi_wastewater\interlis\gui\interlis_importer_exporter.py", line 113, in action_export
self._action_export()
File "C:\Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\tww_test/python/plugins\teksi_wastewater\interlis\gui\interlis_importer_exporter.py", line 335, in _action_export
self._export_to_intermediate_schema(
File "C:\Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\tww_test/python/plugins\teksi_wastewater\interlis\gui\interlis_importer_exporter.py", line 411, in _export_to_intermediate_schema
twwInterlisExporter.tww_export()
File "C:\Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\tww_test/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 61, in tww_export
raise exception
File "C:\Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\tww_test/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 56, in tww_export
self._tww_export()
File "C:\Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\tww_test/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 75, in _tww_export
self._export_channel()
File "C:\Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\tww_test/python/plugins\teksi_wastewater\interlis\interlis_model_mapping\interlis_exporter_to_intermediate_schema.py", line 199, in _export_channel
self.abwasser_session.flush()
File "C:\PROGRA1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\orm\session.py", line 2540, in flush
self._flush(objects)
File "C:\PROGRA
1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\orm\session.py", line 2682, in flush
transaction.rollback(capture_exception=True)
File "C:\PROGRA~1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\util\langhelpers.py", line 68, in exit
compat.raise
(
File "C:\PROGRA~1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\util\compat.py", line 182, in raise

raise exception
File "C:\PROGRA1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\orm\session.py", line 2642, in _flush
flush_context.execute()
File "C:\PROGRA
1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\orm\unitofwork.py", line 422, in execute
rec.execute(self)
File "C:\PROGRA1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\orm\unitofwork.py", line 586, in execute
persistence.save_obj(
File "C:\PROGRA
1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\orm\persistence.py", line 239, in save_obj
_emit_insert_statements(
File "C:\PROGRA1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\orm\persistence.py", line 1083, in _emit_insert_statements
c = cached_connections[connection].execute(statement, multiparams)
File "C:\PROGRA
1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\engine\base.py", line 1011, in execute
return meth(self, multiparams, params)
File "C:\PROGRA1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\sql\elements.py", line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "C:\PROGRA
1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\engine\base.py", line 1124, in _execute_clauseelement
ret = self.execute_context(
File "C:\PROGRA1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\engine\base.py", line 1316, in _execute_context
self._handle_dbapi_exception(
File "C:\PROGRA
1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\engine\base.py", line 1510, in handle_dbapi_exception
util.raise
(
File "C:\PROGRA~1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\util\compat.py", line 182, in raise

raise exception
File "C:\PROGRA1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\engine\base.py", line 1256, in _execute_context
self.dialect.do_executemany(
File "C:\PROGRA
1\QGIS3\apps\Python39\lib\site-packages\sqlalchemy\dialects\postgresql\psycopg2.py", line 912, in do_executemany
cursor.executemany(statement, parameters)
sqlalchemy.exc.IntegrityError: (psycopg2.errors.NotNullViolation) null value in column "datenherrref" of relation "vsa_baseclass" violates not-null constraint
DETAIL: Failing row contains (10, null, null).

[SQL: INSERT INTO pg2ili_abwasser.vsa_baseclass (t_id, datenherrref, datenlieferantref) VALUES (%(t_id)s, %(datenherrref)s, %(datenlieferantref)s)]
[parameters: ({'t_id': 10, 'datenherrref': None, 'datenlieferantref': None}, {'t_id': 11, 'datenherrref': None, 'datenlieferantref': None}, {'t_id': 12, 'datenherrref': None, 'datenlieferantref': None}, {'t_id': 13, 'datenherrref': None, 'datenlieferantref': None}, {'t_id': 14, 'datenherrref': 5, 'datenlieferantref': 6}, {'t_id': 15, 'datenherrref': 5, 'datenlieferantref': 6}, {'t_id': 16, 'datenherrref': 5, 'datenlieferantref': 6}, {'t_id': 17, 'datenherrref': 5, 'datenlieferantref': 6} ... displaying 10 of 106 total bound parameter sets ... {'t_id': 114, 'datenherrref': 5, 'datenlieferantref': 6}, {'t_id': 115, 'datenherrref': 5, 'datenlieferantref': 6})]
(Background on this error at: http://sqlalche.me/e/13/gkpj)

Python-Version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
QGIS-Version: 3.28.6-Firenze Firenze, 868c9fa03b

Python-Pfad:
C:/PROGRA1/QGIS3/apps/qgis-ltr/./python
C:/Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\tww_test/python
C:/Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\tww_test/python/plugins
C:/PROGRA
1/QGIS3/apps/qgis-ltr/./python/plugins
C:\PROGRA1\QGIS3\apps\grass\grass82\etc\python
C:\Windows\system32
C:\Program Files\QGIS3\bin\python39.zip
C:\PROGRA
1\QGIS3\apps\Python39\DLLs
C:\PROGRA1\QGIS3\apps\Python39\lib
C:\Program Files\QGIS3\bin
C:\PROGRA
1\QGIS3\apps\Python39
C:\PROGRA1\QGIS3\apps\Python39\lib\site-packages
C:\PROGRA
1\QGIS3\apps\Python39\lib\site-packages\win32
C:\PROGRA1\QGIS3\apps\Python39\lib\site-packages\win32\lib
C:\PROGRA
1\QGIS3\apps\Python39\lib\site-packages\Pythonwin
C:/Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\tww_test/python
T:/12_GIS/01_QGIS/QGEP/qgep-test/tww_project_2020/test
C:\Users/KAU/AppData/Roaming/QGIS/QGIS3\profiles\tww_test/python/plugins\teksi_wastewater\interlis\gui....
.

Metadata

Metadata

Assignees

No one assigned

    Labels

    INTERLISAbout INTERLIS exchange format (import / export)bugSomething isn't workingpluginConcerns the wastewater plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions