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
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'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 to Android String Resource. Click Continue 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, click English 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 select Upload 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 click Upload 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 select Organize 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 click I understand the consequences, delete this translation button to proceed.
After clicking the I understand the consequences, delete this translation button, the IntegrityError 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 getraiseself.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 _commitreturnself.connection.commit()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 256, in commitself.wait(self._commit_gen())
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 394, in waitreturn 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_genyield fromself._exec_command(b"COMMIT")
File "/app/venv/lib/python3.12/site-packages/psycopg/_connection_base.py", line 472, in _exec_commandraise 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 showreturn show_project(request, obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/weblate/trans/views/basic.py", line 413, in show_projectreturn render(
^^^^^^^
File "/app/venv/lib/python3.12/site-packages/weblate/trans/util.py", line 247, in renderreturn 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_stringreturn template.render(context, request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/backends/django.py", line 61, in renderreturnself.template.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 171, in renderreturnself._render(context)
^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _renderreturnself.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in renderreturn SafeString("".join([node.render_annotated(context) for node inself]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotatedreturnself.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 159, in renderreturn compiled_parent._render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _renderreturnself.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in renderreturn SafeString("".join([node.render_annotated(context) for node inself]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotatedreturnself.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 renderreturn SafeString("".join([node.render_annotated(context) for node inself]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotatedreturnself.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 210, in renderreturn template.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 173, in renderreturnself._render(context)
^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _renderreturnself.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in renderreturn SafeString("".join([node.render_annotated(context) for node inself]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotatedreturnself.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_annotatedreturnself.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 549, in renderreturnself.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in renderreturn SafeString("".join([node.render_annotated(context) for node inself]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotatedreturnself.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 326, in renderreturn nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in renderreturn SafeString("".join([node.render_annotated(context) for node inself]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotatedreturnself.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_translationwith 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 innerreturn func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 323, in commitself._commit()
File "/app/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 298, in _commitwith 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 _commitreturnself.connection.commit()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 256, in commitself.wait(self._commit_gen())
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 394, in waitreturn 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_genyield fromself._exec_command(b"COMMIT")
File "/app/venv/lib/python3.12/site-packages/psycopg/_connection_base.py", line 472, in _exec_commandraise 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 getraiseself.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 _commitreturnself.connection.commit()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 256, in commitself.wait(self._commit_gen())
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 394, in waitreturn 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_genyield fromself._exec_command(b"COMMIT")
File "/app/venv/lib/python3.12/site-packages/psycopg/_connection_base.py", line 472, in _exec_commandraise 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 showreturn show_project(request, obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/weblate/trans/views/basic.py", line 413, in show_projectreturn render(
^^^^^^^
File "/app/venv/lib/python3.12/site-packages/weblate/trans/util.py", line 247, in renderreturn 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_stringreturn template.render(context, request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/backends/django.py", line 61, in renderreturnself.template.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 171, in renderreturnself._render(context)
^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _renderreturnself.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in renderreturn SafeString("".join([node.render_annotated(context) for node inself]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotatedreturnself.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 159, in renderreturn compiled_parent._render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _renderreturnself.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in renderreturn SafeString("".join([node.render_annotated(context) for node inself]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotatedreturnself.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 renderreturn SafeString("".join([node.render_annotated(context) for node inself]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotatedreturnself.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 210, in renderreturn template.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 173, in renderreturnself._render(context)
^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 163, in _renderreturnself.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in renderreturn SafeString("".join([node.render_annotated(context) for node inself]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotatedreturnself.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_annotatedreturnself.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 549, in renderreturnself.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in renderreturn SafeString("".join([node.render_annotated(context) for node inself]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotatedreturnself.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/defaulttags.py", line 326, in renderreturn nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 1000, in renderreturn SafeString("".join([node.render_annotated(context) for node inself]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/template/base.py", line 961, in render_annotatedreturnself.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_translationwith 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 innerreturn func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 323, in commitself._commit()
File "/app/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 298, in _commitwith 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 _commitreturnself.connection.commit()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 256, in commitself.wait(self._commit_gen())
File "/app/venv/lib/python3.12/site-packages/psycopg/connection.py", line 394, in waitreturn 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_genyield fromself._exec_command(b"COMMIT")
File "/app/venv/lib/python3.12/site-packages/psycopg/_connection_base.py", line 472, in _exec_commandraise 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
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
The text was updated successfully, but these errors were encountered:
This (probably) happens because read-only views do not use transactions so they get mixed view (fetch component which is then removed together with translations). The removal itself happens in a transaction, so it is atomic.
There used to be ATOMIC_REQUESTS turned on, but it was later removed in 041a27c as that caused several issues. Also, Django documentation mentions that it doesn't cover template rendering, and that's where we get this issue.
Possible approaches:
Turn on ATOMIC_REQUESTS again. This might be a performance issue (many more transactions) and might also trigger some bugs because we might be relying on smaller level atomicity in some code paths.
Annotate projects and components scheduled for removal with a boolean field and filter that when listing.
I tend to prefer the second approach, as that provides a better user experience, as the object scheduled for removal will disappear immediately from the UI, even if the removal might take long. On the other side, it will need more code changes, but we can initially focus only on the obvious code paths.
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
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.
Add new strings
and clickUpload
to begin the adding of new strings.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.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
How do you run Weblate?
Docker container
Weblate versions
Weblate deploy checks
Additional context
No response
The text was updated successfully, but these errors were encountered: