weblate
weblate copied to clipboard
IntegrityError occurs when deleting a component added from sratch
Describe the issue
The IntegrityError occurs when adding an Android String Resource component from scratch and deleting it. The component and is deleted but it will lead to an error page same as shown below:
I already tried
- [X] I've read and searched the documentation.
- [X] I've searched for similar filed issues in this repository.
Steps to reproduce the behavior
-
Create a new Project.
-
In the newly created project, add a new component. In the Create component page, select
Start from scratch
tab. Provide a Component name, and set its File format toAndroid String Resource
. ClickContinue
to proceed with the creation of the component. -
After a successful creation of the component, the Community localization checklist page is shown. Click
Return to the component
to go to the Component page. In the Component page, clickEnglish
in the list of languages. -
In the English project language page, you will be a adding new strings via upload since it is blank. To add the new strings, click the
Files
dropdown and selectUpload translation
. This will show the Upload form for the translation. -
Save the code below as XML file (.xml). This will be uploaded using the Upload form to add new strings.
<resources>
<string name="app_name">Github Visualizer</string>
<string name="my_bio">"A material metaphor is the unifying theory of a rationalized space and a system of motion."</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="title_activity_profile">ProfileActivity</string>
<string name="action_settings">Settings</string>
<string name="title_activity_repository_info" translatable="false">RepositoryInfoActivity</string>
<string name="title_activity_test_repo">TestRepoActivity</string>
<string name="title_activity_file_viewer">FileViewerActivity</string>
<string name="dummy_button">Dummy Button</string>
<string name="dummy_content">DUMMY\nCONTENT</string>
</resources>
- In the Upload form, set the saved XML file as file to be uploaded. Set the File upload mode to
Add new strings
and clickUpload
to begin the adding of new strings. - Once the adding of new strings is successful, go back to the Component page for its deletion. In the Component page, click the dropdown
Manage
and selectOrganize or remove
. Scroll to the bottom part of the page to see the Component removal form. In the Component removal form, provide the full slug of the component to confirm the deletion and clickI understand the consequences, delete this translation
button to proceed. - After clicking the
I understand the consequences, delete this translation
button, theIntegrityError
page will be shown.
Expected behavior
It is expected that it will redirect to the Project page and display a message The translation component was scheduled for removal.
An example screenshot is shown below:
Screenshots
No response
Exception traceback
Internal Server Error: /projects/blank-project/
Traceback (most recent call last):
File "/app/venv/lib/python3.12/site-packages/weblate/trans/models/component.py", line 1143, in source_translation
result = self.translation_set.select_related("plural").get(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/db/models/query.py", line 649, in get
raise self.model.DoesNotExist(
weblate.trans.models.translation.Translation.DoesNotExist: Translation matching query does not exist.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 299, in _commit
return self.connection.commit()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 256, in commit
self.wait(self._commit_gen())
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 394, in wait
return waiting.wait(gen, self.pgconn.socket, interval=interval)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "psycopg_binary/_psycopg/waiting.pyx", line 213, in psycopg_binary._psycopg.wait_c
File "/app/venv/lib/python3.12/site-packages/psycopg/_connection_base.py", line 577, in _commit_gen
yield from self._exec_command(b"COMMIT")
File "/app/venv/lib/python3.12/site-packages/psycopg/_connection_base.py", line 472, in _exec_command
raise e.error_from_result(result, encoding=self.pgconn._encoding)
psycopg.errors.ForeignKeyViolation: insert or update on table "trans_translation" violates foreign key constraint "trans_translation_component_id_c4b70a26_fk_trans_component_id"
DETAIL: Key (component_id)=(39) is not present in table "trans_component".
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/views/decorators/cache.py", line 80, in _view_wrapper
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/weblate/trans/views/basic.py", line 218, in show
return show_project(request, obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/weblate/trans/views/basic.py", line 413, in show_project
return render(
^^^^^^^
File "/app/venv/lib/python3.12/site-packages/weblate/trans/util.py", line 247, in render
return django.shortcuts.render(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/shortcuts.py", line 25, in render
content = loader.render_to_string(template_name, context, request, using=using)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/loader.py", line 62, in render_to_string
return template.render(context, request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 171, in render
return self._render(context)
^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 159, in render
return compiled_parent._render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 65, in render
result = block.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 210, in render
return template.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 173, in render
return self._render(context)
^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 242, in render
nodelist.append(node.render_annotated(context))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 549, in render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 326, in render
return nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/library.py", line 258, in render
_dict = self.func(*resolved_args, **resolved_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/weblate/trans/templatetags/translations.py", line 442, in format_unit_source
source_translation = unit.translation.component.source_translation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/utils/functional.py", line 47, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/weblate/trans/models/component.py", line 1148, in source_translation
with transaction.atomic():
File "/app/venv/lib/python3.12/site-packages/django/db/transaction.py", line 263, in __exit__
connection.commit()
File "/app/venv/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 323, in commit
self._commit()
File "/app/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 298, in _commit
with debug_transaction(self, "COMMIT"), self.wrap_database_errors:
File "/app/venv/lib/python3.12/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/app/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 299, in _commit
return self.connection.commit()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 256, in commit
self.wait(self._commit_gen())
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 394, in wait
return waiting.wait(gen, self.pgconn.socket, interval=interval)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "psycopg_binary/_psycopg/waiting.pyx", line 213, in psycopg_binary._psycopg.wait_c
File "/app/venv/lib/python3.12/site-packages/psycopg/_connection_base.py", line 577, in _commit_gen
yield from self._exec_command(b"COMMIT")
File "/app/venv/lib/python3.12/site-packages/psycopg/_connection_base.py", line 472, in _exec_command
raise e.error_from_result(result, encoding=self.pgconn._encoding)
django.db.utils.IntegrityError: insert or update on table "trans_translation" violates foreign key constraint "trans_translation_component_id_c4b70a26_fk_trans_component_id"
DETAIL: Key (component_id)=(39) is not present in table "trans_component".
Internal Server Error: /projects/blank-project/
Traceback (most recent call last):
File "/app/venv/lib/python3.12/site-packages/weblate/trans/models/component.py", line 1143, in source_translation
result = self.translation_set.select_related("plural").get(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/db/models/query.py", line 649, in get
raise self.model.DoesNotExist(
weblate.trans.models.translation.Translation.DoesNotExist: Translation matching query does not exist.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 299, in _commit
return self.connection.commit()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 256, in commit
self.wait(self._commit_gen())
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 394, in wait
return waiting.wait(gen, self.pgconn.socket, interval=interval)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "psycopg_binary/_psycopg/waiting.pyx", line 213, in psycopg_binary._psycopg.wait_c
File "/app/venv/lib/python3.12/site-packages/psycopg/_connection_base.py", line 577, in _commit_gen
yield from self._exec_command(b"COMMIT")
File "/app/venv/lib/python3.12/site-packages/psycopg/_connection_base.py", line 472, in _exec_command
raise e.error_from_result(result, encoding=self.pgconn._encoding)
psycopg.errors.ForeignKeyViolation: insert or update on table "trans_translation" violates foreign key constraint "trans_translation_component_id_c4b70a26_fk_trans_component_id"
DETAIL: Key (component_id)=(39) is not present in table "trans_component".
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/app/venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/views/decorators/cache.py", line 80, in _view_wrapper
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/weblate/trans/views/basic.py", line 218, in show
return show_project(request, obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/weblate/trans/views/basic.py", line 413, in show_project
return render(
^^^^^^^
File "/app/venv/lib/python3.12/site-packages/weblate/trans/util.py", line 247, in render
return django.shortcuts.render(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/shortcuts.py", line 25, in render
content = loader.render_to_string(template_name, context, request, using=using)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/loader.py", line 62, in render_to_string
return template.render(context, request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 171, in render
return self._render(context)
^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 159, in render
return compiled_parent._render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 65, in render
result = block.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 210, in render
return template.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 173, in render
return self._render(context)
^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 242, in render
nodelist.append(node.render_annotated(context))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 549, in render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 326, in render
return nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/library.py", line 258, in render
_dict = self.func(*resolved_args, **resolved_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/weblate/trans/templatetags/translations.py", line 442, in format_unit_source
source_translation = unit.translation.component.source_translation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/utils/functional.py", line 47, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/weblate/trans/models/component.py", line 1148, in source_translation
with transaction.atomic():
File "/app/venv/lib/python3.12/site-packages/django/db/transaction.py", line 263, in __exit__
connection.commit()
File "/app/venv/lib/python3.12/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 323, in commit
self._commit()
File "/app/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 298, in _commit
with debug_transaction(self, "COMMIT"), self.wrap_database_errors:
File "/app/venv/lib/python3.12/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/app/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 299, in _commit
return self.connection.commit()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 256, in commit
self.wait(self._commit_gen())
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 394, in wait
return waiting.wait(gen, self.pgconn.socket, interval=interval)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "psycopg_binary/_psycopg/waiting.pyx", line 213, in psycopg_binary._psycopg.wait_c
File "/app/venv/lib/python3.12/site-packages/psycopg/_connection_base.py", line 577, in _commit_gen
yield from self._exec_command(b"COMMIT")
File "/app/venv/lib/python3.12/site-packages/psycopg/_connection_base.py", line 472, in _exec_command
raise e.error_from_result(result, encoding=self.pgconn._encoding)
django.db.utils.IntegrityError: insert or update on table "trans_translation" violates foreign key constraint "trans_translation_component_id_c4b70a26_fk_trans_component_id"
DETAIL: Key (component_id)=(39) is not present in table "trans_component".
[19/Aug/2024 14:54:00] "GET /projects/blank-project/ HTTP/1.1" 500 493583
How do you run Weblate?
Docker container
Weblate versions
- Weblate: 5.7.1-b56ae0ca51
- Django: 5.0.8
- siphashc: 2.4.1
- translate-toolkit: 3.13.3
- lxml: 5.3.0
- pillow: 10.4.0
- nh3: 0.2.18
- python-dateutil: 2.9.0.post0
- social-auth-core: 4.5.4
- social-auth-app-django: 5.4.2
- django-crispy-forms: 2.3
- oauthlib: 3.2.2
- django-compressor: 4.5.1
- djangorestframework: 3.15.2
- django-filter: 24.3
- django-appconf: 1.0.6
- user-agents: 2.2.0
- filelock: 3.15.4
- rapidfuzz: 3.9.6
- openpyxl: 3.1.5
- celery: 5.4.0
- django-celery-beat: 2.6.0
- kombu: 5.4.0
- translation-finder: 2.16
- weblate-language-data: 2024.5
- html2text: 2024.2.26
- pycairo: 1.26.1
- PyGObject: 3.48.2
- diff-match-patch: 20230430
- requests: 2.32.3
- django-redis: 5.4.0
- hiredis: 3.0.0
- sentry-sdk: 2.13.0
- Cython: 3.0.11
- mistletoe: 1.4.0
- GitPython: 3.1.43
- borgbackup: 1.4.0
- pyparsing: 3.1.2
- ahocorasick_rs: 0.22.0
- python-redis-lock: 4.0.0
- charset-normalizer: 3.3.2
- cyrtranslit: 1.1.1
- Python: 3.12.5
- Git: 2.39.2
- psycopg: 3.2.1
- psycopg-binary: 3.2.1
- phply: 1.2.6
- ruamel.yaml: 0.18.6
- tesserocr: 2.7.0
- boto3: 1.34.162
- zeep: 4.2.1
- aeidon: 1.15
- iniparse: 0.5
- mysqlclient: 2.2.4
- Mercurial: 6.8.1
- git-svn: 2.39.2
- git-review: 2.4.0
- PostgreSQL server: 16.2
- Database backends: django.db.backends.postgresql
- PostgreSQL implementation: psycopg3 (binary)
- Cache backends: default:RedisCache, avatar:FileBasedCache
- Email setup: django.core.mail.backends.smtp.EmailBackend: 127.0.0.1
- OS encoding: filesystem=utf-8, default=utf-8
- Celery: redis://cache:6379/1, redis://cache:6379/1, regular
- Platform: Linux 6.10.4-200.fc40.x86_64 (x86_64)
Weblate deploy checks
SystemCheckError: System check identified some issues:
CRITICALS:
?: (weblate.E003) Cannot send e-mail ([Errno 111] Connection refused), please check EMAIL_* settings.
HINT: https://docs.weblate.org/en/latest/admin/install.html#out-mail
?: (weblate.E012) The server e-mail address should be changed from its default value
HINT: https://docs.weblate.org/en/latest/admin/install.html#production-email
?: (weblate.E013) The "From" e-mail address should be changed from its default value
HINT: https://docs.weblate.org/en/latest/admin/install.html#production-email
ERRORS:
?: (weblate.E011) E-mail addresses for site admins is misconfigured
HINT: https://docs.weblate.org/en/latest/admin/install.html#production-admins
WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.
?: (security.W012) SESSION_COOKIE_SECURE is not set to True. Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions.
?: (security.W018) You should not have DEBUG set to True in deployment.
INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
HINT: https://docs.weblate.org/en/latest/admin/install.html#collecting-errors
?: (weblate.I028) Backups are not configured, it is highly recommended for production use
HINT: https://docs.weblate.org/en/latest/admin/backup.html
System check identified 10 issues (1 silenced).
Additional context
No response