Bug 4499 - Uploading of po files in Tx no longer possible
Summary: Uploading of po files in Tx no longer possible
Status: RESOLVED WONTFIX
Alias: None
Product: Infrastructure
Classification: Unclassified
Component: Others (show other bugs)
Version: unspecified
Hardware: i586 Linux
Priority: High critical
Target Milestone: ---
Assignee: Sysadmin Team
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-12 17:36 CET by Oliver Burger
Modified: 2013-06-10 13:59 CEST (History)
3 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments
en_GB fake po file for testing purposes (11.48 KB, text/plain)
2012-02-12 17:40 CET, Oliver Burger
Details
tx login tracebackl (4.73 KB, text/plain)
2012-03-11 22:50 CET, Oliver Burger
Details

Description Oliver Burger 2012-02-12 17:36:37 CET
When trying to upload a po file into our tx you get a popup 
"A strange error occured."

When using tx client, the message is a bit longer:

[oli@beteigeuze external_resources.plasma_applet_icontaskspot]$ tx push -t -l en_GB
Pushing translations for resource external_resources.plasma_applet_icontaskspot:
Pushing 'en_GB' translations (file: translations/external_resources.plasma_applet_icontaskspot/en_GB.po)
Exception: Remote server replied: {"status": "Error", "message": "A strange error happened."}

Translating online is still working, but I can't push any pot file updates from the svn to tx anymore.
Oliver Burger 2012-02-12 17:38:13 CET

Priority: Normal => High
CC: (none) => mageia-i18n

Comment 1 Oliver Burger 2012-02-12 17:40:01 CET
Created attachment 1531 [details]
en_GB fake po file for testing purposes

I did some "en_GB" translation just for testing, but the problem occurs with other po files in other projects/resources.
Comment 2 Michael Scherer 2012-02-13 01:06:17 CET
I see nothing in the log :/

Could it be related to upgrade ?

CC: (none) => misc

Comment 3 Remco Rijnders 2012-02-13 05:24:39 CET
misc: Olli and I thought the same as it might well be that I was the first to upload a .po file to transifex since the upgrade.

Unfortunately, the error message displayed is particulary unhelpful.
Comment 4 Oliver Burger 2012-02-13 09:42:36 CET
We can still work in the online editor and download files for commiting them to svn.
But we can't work offline anymore and as I said, when there are changes on the pot files, I can't upload those anymore.
Last time I know it worked was before the upgrade, e.g. on January 27th, when I uploaded the plasma-icon-tasks pot file.
Comment 5 Michael Scherer 2012-02-13 20:18:45 CET
Can you give sysadmin proof way of reproducing ? I can for sure debug it, but i would like to be sure I do not mess up the installation.
Comment 6 Remco Rijnders 2012-02-14 07:24:05 CET
Michael,

Unless I'm misunderstanding, the .po file attached with this bugreport should result in the observed error when trying to upload it. You can do this after logging in to transifex and selecting the "Upload file" button, for example at https://transifex.mageia.org/projects/p/urpmi/. On there, click urpmi.pot and select a language which you have translator access to.
Comment 7 Oliver Burger 2012-02-14 07:37:16 CET
Or use tx client in a terminal:
- Install transifex-client (on Mga1) or transifex-client0.4 (on Cauldron)
According to transifex.org newer versions of the client are foir usage with a newer version of the server.
- Go to some temporary directory
- Type "tx init" and follow the instructions there
- Type "tx set --auto-remote https://transifex.mageia.org/projects/p/external_resources/resource/plasma_applet_icontaskspot/"
- Type "tx pull -a"
- Move the po file attached to this bug report to the newly created folder "translations/external_resources.plasma_applet_icontaskspot/" renaming it to "en_GB.po"
- Type "tx push -t -l en_GB"
- Read the error message
Comment 8 Michael Scherer 2012-02-24 21:22:00 CET
Ok so I found out so far that the error message is 400 bad request ( which is weird ).

And so, by looking at the proper log file, I found out this error message :

[Fri Feb 24 20:18:55 2012] [error] [2012-02-24 20:18:55,326 tx DEBUG] __init__() got an unexpected keyword argument 'mime'

( of course, things would not be funny if init was not present 1 thousand time in source code ... )
Comment 9 Michael Scherer 2012-02-24 21:32:25 CET
More information, seems to be in /usr/share/transifex/storage/api.py
Comment 10 Michael Scherer 2012-02-24 21:42:56 CET
Ok, found it, problem is : 

>>> m = magic.Magic(mime=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() got an unexpected keyword argument 'mime'

So that's related to my previous patch :
http://trac.transifex.org/ticket/736 
( and the fact that python-magic changed ).

TX is now fixed for this part ( edited in place the file ), I will prepare a proper update and a patch.
Comment 11 Michael Scherer 2012-02-25 03:00:40 CET
I also disabled transaction handling, after reading https://docs.djangoproject.com/en/dev/topics/db/transactions/
I am not sure of that's a good idea, but we will see.
Comment 12 Oliver Burger 2012-03-01 09:29:45 CET
On trying to create a new resource in drakx-net (to replace the buggy 1_drakx-net.pot one) I still get the "COMMIT/ROLLBACK message from Tx.
Oliver Burger 2012-03-07 10:29:45 CET

Priority: High => release_blocker
Severity: major => critical

Comment 13 Michael Scherer 2012-03-11 18:21:16 CET
Ok, found out the error, i was not looking at the good place. 
It was a configuration problem, django has some middleware ( ie, various layer allowing to do some computing on the request ), and the one in charge of transaction was missing. I think I did enable it during my test, but i forgot to commit it, and puppet did his job of reseting the configuration. 

Sorry about the delay and the breakage, I should have been more meticulous with the whole debugging session.

As a side note, someone should reset the en_gb.po file, since I successfully send it.
Comment 14 Oliver Burger 2012-03-11 22:50:12 CET
Created attachment 1726 [details]
tx login tracebackl

Now, we can't login any more...

Oliver
Comment 15 Michael Scherer 2012-03-12 00:12:52 CET
That's like Zelda III, when you think it finished, everything just start. 

So basically, if I enable the middleware for transation, the API is working, but login ail. If i do not enable it, that's the reverse. 

Having read the documentation several time, i think it can be solved but i have no idea how.
Comment 16 Michael Scherer 2012-03-12 00:43:38 CET
So I did read some docs ( yes, i wanted to go to bed 1h ago ). I think the best we could do would be to log all sql query and this should give us more information. But I do not under postgresql doc tonight : 

So just for the record :
http://thebuild.com/blog/2009/11/07/django-postgresql-and-transaction-management/
http://stackoverflow.com/questions/722221/how-to-log-postgres-sql-queries
Comment 17 Michael Scherer 2012-03-12 00:54:26 CET
( and after re reading again, I seen how I can get all query, but since both phpbb and sympa are sending their queries, that's messy ).
Comment 18 Michael Scherer 2012-03-12 15:09:06 CET
So, in the meantime, what should we do. 
that's either the commandline, or the web interface :/
Comment 19 Oliver Burger 2012-03-27 10:18:15 CEST
For the time before the release, needed changes in the translations should be done by the commiters in svn.

After the release, find a replacement.
Either if it works, use newest tx version
if not switch to other tool, e.g. pootle or if nothing else works, create project on tx.net?

Priority: release_blocker => High

Comment 20 Oliver Burger 2013-06-10 13:59:47 CEST
As Tx is completely dead...

Status: NEW => RESOLVED
Resolution: (none) => WONTFIX


Note You need to log in before you can comment on or make changes to this bug.