I installed Active Translation on a Drupal 6.2 install which previously had the i18n module. However, it hangs during the table build phase of the installation, stuck on 0%.

There's currently just one node with translations in 2 languages (default language + one translation) and I've waited for several minutes with nothing happening.

Comments

drewish’s picture

Category: bug » support

are there any php errors? anything in the log file? what database are you using?

GuyveR800’s picture

No php errors whatsoever in the http-server error log.
I'm using MySQL 5.0.51a.

The Drupal log has a notice "Rebuilding the active translation table.", immediately followed by the error "Unknown table 'active_translation' query: DROP TABLE active_translation in /var/www/drupal/includes/database.mysql-common.inc on line 261."

The location associated with the error is "http://mydomain/en/batch?id=6&op=do, referred by "http://mydomain/en/batch?op=start&id=6" with the id number increasing every attempt I made.

drewish’s picture

good, i was afraid you were using pgsql or an old version. i developed it using 5.0.45 so 5.0.5 should be pretty similar...

did the table get created after that? what happens if you try re-installing it?

GuyveR800’s picture

I tried disabling and then enabling the module. Same thing happens as a fresh install. The progress bar says "Initializing", then switches to "Remaining 1 of 1" and stays there.

The table does seem to get created. I see three fields, "atid", "en" and "ja" (my two languages). There's one record, with value "2" for all three fields.

drewish’s picture

Status: Active » Needs review
StatusFileSize
new2.48 KB

humm... here's a patch to add some watchdog calls. would you mind giving it a try? note that you'll need to grab the latest version from CVS because i just committed a fix for #271301.

drewish’s picture

StatusFileSize
new2.52 KB

actually here's a patch for beta5 that includes the fix for #271301.

GuyveR800’s picture

Only entry in the log is "Starting to rebuild the active translation table."
I don't get the 'Unknown Table' error anymore, but it's still stuck.

If I cancel (ESC key) and visit the error page, this message appears in the log "There was an error that prevented the active translation table from being properly rebuilt."

Perhaps it's interesting to mention that during active_translation being enabled, all content that's not language-neutral disappears from the frontpage, even though i18n is set to "all content". (Same happens when i18n isn't even enabled or installed)

drewish’s picture

and when you view the table there's only one record for the translated node? there should be a row for each of the language neutral nodes... i wonder if the problem is generating those rows. if you go to admin/settings/active_translation/rebuild and rebuild do you run into the same problem?

drewish’s picture

StatusFileSize
new3.61 KB

here's a patch with more debug info. it'll put the query to insert the nodes in the watchdog log. i'd try running that by hand and see if you get errors or if it times out, etc.

GuyveR800’s picture

and when you view the table there's only one record for the translated node? there should be a row for each of the language neutral nodes... i wonder if the problem is generating those rows.

Well, there's only 1 language neutral node on my site right now. So if the rows in the active_translation are only for neutral ones, that would make sense.

I have 1 other node that's in english (default language), with a translation (japanese). The body for this node is empty, by the way, maybe that matters somehow.

if you go to admin/settings/active_translation/rebuild and rebuild do you run into the same problem?

Yes, exact same thing.

here's a patch with more debug info. it'll put the query to insert the nodes in the watchdog log. i'd try running that by hand and see if you get errors or if it times out, etc.

- Starting to rebuild the active translation table.
- Running query: INSERT INTO {active_translation} (atid, en, ja) SELECT DISTINCT(nid), nid, nid FROM {node} WHERE tnid = 0 ORDER BY tnid
- Created records for untranslated and language neutral nodes.

Then nothing.

drewish’s picture

StatusFileSize
new4.4 KB

Well, there's only 1 language neutral node on my site right now. So if the rows in the active_translation are only for neutral ones, that would make sense.

I misspoke, every node in the system should have a row in the table. Both untranslated and language neutral nodes should have rows but in their case every column in the table will have the same value.

so if you open up mysql and try running

INSERT INTO active_translation (atid, en, ja) SELECT DISTINCT(nid), nid, nid FROM node WHERE tnid = 0 ORDER BY tnid

what happens?... oh wait, it may not matter if you're seeing "Created records for untranslated and language neutral nodes." in the watchdog log.

here's a patch to add some more debugging messages.

drewish’s picture

StatusFileSize
new4.8 KB

actually here's one that tests that node_load succeeds.

NEOatNHNG’s picture

StatusFileSize
new1.52 KB

That's what I get:
Starting to rebuild the active translation table.
Created records for untranslated and language neutral nodes.

and then thousands of these two:
Processing 20 translations from tnid @tnid
Still have more nodes to process...

finally:
There was an error that prevented the active translation table from being properly rebuilt.

I don't have many nodes (about one or two test nodes) and I guess there should be some value instead of @tnid

I attached my current batch just in case I have a different file than you.

drewish’s picture

StatusFileSize
new4.57 KB

ah, had a typo that was preventing the value of tnid from being displayed. could you try this one?

also this patch is against the -dev release.

NEOatNHNG’s picture

Ok now it goes (the other warnings remain unchanged):
Processing 20 translations of 2. starting at tnid 1
Still have more nodes to process...

and then thousands of those:
Processing 20 translations of 2. starting at tnid 3
Still have more nodes to process...

drewish’s picture

odd... it seems like it's not incrementing properly so it never makes it though the process.

NEOatNHNG, what database are you using?

drewish’s picture

i don't know if this will help but it makes an effort to try to count the available translations in a better way.

update: deleted the patch since it was the wrong one.

drewish’s picture

StatusFileSize
new5.13 KB

here's the complete patch

NEOatNHNG’s picture

StatusFileSize
new372 bytes

#16:
>mysql --version
mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486) using readline 5.2

#17:
against which version did you create the patch? Because in my current *.batch.inc there is no such line. I patched against the dev version + last patch (#14)

#18:
successfully patched against -dev. Problem remains:
Processing 20 translations of 2. starting at tnid 1
Still have more nodes to process... progress: 1 max: 2

and then thousands of these:
Processing 20 translations of 2. starting at tnid 3
Still have more nodes to process... progress: 1 max: 2

I attached the contents of my node table for further debugging info

drewish’s picture

humm... i just upgraded to 5.0.51b to see if it was version specific and it doesn't seem to affect anything. what happens when you try it with that last patch?

update: ignore that, i just saw your edited comment.

NEOatNHNG’s picture

I attached the contents of my node table as CSV (comma separated values) above, maybe this can help you.

drewish’s picture

if one of you guys could send me a db dump that'd be very helpful in trouble shooting this. that way i could determine if it's data, software, etc that's causing the problems.

NEOatNHNG’s picture

StatusFileSize
new352.63 KB

Here it is (without the users table, if you want that one too, send me a pm containing your email address and PGP key).

drewish’s picture

thanks, that totally helped me debug the problem. the trick seemed to be having a node with nid=1, in which case my code would skip over it and since it never got processed it could never make it to completion.

please try out the attached patch and let me know if it works for you.

NEOatNHNG’s picture

Did you forget to attach the patch or am I just too blind to find it?

drewish’s picture

StatusFileSize
new4.84 KB

i dunno, it was there when i previewed

NEOatNHNG’s picture

Jippie, that worked for me.
Here my log:
Starting to rebuild the active translation table.
Created records for untranslated and language neutral nodes.
Sucessfully rebuilt the active translation table.

Thank you for your work.

drewish’s picture

Title: Installation stuck at building table » Rebuilding table never completes

great! thanks for your help debugging this. committing that patch to HEAD, i'll roll a new release shortly.

drewish’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.