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

No automatic translation permissions #9259

Closed
2 tasks done
tomkolp opened this issue May 17, 2023 · 6 comments
Closed
2 tasks done

No automatic translation permissions #9259

tomkolp opened this issue May 17, 2023 · 6 comments
Assignees
Labels
bug Something is broken.
Milestone

Comments

@tomkolp
Copy link
Contributor

tomkolp commented May 17, 2023

Describe the issue

I'm using a superadmin account, the problem is with my second project (in the main one I don't have this problem).

When I try to translate a component using another component or all components, I get an error.

The weblat interface shows no error, the automatic translation progress bar goes to the end and stays like that forever. I have errors in the logs:

weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,416: INFO/MainProcess] Task weblate.trans.tasks.auto_translate[174904dc-4b4c-419f-bd26-f68b837bb659] received
weblate_1       | nginx stdout | 00.00.00.00 - - [17/May/2023:10:32:57 +0200] "POST /auto-translate/dodatki/mastermerchant_en/pl/ HTTP/1.0" 302 0 "https://weblate.eso-spolszczenie.eu/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42"
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,496: INFO/450] dodatki/mastermerchant_en/pl: starting automatic translation 174904dc-4b4c-419f-bd26-f68b837bb659: others: weblate
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,496: INFO/ForkPoolWorker-1] dodatki/mastermerchant_en/pl: starting automatic translation 174904dc-4b4c-419f-bd26-f68b837bb659: others: weblate
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,497: DEBUG/450] Acquiring Lock('lock:component-update-lock-4797') ...
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,497: DEBUG/ForkPoolWorker-1] Acquiring Lock('lock:component-update-lock-4797') ...
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,499: INFO/450] Acquired Lock('lock:component-update-lock-4797').
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,499: INFO/ForkPoolWorker-1] Acquired Lock('lock:component-update-lock-4797').
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,499: DEBUG/450] Starting renewal thread for Lock('lock:component-update-lock-4797'). Refresh interval: 40.0 seconds.
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,499: DEBUG/ForkPoolWorker-1] Starting renewal thread for Lock('lock:component-update-lock-4797'). Refresh interval: 40.0 seconds.
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,528: DEBUG/450] Signaling renewal thread for Lock('lock:component-update-lock-4797') to exit.
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,528: DEBUG/ForkPoolWorker-1] Signaling renewal thread for Lock('lock:component-update-lock-4797') to exit.
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,529: DEBUG/450] Exiting renewal thread for Lock('lock:component-update-lock-4797').
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,529: DEBUG/ForkPoolWorker-1] Exiting renewal thread for Lock('lock:component-update-lock-4797').
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,529: DEBUG/450] Renewal thread for Lock('lock:component-update-lock-4797') exited.
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,529: DEBUG/ForkPoolWorker-1] Renewal thread for Lock('lock:component-update-lock-4797') exited.
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,529: DEBUG/450] Releasing Lock('lock:component-update-lock-4797').
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,529: DEBUG/ForkPoolWorker-1] Releasing Lock('lock:component-update-lock-4797').
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,555: ERROR/450] Failure while executing task: PermissionDenied:
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,555: ERROR/ForkPoolWorker-1] Failure while executing task: PermissionDenied:
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,555: ERROR/450] Failure while executing task: PermissionDenied: {'signal': <Signal: task_failure providing_args={'traceback', 'task_id', 'args', 'exception', 'kwargs', 'einfo'}>, 'sender': <@task: weblate.trans.tasks.auto_translate of weblate at 0x7fdcd1ace490>, 'task_id': '174904dc-4b4c-419f-bd26-f68b837bb659', 'args': [2, 9666, 'translate', 'nottranslated', 'others', 3951, ['weblate'], 80], 'kwargs': {}, 'traceback': <traceback object at 0x7fdcc4145a00>, 'einfo': <ExceptionInfo: PermissionDenied()>}
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,555: ERROR/ForkPoolWorker-1] Failure while executing task: PermissionDenied: {'signal': <Signal: task_failure providing_args={'traceback', 'task_id', 'args', 'exception', 'kwargs', 'einfo'}>, 'sender': <@task: weblate.trans.tasks.auto_translate of weblate at 0x7fdcd1ace490>, 'task_id': '174904dc-4b4c-419f-bd26-f68b837bb659', 'args': [2, 9666, 'translate', 'nottranslated', 'others', 3951, ['weblate'], 80], 'kwargs': {}, 'traceback': <traceback object at 0x7fdcc4145a00>, 'einfo': <ExceptionInfo: PermissionDenied()>}
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,556: ERROR/450] Failure while executing task
weblate_1       | celery-translate stderr | Traceback (most recent call last):
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/celery/app/trace.py", line 451, in trace_task
weblate_1       | celery-translate stderr |     R = retval = fun(*args, **kwargs)
weblate_1       | celery-translate stderr |                  ^^^^^^^^^^^^^^^^^^^^
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/celery.py", line 249, in _inner
weblate_1       | celery-translate stderr |     reraise(*exc_info)
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/_compat.py", line 60, in reraise
weblate_1       | celery-translate stderr |     raise value
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/celery.py", line 244, in _inner
weblate_1       | celery-translate stderr |     return f(*args, **kwargs)
weblate_1       | celery-translate stderr |            ^^^^^^^^^^^^^^^^^^
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/celery/app/trace.py", line 734, in __protected_call__
weblate_1       | celery-translate stderr |     return self.run(*args, **kwargs)
weblate_1       | celery-translate stderr |            ^^^^^^^^^^^^^^^^^^^^^^^^^
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/celery/app/autoretry.py", line 34, in run
weblate_1       | celery-translate stderr |     return task._orig_run(*args, **kwargs)
weblate_1       | celery-translate stderr |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/weblate/trans/tasks.py", line 404, in auto_translate
weblate_1       | celery-translate stderr |     auto.process_others(component)
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/contextlib.py", line 81, in inner
weblate_1       | celery-translate stderr |     return func(*args, **kwds)
weblate_1       | celery-translate stderr |            ^^^^^^^^^^^^^^^^^^^
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/weblate/trans/autotranslate.py", line 96, in process_others
weblate_1       | celery-translate stderr |     raise PermissionDenied
weblate_1       | celery-translate stderr | django.core.exceptions.PermissionDenied
weblate_1       | celery-translate stderr | [2023-05-17 10:32:57,556: ERROR/ForkPoolWorker-1] Failure while executing task
weblate_1       | celery-translate stderr | Traceback (most recent call last):
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/celery/app/trace.py", line 451, in trace_task
weblate_1       | celery-translate stderr |     R = retval = fun(*args, **kwargs)
weblate_1       | celery-translate stderr |                  ^^^^^^^^^^^^^^^^^^^^
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/celery.py", line 249, in _inner
weblate_1       | celery-translate stderr |     reraise(*exc_info)
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/_compat.py", line 60, in reraise
weblate_1       | celery-translate stderr |     raise value
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/sentry_sdk/integrations/celery.py", line 244, in _inner
weblate_1       | celery-translate stderr |     return f(*args, **kwargs)
weblate_1       | celery-translate stderr |            ^^^^^^^^^^^^^^^^^^
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/celery/app/trace.py", line 734, in __protected_call__
weblate_1       | celery-translate stderr |     return self.run(*args, **kwargs)
weblate_1       | celery-translate stderr |            ^^^^^^^^^^^^^^^^^^^^^^^^^
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/celery/app/autoretry.py", line 34, in run
weblate_1       | celery-translate stderr |     return task._orig_run(*args, **kwargs)
weblate_1       | celery-translate stderr |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/weblate/trans/tasks.py", line 404, in auto_translate
weblate_1       | celery-translate stderr |     auto.process_others(component)
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/contextlib.py", line 81, in inner
weblate_1       | celery-translate stderr |     return func(*args, **kwds)
weblate_1       | celery-translate stderr |            ^^^^^^^^^^^^^^^^^^^
weblate_1       | celery-translate stderr |   File "/usr/local/lib/python3.11/site-packages/weblate/trans/autotranslate.py", line 96, in process_others
weblate_1       | celery-translate stderr |     raise PermissionDenied
weblate_1       | celery-translate stderr | django.core.exceptions.PermissionDenied

