Hi!

At the moment I am using Nodewords 6.x-1.3-alpha2 (I know a rather old version, but because there were so many problems with the following versions, I decided to keep the old but working one for a while). Because Nodewords 6.x-1.11 seems to be rather stable, I now want to update to it.

1) Trying to update from Nodewords 6.x-1.3-alpha2 to 6.x-1.11 directly.
Somewhere in the middle, the update process hangs. After 60 minutes, I stopped the update process manually. The error message says:
"The update process was aborted prematurely while running update #6151 in nodewords.module."
The following queries were executed:
...
Update #6151
* No queries

2) Trying to update from Nodewords 6.x-1.3-alpha2 to 6.x-1.3
I made a database restore to Nodewords 6.x-1.3-alpha2 and tried a update to 6.x-1.3 first
Somewhere in the beginning, the update process hangs. After 60 minutes, I stopped the update process manually. The error message says:
"The update process was aborted prematurely while running update #6151 in nodewords.module."
The following queries were executed:
...
Update #6151
* No queries

My site only has about 400 nodes, so I think the update process can't take longer than some seconds / minutes. So there must be a problem somewhere.
Any ideas what the problem might be and how I can update?

Comments

avpaderno’s picture

Status: Active » Postponed (maintainer needs more info)

Thanks for the report. I will look into that update function, and see if I can understand why it doesn't work.

What database are you using, and which version? I have seen updates failing on PostgreSQL, but working for MySQL. As I test the code on MySQL 5, it could be I have not problems but other users could have them.

SamDa’s picture

Thanks for trying to help.

Here is some data about my system:
Debian ETCH
MySQL: 5.0.32-7etch11
PHP: 5.2.0-8+etch16
PHP memory limit: 256M
Apache: 2.2-common 2.2.3-4+etch11
Drupal: 6.15

avpaderno’s picture

May you also report here the content of the database table nodewords_custom?

avpaderno’s picture

Change the function nodewords_update_6151() contained in nodewords.install to the following code:

/**
 * Implements hook_update_N().
 */
function nodewords_update_6151(&$sandbox) {
  $ret = array();

  if (!isset($sandbox['progress'])) {
    $sandbox['progress'] = 0;
    $sandbox['max'] = db_result(db_query("SELECT COUNT(*) FROM {nodewords_custom} WHERE name = ''"));
  }

  if ($sandbox['max']) {
    $pages = db_query_range("SELECT * FROM {nodewords_custom} WHERE name = '' ORDER BY pid ASC", $sandbox['progress'], 10);

    while ($page = db_fetch_object($pages)) {
      $ret[] = update_sql(
        "UPDATE {nodewords_custom} SET name = '" . db_escape_string("Custom page #{$sandbox['progress']}") . "' WHERE pid = " . $page->pid
      );

      $sandbox['progress']++;
    }
  }

  $ret['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);

  return $ret;
}

This should report all the tables rows the code is changing. If the listed rows don't match with the rows effectively present in the table, then something is not working well.

SamDa’s picture

Good news: I finally got the update to 6.x-1.11 working.
I deleted the entries in the nodewords Other pages area ("admin/content/nodewords/meta-tags/other"). After that, the update to 6.x-1.11 showed no problems any more.

By the way, here is the information from a failed update you asked for (this is from the update I did before the working one). Perhaps it is helpful for others with similar problems:

Database structure nodewords_custom

	Field name 	Type 	Allow nulls? 	Key 	Default value 	Extras
	pid 	int(11) 	No 	Primary 	NULL 	auto_increment
	path 	varchar(255) 	No 	None 		
	weight 	tinyint(4) 	No 	None 	0 	
	enabled 	tinyint(4) 	No 	None 	1 	
	name 	mediumtext 	No 	None 	

Database data nodewords_custom

	pid 	path 	weight 	enabled 	name
	1 	restaurants		 		0 	1 	Custom page #0
	2 	veranstaltung	 		0 	1 	Custom page #1
	3 	besonderes_erlebnis 	0 	1 	Custom page #2
	4 	rezepte 				0 	1 	Custom page #3
	5 	camping_zelten	 		0 	1 	Custom page #4
	6 	kleinanzeigen		 	0 	1 	Custom page #5
	7 	pkws	 				0 	1 	Custom page #6
	8 	immobilien		 		0 	1 	Custom page #7
	9 	jobs	 				0 	1 	Custom page #8
	10 	inserate 				0 	1 	Custom page #9
	11 	shop 					0 	1 	
	12 	galerie 				0 	1 	
	13 	ausflug_kinder 		0 	1 	
	14 	ausflug_kirche 		0 	1 	
	15 	ausflug_seen 		0 	1 	
	16 	ausflug_bad 		0 	1 	
	17 	ausflug_freibaeder 	0 	1 	
	18 	ausflug_therme 		0 	1 	
	19 	ausflug_burg 		0 	1 	
	20 	ausflug_wandern 	0 	1 	
	21 	ausflug_museum 	0 	1 	Custom page #10
	22 	ausflug_rad 		0 	1 	Custom page #11
	23 	ausflug_park 		0 	1 	Custom page #12
	24 	ausflug_strassen 	0 	1 	Custom page #13
	25 	ausflug_zoo 		0 	1 	Custom page #14

Error log

Update #6151

    * UPDATE {nodewords_custom} SET name = 'Custom page #0' WHERE pid = 1
    * UPDATE {nodewords_custom} SET name = 'Custom page #1' WHERE pid = 2
    * UPDATE {nodewords_custom} SET name = 'Custom page #2' WHERE pid = 3
    * UPDATE {nodewords_custom} SET name = 'Custom page #3' WHERE pid = 4
    * UPDATE {nodewords_custom} SET name = 'Custom page #4' WHERE pid = 5
    * UPDATE {nodewords_custom} SET name = 'Custom page #5' WHERE pid = 6
    * UPDATE {nodewords_custom} SET name = 'Custom page #6' WHERE pid = 7
    * UPDATE {nodewords_custom} SET name = 'Custom page #7' WHERE pid = 8
    * UPDATE {nodewords_custom} SET name = 'Custom page #8' WHERE pid = 9
    * UPDATE {nodewords_custom} SET name = 'Custom page #9' WHERE pid = 10
    * UPDATE {nodewords_custom} SET name = 'Custom page #10' WHERE pid = 21
    * UPDATE {nodewords_custom} SET name = 'Custom page #11' WHERE pid = 22
    * UPDATE {nodewords_custom} SET name = 'Custom page #12' WHERE pid = 23
    * UPDATE {nodewords_custom} SET name = 'Custom page #13' WHERE pid = 24
    * UPDATE {nodewords_custom} SET name = 'Custom page #14' WHERE pid = 25
avpaderno’s picture

I don't understand why the rows with pid between 11, and 19 where not updated. This seems really strange.

avpaderno’s picture

Version: 6.x-1.3-alpha2 » 6.x-1.11
Category: support » bug
Status: Postponed (maintainer needs more info) » Fixed

I changed the code executed in the update function, and committed the new code in CVS.

Thanks for your report, and your help.

Status: Fixed » Closed (fixed)

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

stella’s picture

Status: Closed (fixed) » Needs work

The fix committed in this patch introduces a critical bug. There is now a SQL error on line 972 of the install file as the "where" keyword appears twice.

"SELECT * FROM {nodewords_custom} WHERE name = '' WHERE pid > %d ORDER BY pid ASC"

cheers,
Stella

avpaderno’s picture

Status: Needs work » Fixed

Thanks for pointing out this. I have fixed the query, and committed the new code in CVS.

Status: Fixed » Closed (fixed)

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