-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
423 Locked
error when creating a new component with languages and doing auto-translate
#13345
Comments
Weblate locks internally the component for some operations, for example to avoid concurrent manipulation with the files. Retrying later should work. You should be able to see what is going on in the server logs. |
Command to get the log:
As you can see, there are other components (e.g. This is our server log from the first
But from previous calls (I do not know from which request, but I think when uploading the new source file) I can see some locks with Is there a chance to get the timeout of the lock with the Another question: In the access logs, I see that some crawlers access the edit page of strings. Does this also lead to a lock? For reference, I have found the following locks which have more than 5 seconds timeout: Lines 98 to 105 in 6763676
weblate/weblate/utils/backup.py Lines 39 to 41 in 6763676
Lines 114 to 116 in f595bb9
|
The timeout applies when acquiring the lock and waiting while other process holds the lock. The locking happens on component or repository level, so when components share a single repository they will wait for a single lock when Weblate is working with the repository. |
Ok, we have this shared repository: https://translate.owlinfra.de/projects/shared-glossaries/real-cookie-banner/: So, in this case, when e.g. WordPress Real Cookie Banner (Backend, PHP) and WordPress Real Cookie Banner (Frontend, JavaScript) call the |
Yes. |
This is only a glossary and is used for the DeepL support for glossaries (#10519). As this glossary is not affected by the e.g. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm confused now, you get the locking when calling autotranslate, so how is the glossary not affected by it?
Locking is necessary to avoid concurrent operations on the underlying repository. For database operations, we're slowly progressing towards row level locking, but we're not yet fully there for some code paths. |
Yes, I am getting the locked error when I call the
But at this time, the Glossary is only used for read operation. We have now added a workaround to just wait two minutes on an 423 error, but we are still running into the issue. Is there a chance to get the timeout of the lock with the Retry-After header? |
Include scope and compoent in the error message so that it gives more insight where the blocking operation is happening. Issue WeblateOrg#13345
Why do you think it's the glossary that is being locked? There is no locking involved when reading glossaries to be used in DeepL. There are two kinds of lock which can influence this:
#13606 will make Weblate tell in the error message what kind of lock is causing this error. |
Include scope and compoent in the error message so that it gives more insight where the blocking operation is happening. Issue WeblateOrg#13345
Include scope and compoent in the error message so that it gives more insight where the blocking operation is happening. Issue WeblateOrg#13345
Include scope and compoent in the error message so that it gives more insight where the blocking operation is happening. Issue WeblateOrg#13345
Because of #13345 (comment), sorry, if I understood something wrong.
Nice, thanks for your efforts!
So, if I understand correctly, the REST API could send a response already back to our CI pipeline even when the repository is not yet unlocked / commits are pending? If yes, would it be useful to have a something like a |
Include scope and compoent in the error message so that it gives more insight where the blocking operation is happening. Issue #13345
Ah, sorry, I misunderstood your question then. You should be able to see in the server logs what is going on while you get this error. The committing might be it, but there might be a different reason as well. |
How can I test those changes? We are currently using docker. What are your thoughts about the |
We have no clue how long the lock will be held, so I don't see a reasonable way to produce the PS: We should really revisit locking. The single lock to prevent all consistency issues on component level is probably not a viable approach. I've created #13623 to track this task. |
What do you think about this? This would ensure committing is done directly within the request and a response is only sent back when it has finished. I also found When I think about all this, I would bring in another question: Would it make sense to provide a REST API to "pause" commits so the CI job would look like this:
|
The commits are done only when needed. That currently translates to changing an already pending string (util #8770 is implemented). But as mentioned before, it might be something different from committing in your case. Check server logs, what is actually happening at that time. |
In case you rely on translation propagation, #13665 might have addressed the root cause of this issue. |
Do you have an ETA when #13665 will be released? I did not yet test it as I am running within Docker and there is no updated docker image for "unreleased" fixes/betas. |
The |
Describe the issue
The following describes a sequential process of creating a new component and uploading the main POT file with new languages and auto translating them. Additionally, you can see the output within our custom logs.
1.) We create a new component with
POST /api/projects/(string: project)/components/
✅ This is successful.
2.) We install an addon with
POST /api/components/(string: project)/(string: component)/addons/
✅ This is successful.
3.) We create languages in the freshly created component with
POST /api/components/(string: project)/(string: component)/translations/
✅ This is successful.
4.) We upload the main POT file with
POST /api/translations/(string: project)/(string: component)/(string: language)/file
✅ This is successful.
5.) We auto translate the created languages with machine translation with
POST /api/translations/(string: project)/(string: component)/(string: language)/autotranslate/
❌ The response is a
423 Locked
error. All the requests to the REST API are sequential and never run in parallel. In our tests we also made sure that the component is not locked by user access.But, I found this ticket: #4666, especially the comment #4666 (comment). Relevant code:
weblate/weblate/vcs/apps.py
Lines 104 to 116 in f595bb9
Is there a chance to find out what caused the lock? Why is it 120 seconds?
I already tried
Steps to reproduce the behavior
See above.
Expected behavior
No lock error
Screenshots
No response
Exception traceback
No response
How do you run Weblate?
Docker container
Weblate versions
No response
Weblate deploy checks
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: