Ein Fehler trat bei der Ausführung von Python-Code auf: sqlalchemy.exc.IntegrityError: (psycopg2.errors.ForeignKeyViolation) FEHLER: Einfügen oder Aktualisieren in Tabelle »wastewater_networkelement« verletzt Fremdschlüssel-Constraint »rel_wastewater_networkelement_wastewater_structure« DETAIL: Schlüssel (fk_wastewater_structure)=(ch13p7mzMA002320) ist nicht in Tabelle »wastewater_structure« vorhanden. [SQL: INSERT INTO qgep_od.wastewater_networkelement (obj_id, identifier, remark, last_modification, fk_dataowner, fk_provider, fk_wastewater_structure) VALUES (%(obj_id)s, %(identifier)s, %(remark)s, %(last_modification)s, %(fk_dataowner)s, %(fk_provider)s, %(fk_wastewater_structure)s)] [parameters: {'obj_id': 'ch13p7mzWN006889', 'identifier': 'SE5', 'remark': None, 'last_modification': datetime.date(2018, 4, 4), 'fk_dataowner': None, 'fk_provider': None, 'fk_wastewater_structure': 'ch13p7mzMA002320'}] (Background on this error at: http://sqlalche.me/e/13/gkpj) Traceback (most recent call last): File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\engine\base.py", line 1276, in _execute_context self.dialect.do_execute( File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\engine\default.py", line 608, in do_execute cursor.execute(statement, parameters) psycopg2.errors.ForeignKeyViolation: FEHLER: Einfügen oder Aktualisieren in Tabelle »wastewater_networkelement« verletzt Fremdschlüssel-Constraint »rel_wastewater_networkelement_wastewater_structure« DETAIL: Schlüssel (fk_wastewater_structure)=(ch13p7mzMA002320) ist nicht in Tabelle »wastewater_structure« vorhanden. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\test_1.6.0/python/plugins\qgepplugin\qgepqwat2ili\qgepqwat2ili\gui\gui_import.py", line 204, in commit_session self.session.commit() File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\session.py", line 1046, in commit self.transaction.commit() File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\session.py", line 504, in commit self._prepare_impl() File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\session.py", line 483, in _prepare_impl self.session.flush() File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\session.py", line 2540, in flush self._flush(objects) File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\session.py", line 2682, in _flush transaction.rollback(_capture_exception=True) File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\util\langhelpers.py", line 68, in __exit__ compat.raise_( File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\util\compat.py", line 182, in raise_ raise exception File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\session.py", line 2642, in _flush flush_context.execute() File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\unitofwork.py", line 419, in execute n.execute_aggregate(self, set_) File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\unitofwork.py", line 697, in execute_aggregate persistence.save_obj( File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\persistence.py", line 239, in save_obj _emit_insert_statements( File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\orm\persistence.py", line 1083, in _emit_insert_statements c = cached_connections[connection].execute(statement, multiparams) File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\engine\base.py", line 1011, in execute return meth(self, multiparams, params) File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\sql\elements.py", line 298, in _execute_on_connection return connection._execute_clauseelement(self, multiparams, params) File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\engine\base.py", line 1124, in _execute_clauseelement ret = self._execute_context( File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\engine\base.py", line 1316, in _execute_context self._handle_dbapi_exception( File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\engine\base.py", line 1510, in _handle_dbapi_exception util.raise_( File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\util\compat.py", line 182, in raise_ raise exception File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\engine\base.py", line 1276, in _execute_context self.dialect.do_execute( File "C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages\sqlalchemy\engine\default.py", line 608, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.IntegrityError: (psycopg2.errors.ForeignKeyViolation) FEHLER: Einfügen oder Aktualisieren in Tabelle »wastewater_networkelement« verletzt Fremdschlüssel-Constraint »rel_wastewater_networkelement_wastewater_structure« DETAIL: Schlüssel (fk_wastewater_structure)=(ch13p7mzMA002320) ist nicht in Tabelle »wastewater_structure« vorhanden. [SQL: INSERT INTO qgep_od.wastewater_networkelement (obj_id, identifier, remark, last_modification, fk_dataowner, fk_provider, fk_wastewater_structure) VALUES (%(obj_id)s, %(identifier)s, %(remark)s, %(last_modification)s, %(fk_dataowner)s, %(fk_provider)s, %(fk_wastewater_structure)s)] [parameters: {'obj_id': 'ch13p7mzWN006889', 'identifier': 'SE5', 'remark': None, 'last_modification': datetime.date(2018, 4, 4), 'fk_dataowner': None, 'fk_provider': None, 'fk_wastewater_structure': 'ch13p7mzMA002320'}] (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.4-Firenze Firenze, fd0fb72ab3 Python-Pfad: C:/PROGRA~1/QGIS 3.28.4/apps/qgis-ltr/./python C:/Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\test_1.6.0/python C:/Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\test_1.6.0/python/plugins C:/PROGRA~1/QGIS 3.28.4/apps/qgis-ltr/./python/plugins C:\Program Files\QGIS 3.28.4\bin\python39.zip C:\PROGRA~1\QGIS 3.28.4\apps\Python39\DLLs C:\PROGRA~1\QGIS 3.28.4\apps\Python39\lib C:\Program Files\QGIS 3.28.4\bin C:\Users\Stefan\AppData\Roaming\Python\Python39\site-packages C:\PROGRA~1\QGIS 3.28.4\apps\Python39 C:\PROGRA~1\QGIS 3.28.4\apps\Python39\lib\site-packages C:\PROGRA~1\QGIS 3.28.4\apps\Python39\lib\site-packages\win32 C:\PROGRA~1\QGIS 3.28.4\apps\Python39\lib\site-packages\win32\lib C:\PROGRA~1\QGIS 3.28.4\apps\Python39\lib\site-packages\Pythonwin C:/Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\test_1.6.0/python C:/Daten/TEKSI/4_Feature_requests/QGEP_INTERLIS_Improvements/my_export_sia405_ns_knoten_min1x.xtf C:\Users/Stefan/AppData/Roaming/QGIS/QGIS3\profiles\test_1.6.0/python/plugins\qgepplugin\qgepqwat2ili\qgepqwat2ili\gui\..\.. .