Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When trying to upload a Danish translation file it spends a long time uploading the file and then returns this error message:
Error 503 Service Unavailable
Service Unavailable
Guru Meditation:
XID: 1529004261
Varnish
It's a 1.2Mb .po file, I'm running Firefox 3.0 on Ubuntu, and this is happening every time I try.
Comments
Comment #1
Gábor HojtsyCan you please try to break the file in two and try to import it that way? 1.2Mb is kind of a biggie to import. You get this 503 error, when the underlying request times out. It is not necessarily due to the file not being imported. So first it would be best to check whether the file was indeed imported anyway. That would help you skip moderating out the multiple imports later :)
Comment #2
kaerast CreditAttribution: kaerast commentedIt's still failing on the smaller file sizes, and they haven't been imported.
Comment #3
Gerhard Killesreiter CreditAttribution: Gerhard Killesreiter commentedCAn you attach one of the files here?
Comment #4
kaerast CreditAttribution: kaerast commentedI've attached the first of the two translation files.
Comment #5
Gerhard Killesreiter CreditAttribution: Gerhard Killesreiter commentedWhich browser do you use? Can you try another one?
Comment #6
kaerast CreditAttribution: kaerast commentedI'm getting the same problem in both Firefox 3.0.14 and Midori 0.1.2, but in Midori it seems to never get as far as giving an error 503 - it just keeps uploading forever. I don't think it's the browser since they both use different rendering engines. The commonalities are my connection or the server.
Comment #7
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedOk, apparently the problem is that the upload is interrupted server-side when uploading this file.
Comment #8
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedAlso, no string was uploaded when trying this. I suspect there was an out-of-memory error in php.
Comment #9
Gábor HojtsyThe import is using the (backported) Drupal 7 import code (to support contexts for Drupal 7 translations). That is not building any growing data structure of any kind (that I remember of) while reading the .po file, since all found strings are immediately saved into the database.
Comment #10
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedhm, I switched on the error logging, but that doesn't help. It also seems that I was wrong the first time, there are now quite a few translations in there...
Comment #11
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedNarayan made some config changes again, I am not sure they help for everybody.
The real problem is that the import takes so long: Narayan's upload of the da.po file took over 2 hours to complete.
This is probably because it does a lot of inserts into the SQL tables.
I think what we need is a queuing system which accepts the uploaded files and processes them in order. So the user feedback would be fast.
We should also make sure that we do not accept identical suggestions for strings.
Comment #12
Gábor HojtsySo the diagnosis is that when only one import is running, it is relatively fast, but when multiples are running, they need to wait on each other, INSERT by INSERT, so both PHP processes are bogged down? So we should line them up instead in a queue?
If we do this, we need to somehow figure out how we provide feedback. If a .po file was malformed or it only contained (mostly) duplicate strings, then the user should know. Should we send out an email report of the import once done?
Comment #13
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedI am not sure if it really matters if there are several imports at once. They create more load of course. I think this is why Narayan suggested to have only one at a time.
Comment #14
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedOh, and a email report would be nice, yes.
I guess the header of the file could be still checked during the upload.
Comment #15
Gábor HojtsyMoving to infra issue.
Ok, just deployed a patch for this. Now strings submitted via the web UI, imported from .po files or submitted via the remote interface are first trimmed, then applied the leading/trailing whitespace from the source string, then checked for duplicity. Only if they contain anything but whitespace AND do not equal any of the active translations or suggestions for the same source string do we save the translation/suggestion.
The .po import issue still needs to be solved. I've noticed that even entering single translations takes quite some time. We might want to revisit the indexes on the l10n_community_translations table and remove any that we don't need, which would speed up inserts considerably.
Comment #16
Gábor HojtsyTo clarify this, we have three types of input: UI translation, imports and remote submissions via l10n_client. These can happen concurrently. Even if we solve the concurrency of multiple imports at the same time, we still need to deal with UI imports and remote submissions concurring with the imports. UI submissions are small (at most 30 strings at once), and remote submissions are tiny (at most 1 submission at once :), but given all the languages, this can give us quite a write concurrency issue.
Comment #17
moshe weitzman CreditAttribution: moshe weitzman commentedFor queueing, I suggest the small but useful job_queue module. Authored by drumm.
Comment #18
Gábor HojtsyThe .po imports were sped up significantly by code level changes, and we have not seen such issues in the past few months, so I'm closing this issue.
Comment #20
Gábor HojtsyMoving to new queue (sorry for issue-bombing).