You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we want to edit links that are used in multiple pages, we might encounter a constraint violation of our database
I am not really sure if this is related to the archived pages or if this is also connected to the race conditions of #1518 .
Additional Information
Traceback
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/integreat_cms/cms/models/abstract_content_translation.py", line 487, in save
super().save(*args, **kwargs)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/db/models/base.py", line 739, in save
self.save_base(using=using, force_insert=force_insert,
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/db/models/base.py", line 776, in save_base
updated = self._save_table(
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/db/models/base.py", line 881, in _save_table
results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/db/models/base.py", line 919, in _do_insert
return manager._insert(
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/db/models/query.py", line 1270, in _insert
return query.get_compiler(using=using).execute_sql(returning_fields)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1416, in execute_sql
cursor.execute(sql, params)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/cacheops/transaction.py", line 98, in execute
result = self._no_monkey.execute(self, sql, params)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.IntegrityError: duplicate key value violates unique constraint "pagetranslation_unique_version"
DETAIL: Key (page_id, language_id, version)=(12473, 3, 17) already exists.
The text was updated successfully, but these errors were encountered:
timobrembeck
changed the title
Editing LinkObjects results in violation of unique_versions
Replacing links used in multiple pages causes internal server error
Oct 12, 2022
# Replace the old urls with the new urls in the content
fortranslationintranslations:
new_translation=deepcopy(translation)
# Replace link in translation
logger.debug("Replacing links of %r", new_translation)
new_translation.content=rewrite_links(
new_translation.content,
partial(self.replace_link, old_url.url, new_url),
)
# Save translation with replaced content as new minor version
new_translation.id=None
new_translation.version+=1
But only in the condition that the database is already broken - if links exist to old translation versions. So this is somehow a follow-up error of some other known (#1513, #1604) or unknown bug and not a problem on itself...
Describe the Bug
If we want to edit links that are used in multiple pages, we might encounter a constraint violation of our database
I am not really sure if this is related to the archived pages or if this is also connected to the race conditions of #1518 .
Additional Information
Traceback
The text was updated successfully, but these errors were encountered: