Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User merge tool fails if source profile is georeferenced #1116

Open
brunobesson opened this issue Jul 6, 2021 · 0 comments
Open

User merge tool fails if source profile is georeferenced #1116

brunobesson opened this issue Jul 6, 2021 · 0 comments

Comments

@brunobesson
Copy link
Member

Stack trace extract:

Updating feed entries...
Updating contributions versions and histories...
Unregistering from mailing lists...
Removing profile and user account...
Traceback (most recent call last):
File "/var/www/.build/venv/lib/python3.7/site-packages/sqlalchemy/engine/base. py", line 1277, in _execute_context
cursor, statement, parameters, context
File "/var/www/.build/venv/lib/python3.7/site-packages/sqlalchemy/engine/defau lt.py", line 608, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.ForeignKeyViolation: update or delete on table "documents" viola tes foreign key constraint "map_associations_document_id_fkey" on table "map_ass ociations"
DETAIL: Key (document_id)=(13274) is still referenced from table "map_associati ons".

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

Traceback (most recent call last):
File "c2corg_api/scripts/users/merge.py", line 275, in
main()
File "c2corg_api/scripts/users/merge.py", line 100, in main
merge_user_accounts(source_user_id, target_user_id, queue_config)
File "c2corg_api/scripts/users/merge.py", line 122, in merge_user_accounts
_remove_user_account(source_user_id)
File "c2corg_api/scripts/users/merge.py", line 270, in _remove_user_account
ArchiveUserProfile, None)
File "/var/www/c2corg_api/views/document_delete.py", line 340, in remove_whole _document
remove_document(document_id)
File "/var/www/c2corg_api/views/document_delete.py", line 481, in remove_docu ment
filter(Document.document_id == document_id).
File "/var/www/.build/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py ", line 3926, in delete
delete_op.exec
()
File "/var/www/.build/venv/lib/python3.7/site-packages/sqlalchemy/orm/persiste nce.py", line 1697, in exec

self._do_exec()
File "/var/www/.build/venv/lib/python3.7/site-packages/sqlalchemy/orm/persiste nce.py", line 1930, in _do_exec
self._execute_stmt(delete_stmt)
File "/var/www/.build/venv/lib/python3.7/site-packages/sqlalchemy/orm/persiste nce.py", line 1702, in _execute_stmt
self.result = self.query._execute_crud(stmt, self.mapper)
File "/var/www/.build/venv/lib/python3.7/site-packages/sqlalchemy/orm/query.py ", line 3568, in _execute_crud
return conn.execute(stmt, self._params)
sqlalchemy.exc.IntegrityError: (psycopg2.errors.ForeignKeyViolation) update or d elete on table "documents" violates foreign key constraint "map_associations_doc ument_id_fkey" on table "map_associations"
DETAIL: Key (document_id)=(13274) is still referenced from table "map_associati ons".

[SQL: DELETE FROM guidebook.documents WHERE guidebook.documents.document_id = %( document_id_1)s]
[parameters: {'document_id_1': 13274}]
(Background on this error at: http://sqlalche.me/e/13/gkpj)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant