When I do a Content Translation Upgrade I have the following error:

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /en/batch?id=89&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 2: UPDATE {node} SET status=:db_update_placeholder_0 WHERE (nid IN ()) ; Array ( [:db_update_placeholder_0] => 0 ) in entity_translation_upgrade_do() (line 158 of /home/quickstart/websites/XXXX.com/sites/all/modules/entity_translation/entity_translation_upgrade/entity_translation_upgrade.admin.inc).

Comments

heyyo’s picture

Component: Documentation » Code

I have to precise that my website is a drupal 6 website upgraded to drupal 7. I applyed successfully content upgrade(from cck)
Before upgrading, i activated the module title, converted all my titles of nodes and terms to field
and set all my needed fields to translatable.

Is there anyway to log the process ?

This error appears only at more than 50%, so it seems record(s) in my database makes trouble. If I repeat 6 times this upgrade process, it continues till the end, but my data is completly messed up.
Fortunatly i'm using virtual machine with snapshots.

Is there any documentation on this upgrade progress ?

plach’s picture

The upgrade process probably needs refinements, since it is alpha-quality code as most of ET. The error you are getting seems to indicate there is a bug somewhere in the code building the upgrade query. You might want to have a look to #1275152: EntityMalformedException error on Content Translation Upgrade with Drupal 7.8 to see if there is anything there helping you.

If you changed the translatable status of your fields you should try with #1279372: Enable bulk field language updates when switching field translatability, since without it field languages might not be correct.

Be sure to back everything up, since there is no warranty yet that the process will be successful.

heyyo’s picture

Thanks for your answer.

I looked to the post #1275152: EntityMalformedException error on Content Translation Upgrade with Drupal 7.8 so I tried to remove all my nodes with original languages not equal to site language. but didn't help. But I finally get the error (that I didn't get before):

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=185&op=do StatusText: Service unavailable (with message) ResponseText: EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7389 of /home/public_html/hurleybak/includes/common.inc).

So I suppose this error happends if nodes in database doesn't have existent node with their tnid.

So I also removed corresponding nodes with this query:
SELECT * FROM node WHERE tnid IN (SELECT tnid FROM node WHERE ( tnid = nid AND language <> 'en'))

And the previous error disapperead but my initial error is still here :-(

I tried also to remove my nodes without any translation so with tnid = 0. Didn't help too.

I have read the problem with Date and Link fields, I still have those fields in my database but not used in content types.
How could I remove them from my database if not used any more, to test if it's not related.

Anyway I tried to upgrade my content even with this error by repeating it untill the end with your patch #1279372: Enable bulk field language updates when switching field translatability you mentionned.
The translation is better, but now all my fields(except title) from english nodes are now in french !
My french nodes are correctly in french.
And my hebrew nodes are correctly in hebrew too.

PS: regarding backup, i'm really satisfied to use Virtual Machine with snapshots !!!

plach’s picture

Status: Active » Postponed (maintainer needs more info)
heyyo’s picture

Not sure what other info I could provide. My database ?

plach’s picture

Well, a scraped version of your db would surely help. But any information helping reproduce the bug would be welcome.

heyyo’s picture

I sent you all the details by email.

Best regards.

plach’s picture

Status: Postponed (maintainer needs more info) » Active

Ok, thanks, I'll try to have a look a this as soon as I can.

webmaster-eddie’s picture

Version: 7.x-1.x-dev » 7.x-1.0-alpha2
Component: Code » Base system

Une erreur HTTP AJAX s'est produite. Code de statut HTTP : 500 Informations de débogage ci-dessous. Chemin : /fr/batch?id=501&op=do StatusText: error ResponseText :

Her's the error I get when trying the entity translation upgrade (for content only) - there is no Response text, and the upgrade process gives this error about 1 second after starting the upgrade process, which appears to be starting correctly.

plach’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.x-dev
Status: Active » Postponed (maintainer needs more info)

Check the latest dev please.

plach’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Reopen this only with a list of steps to reproduce the bug on the latest dev, please.

Merlineus’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta2
Component: Base system » Node translation upgrade
Status: Closed (cannot reproduce) » Active

I trying to upgrade my nodes from node translation and receive an error:
Notice: Undefined index: 2 в entity_translation_upgrade_do() (row 92 from /var/home/merlin/data/www/new.izvestiya.odessa.ua/sites/all/modules/entity_translation/entity_translation_upgrade/entity_translation_upgrade.admin.inc).

I can't offer steps for reproducing this, but I can send you my DB dump.

plach’s picture

@Merlineus:

That could work but I'd need also the source files. Check the latest dev meanwhile.

Merlineus’s picture

@plach, the latest dev gives the same result.
If you don't mind I'll give you admin, ftp & db access to the dev site.

plach’s picture

As you prefer but I don't know whether I'll be able to look into this soonish. I'll grab a snapshot of your site, anyway.

plach’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Component: Node translation upgrade » Base system
Status: Active » Closed (cannot reproduce)

Closing this since the #12 seems a different issue. Please open a new one and provide any detail you can.

plach’s picture

Component: Base system » Node translation upgrade
nerdcore’s picture

Issue summary: View changes
Status: Closed (cannot reproduce) » Active

I've encountered this error consistently for one content type following a D6->D7 migration using migrate_d2d. I migrated nodes using i18n_node and was able to run Entity Translation Upgrade against all but one content type ("story") which fails with this error.

I started digging into this by doing a `var_dump($translation)` inside the if() which generates the exception (line 631 of translation.handler.inc in entity_translation 7.x-1.0-beta4+10-dev). This revealed a "created" timestamp which I used as a lookup into the node table.

array(7) {
 ["translate"]=> string(1) "0"
 ["status"]=> string(1) "1"
 ["language"]=> string(2) "fa"
 ["source"]=> string(2) "fa"
 ["uid"]=> string(1) "1"
 ["created"]=> string(10) "1196642520"
 ["changed"]=> string(10) "1234385151"
}

There is only one node with the created timestamp of 1196642520: NID 1005.

nid 1005 has tnid 1463 and language 'fa'
nid 1463 has tnid 1462 and language 'fa'
nid 1462 has tnid 0 and language 'fa':

mysql> select * from node where nid in (1005,1463,1462);
+------+------+-------+----------+----------------------------------------------------------------------+-----+--------+------------+------------+---------+---------+--------+------+-----------+
| nid  | vid  | type  | language | title                                                                | uid | status | created    | changed    | comment | promote | sticky | tnid | translate |
+------+------+-------+----------+----------------------------------------------------------------------+-----+--------+------------+------------+---------+---------+--------+------+-----------+
| 1005 | 1005 | story | fa       | محمدحسين نائينی «قوای مقوّم استبداد»                                 |   1 |      1 | 1196642520 | 1234385151 |       1 |       0 |      0 | 1463 |         0 |
| 1462 | 1462 | story | fa       | آخرین پرسش و پاسخ با شاهرخ مسکوب                                     |   1 |      1 | 1147792860 | 1234473275 |       1 |       0 |      0 |    0 |         0 |
| 1463 | 1463 | story | fa       | پیشگفتار                                                             |   1 |      1 | 1196642460 | 1234384925 |       1 |       0 |      0 | 1462 |         0 |
+------+------+-------+----------+----------------------------------------------------------------------+-----+--------+------------+------------+---------+---------+--------+------+-----------+

I looked these up in the migrate_map_story table to find the Drupal 6 NIDs:

mysql> select sourceid1,destid1 from migrate_map_story where destid1 in (1005,1463,1462);
+-----------+---------+
| sourceid1 | destid1 |
+-----------+---------+
|      1392 |    1462 |
|      1393 |    1463 |
|      1394 |    1005 |
+-----------+---------+
3 rows in set (0.00 sec)

Here are the related entries from the Drupal 6 node table:

mysql> select * from node where nid in (1392,1393,1394);
+------+------+-------+----------+----------------------------------------------------------------------+-----+--------+------------+------------+---------+---------+----------+--------+------+-----------+
| nid  | vid  | type  | language | title                                                                | uid | status | created    | changed    | comment | promote | moderate | sticky | tnid | translate |
+------+------+-------+----------+----------------------------------------------------------------------+-----+--------+------------+------------+---------+---------+----------+--------+------+-----------+
| 1392 | 1392 | story | fa       | آخرین پرسش و پاسخ با شاهرخ مسکوب                                     |   1 |      1 | 1147792860 | 1234473275 |       1 |       0 |        0 |      0 |    0 |         0 |
| 1393 | 1393 | story | fa       | پیشگفتار                                                             |   1 |      1 | 1196642460 | 1234384925 |       1 |       0 |        0 |      0 | 1392 |         0 |
| 1394 | 1394 | story | fa       | محمدحسين نائينی «قوای مقوّم استبداد»                                 |   1 |      1 | 1196642520 | 1234385151 |       1 |       0 |        0 |      0 | 1393 |         0 |
+------+------+-------+----------+----------------------------------------------------------------------+-----+--------+------------+------------+---------+---------+----------+--------+------+-----------+
3 rows in set (0.00 sec)

Hope this helps to track down the cause of this exception.

nerdcore’s picture

Also in relation to the node info I've included in my previous comment, I've just discovered some interesting tidbits about these nodes as caused by migrate_d2d.

The two configured language for this site are 'en' (primary default) and 'fa'.

Drupal 7 node 1463 appears to have migrated from Drupal 6 cleanly. It has a proper 'title' and TNID. Here is some truncated information from a `var_dump(node_load(1463))`:

object(stdClass)#235 (30) {
  ["vid"]=>
  string(4) "1463"
  ["uid"]=>
  string(1) "1"
  ["title"]=>
  string(16) "پیشگفتار"
  ["log"]=>
  string(0) ""
  ["status"]=>
  string(1) "1"
  ["comment"]=>
  string(1) "1"
  ["promote"]=>
  string(1) "0"
  ["sticky"]=>
  string(1) "0"
  ["nid"]=>
  string(4) "1463"
  ["type"]=>
  string(5) "story"
  ["language"]=>
  string(2) "fa"
  ["created"]=>
  string(10) "1196642460"
  ["changed"]=>
  string(10) "1234384925"
  ["tnid"]=>
  string(4) "1462"
  ["translate"]=>
  string(1) "0"
  ["title_field"]=>
  array(1) {
    ["fa"]=>
    array(1) {
      [0]=>
      array(3) {
        ["value"]=>
        string(16) "پیشگفتار"
        ["format"]=>
        NULL
        ["safe_value"]=>
        string(16) "پیشگفتار"
      }
    }
  }
  ["title_original"]=>
  string(16) "پیشگفتار"
  ["translations"]=>
  object(stdClass)#268 (2) {
    ["original"]=>
    NULL
    ["data"]=>
    array(0) {
    }
  }
[...]

Because this node lists nid 1462 as it's 'tnid' field I looked at 1462 and discovered that it was created by migrate_d2d createStub() function:

object(stdClass)#235 (30) {
  ["vid"]=>
  string(4) "1462"
  ["uid"]=>
  string(1) "1"
  ["title"]=>
  string(4) "Stub"
  ["log"]=>
  string(0) ""
  ["status"]=>
  string(1) "1"
  ["comment"]=>
  string(1) "1"
  ["promote"]=>
  string(1) "0"
  ["sticky"]=>
  string(1) "0"
  ["nid"]=>
  string(4) "1462"
  ["type"]=>
  string(5) "story"
  ["language"]=>
  string(2) "fa"
  ["created"]=>
  string(10) "1147792860"
  ["changed"]=>
  string(10) "1234473275"
  ["tnid"]=>
  string(1) "0"
  ["translate"]=>
  string(1) "0"
  ["body"]=>
  array(2) {
    ["fa"]=>
    array(1) {
      [0]=>
      array(5) {
        ["value"]=>
        string(30975) "THIRTY KB OF TEXT REMOVED FROM THIS POST"
        [...]
      }
    }
    ["und"]=>
    array(1) {
      [0]=>
      array(3) {
        ["value"]=>
        string(9) "Stub body"
        ["summary"]=>
        NULL
        ["format"]=>
        NULL
      }
    }
  }
  ["title_field"]=>
  array(2) {
    ["en"]=>
    array(1) {
      [0]=>
      array(3) {
        ["value"]=>
        string(4) "Stub"
        ["format"]=>
        NULL
        ["safe_value"]=>
        string(4) "Stub"
      }
    }
    ["fa"]=>
    array(1) {
      [0]=>
      array(3) {
        ["value"]=>
        string(58) "آخرین پرسش و پاسخ با شاهرخ مسکوب"
        ["format"]=>
        NULL
        ["safe_value"]=>
        string(58) "آخرین پرسش و پاسخ با شاهرخ مسکوب"
      }
    }
  }
[...]

Do you suppose the creation of Stub nodes during the migration may have a negative result on this Entity Translation Upgrade process?

nerdcore’s picture

And so deeper down the rabbit hole I go...

This is the Drupal 6 database...

mysql> select nid,vid,tnid,language from node where tnid in (1392,1393,1394,1395,1396,1397,1398,1399) and type='story';
+------+------+------+----------+
| nid  | vid  | tnid | language |
+------+------+------+----------+
| 1393 | 1393 | 1392 | fa       |
| 1394 | 1394 | 1393 | fa       |
| 1395 | 1395 | 1394 | fa       |
| 1396 | 1396 | 1395 | fa       |
| 1397 | 1397 | 1396 | fa       |
| 1398 | 1398 | 1397 | fa       |
| 1399 | 1399 | 1398 | fa       |
+------+------+------+----------+
7 rows in set (0.00 sec)

This does not appear to be correct structuring of i18n usage of the 'tnid' field AFAIK. I suspect this just keeps going and going and going. No idea where it stops.

I've never seen data structured in this way. Is this completely screwed up in Drupal 6 using i18n??

EDIT: I stopped looking at 1399, but it seems to have stopped there... Also, nid 1392 has language 'fa' and tnid 0. Nothing has tnid 1399. The most screwed up nodes seem to be listed in my select statement above.

lucian.ilea’s picture

Hi!

I am not sure this would help, but I had a similar error while upgrading to entity translation. The first content type I upgraded worked without problems. The second one didn't. I remembered that between the two attempts, I have enabled the Entity Translation Menu submodule. I disabled it and I was able to upgrade the rest of the content types.

Hope this helps!