Project

General

Profile

Actions

Task #3648

closed

Not possible to upload po files using curl

Added by Miloš Šrámek over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Category:
Weblate
Target version:
-
Start date:
Due date:
% Done:

0%

Tags:
Documentation, EasyHack, Salt

Description

Hi,
I would like to return to the problem with file upload, which has been already treated in Task #3583.

The weblate.documentfoundation.org server (Version 4.25.2) sometimes accepts my post:

curl -s -X POST -F method=translate -F conflicts=replace-translated -F file=@libo_ui-master/sk/sw/messages.po -H "authorization: Token <mytoken>" https://translations.documentfoundation.org/api/translations/libo_ui-master/swmessages/sk/file//
Result: {"not_found":0,"skipped":5027,"accepted":12,"total":5039,"result":true,"count":5039}

sometimes finishes with 0 accepted strings (there was one changed translation in the file):

curl -s -X POST -F method=translate -F conflicts=replace-translated -F file=@libo_ui-master/sk/wizards/messages.po -H "authorization: Token <mytoken>" https://translations.documentfoundation.org/api/translations/libo_ui-master/wizardsmessages/sk/file//
Command failed with {"not_found":0,"skipped":278,"accepted":0,"total":278,"result":false,"count":278}

and sometimes the upload is finished without a meaningful response:

curl -X POST -F method=translate -F conflicts=replace-translated -F file=@libo_ui-master/sk/sw/messages.po -H "authorization: Token <mytoken>" https://translations.documentfoundation.org/api/translations/libo_ui-master/swmessages/sk/file//
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 910k 0 0 100 910k 0 8662 0:01:47 0:01:47 --:--:-- 0
curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)

Here it looks like that the file was completely uploaded, but no response was obtained.

The version with -F overwrite=true worked correctly on 24.03.2022 (as reported in the l10n mailing list.
Perhaps there is more about the problem in the logs, I tried these uploads on March 02, 2023.

I have tried the same on hosted.weblate.org, both command versions work correctly (weblate version 4.16):

curl -X POST -F method=translate -F conflicts=replace-translated -F file=@collabora-online/browser/po/ui-sk.po -H "authorization: Token <mytoken>" https://hosted.weblate.org/api/translations/collabora-online/ui/sk/file//
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 84154 0 80 100 84074 94 99176 --:--:-- --:--:-- --:--:-- 99238
Result: {"not_found":0,"skipped":470,"accepted":3,"total":526,"result":true,"count":526}

curl -s -X POST -F overwrite=true -F file=@collabora-online/browser/po/ui-sk.po -H "authorization: Token <mytoken>" https://hosted.weblate.org/api/translations/collabora-online/ui/sk/file//
Uploading file collabora-online/browser/po/ui-sk.po
Result: {"not_found":0,"skipped":473,"accepted":1,"total":526,"result":true,"count":526}

May the problem be caused by the version 4.15.2? I have not found anything in the weblate's github.

Thank you in advance for considering this problem
Milos

Actions #1

Updated by Christian Lohmaier over 1 year ago

  • Status changed from New to Feedback

Yesterday (March 2nd) the templates were updated and during that time the sw/messages component was locked.
So please check status of the component before trying to upload/to check whether the error occurs when the component is locked.

e.g. curl https://translations.documentfoundation.org/api/components/libo_ui-master/swmessages/lock/

Actions #2

Updated by Miloš Šrámek over 1 year ago

  • Status changed from Feedback to Closed

Thank you, I did not know about locking, I'll take care about that next time.
Everything works as expected today, so the issue can be closed.

Actions

Also available in: Atom PDF