The problem is not new, it appeared a long time ago.

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

  1. Select a component
  2. Use automatic translation

Expected behavior

No response

Screenshots

image

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

4.18-dev — 3edb332286806737b2699b656050cb53e1a4baa2

4.18-dev — [3edb332](https://github.com/WeblateOrg/weblate/commits/3edb332286806737b2699b656050cb53e1a4baa2)

Weblate deploy checks

No response

Additional context

No response

@tomkolp tomkolp added the question This is more a question for the support than an issue. label May 17, 2023
@github-actions
Copy link

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger.

In case your question is already answered, making a donation is the right way to say thank you!

@nijel nijel added this to the 4.18 milestone May 17, 2023
@nijel nijel self-assigned this May 17, 2023
@nijel nijel added bug Something is broken. and removed question This is more a question for the support than an issue. labels May 17, 2023
@nijel
Copy link
Member

nijel commented May 17, 2023

There can be two reasons:

  • components have different source language
  • project does not have enabled contribution to shared translation memory and that blocks its usage as automatic translation source

I will adjust the code to provide better explanation of the cause.

@nijel nijel closed this as completed in 95938e0 May 17, 2023
@github-actions
Copy link

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

@tomkolp
Copy link
Contributor Author

tomkolp commented May 17, 2023

"enabled contribution to shared translation memory" is not intentionally enabled in the "Dodatki" project.

The "Dodatki" project is not intended to contribute to the common memory used by the main "Eso spolszczenie" project. The component I want to translate is in the "Dodatki" project, I select another component from the "Dodatki" project as the translation source.

Both components have the source language English and are translated into Polish. I'll check the message after tomorrow's update.

@tomkolp
Copy link
Contributor Author

tomkolp commented May 19, 2023

@nijel
weblate-docker-weblate-1 | celery-translate stderr | django.core.exceptions.PermissionDenied: Project has disabled contribution to shared translation memory.

I get the message "disabled contribution to shared translation memory."
Do I understand correctly that if you enable "contribution to shared translation memory" for the "Dodatki" project. If I use automatic translation in the "Eso spolszczenie" project using other components, then translations from the "Dodatki" project can be inserted?

Does "contribution to shared translation memory" work for automatic translation or only for the automatic suggestions tab?

I just want to translate a component with other components from the same project. I don't want translations from this project to be used in other projects.

nijel added a commit that referenced this issue Jun 5, 2023
Always allow to use components within a project for automatic translation.

Issue #9259
@nijel
Copy link
Member

nijel commented Jun 5, 2023

If Contribute to shared translation memory is disabled, the project cannot be used as source for automatic translations. I've just updated the docs to cover that.

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

No branches or pull requests

2 participants