Hello I am having trouble upgrading the node gallery module on my site. When I try to run the upgrade script it just gets stuck on starting updates.

I have tried to do this from drush and I got an mysql has gone away error.

by now I have a very large number of gallery nodes so maybe this is taxing mysql?

Is there someone will fix the problems in upgrading and then retheme my galleries? I am of course willing to pay for this.

CommentFileSizeAuthor
Screen shot 2011-06-18 at 5.11.05 PM.png16.78 KBdeverman

Comments

justintime’s picture

Well, as a maintainer, I'm very interested in fixing your upgrade issue, and even better, I'll do it for free :) As for re-themeing, I'll let someone else who has more free time help you out there.

My first hunch is that you have so many galleries and images, we're running into the max packet size on MySQL: http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysv....

Some questions:

  1. What is max_allowed_packet set to now, and can you change it?
  2. How many gallery nodes do you have? How many image nodes?
  3. How long does drush run for before MySQL "goes away"?
  4. If you're on Linux, try running time drush -d udpatedb and paste the results here.
dddave’s picture

Status: Active » Closed (cannot reproduce)

No feedback so let's assume this was a one time mishap.

deverman’s picture

Status: Closed (cannot reproduce) » Active

Hi Sorry I should have replied much earlier but sorry I couldn't so here are the answers to your questions:

1. What is max_allowed_packet set to now, and can you change it?

I upped the max allowed packet size to 512MB and it still didn't work:

| max_allowed_packet | 536870912 |

2. How many gallery nodes do you have? How many image nodes?

I have almost 450 galleries

3. How long does drush run for before MySQL "goes away"?
4. If you're on Linux, try running time drush -d udpatedb and paste the results here.

$ time drush -dv updb
Bootstrap to phase 0. [0.03 sec, 2.2 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.03 sec, 2.42 MB] [bootstrap]
Bootstrap to phase 2. [0.07 sec, 5.8 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.07 sec, 5.81 MB] [bootstrap]
Initialized Drupal 6.20 root directory at /var/www/development [0.09 sec, 6.84 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.09 sec, 6.85 MB] [bootstrap]
Initialized Drupal site default at sites/default [0.09 sec, 6.85 MB] [notice]
Found command: updatedb (commandfile=core) [0.17 sec, 7.3 MB] [bootstrap]
Initializing drush commandfile: user [0.17 sec, 7.31 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.17 sec, 7.5 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.29 sec, 12.82 MB] [bootstrap]
Successfully connected to the Drupal database. [0.29 sec, 12.82 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.3 sec, 13.11 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_login() [0.94 sec, 56.44 MB] [bootstrap]
Successfully logged into Drupal as admin (uid=1) [0.97 sec, 56.78 MB] [bootstrap]
The following updates are pending:

node_gallery module
6300 - MAJOR UPGRADE - please don't blindly update from 2.x to 3.x! Your data will migrate, but some of your settings and most of your theming will need to be redone.
6301 - Remove orphaned image nodes in the db
6302 - Set a default navigator sort view
6303 - Update for #997980. Add tags filtering to views selection.
6304 - NG2 didn't add a gallery to the table until it contained images. This update hook gets those empty (or otherwise missing) galleries into the table. http:drupal.orgnode1008006

Do you wish to run all pending updates? (y/n): y
Updating module node_gallery from schema version 6299 to schema version 6304 [13.82 sec, 66.55 MB] [notice]
Running: /usr/bin/php /opt/drush/drush.php --php='/usr/bin/php' --root='/var/www/development' --uri='http://default' updatedb-batch-process '105' '-u' '1' --backend 2>&1 [13.83 sec, 66.62 MB]

Command dispatch complete [2161.06 sec, 85.53 MB] [notice]
Timer Cum (sec) Count Avg (msec)
page 2160.872 1 2160872.47

Peak memory usage was 93.54 MB [2161.06 sec, 85.53 MB] [memory]
WD php: User warning: MySQL server has gone away [error]
query: SELECT * FROM variable in _db_query() (line 149 of /var/www/development/includes/database.mysql.inc). [2161.06 sec, 85.55 MB]
WD php: User warning: MySQL server has gone away [error]
query: UPDATE cache SET data = '', created = 1319361517, expire = 0, headers = '', serialized = 0 WHERE cid = 'variables' in _db_query() (line 149 of /var/www/development/includes/database.mysql.inc). [2161.06 sec, 85.56 MB]
WD php: User warning: MySQL server has gone away [error]
query: DELETE FROM semaphore WHERE value = '6433045834ea3dbd9f2fd67.44022201' in _db_query() (line 149 of /var/www/development/includes/database.mysql.inc). [2161.06 sec, 85.56 MB]

real 36m1.244s
user 6m11.920s
sys 0m7.820s

Let me know if you need anymore info and I will be more responsive this time.

deverman’s picture

Anybody have any advice?

deverman’s picture

New year new reminder that I still haven't been able to get this to work.

deverman’s picture

New year new reminder that I still haven't been able to get this to work.

deverman’s picture

Issue tags: +watchdog, +drush

I have tried to investigate this a bit more but I am having trouble even narrowing down the part of the update script that causes the problem. When I run the following drush command the output follows:

root@www:/var/www/development/sites/all/modules/contrib/node_gallery# drush -vd updb
Bootstrap to phase 0. [0.02 sec, 2.29 MB]                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.03 sec, 2.51 MB] [bootstrap]
Bootstrap to phase 2. [0.07 sec, 6.2 MB]                                                                                                                                                                                          [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.07 sec, 6.21 MB]                                                                                                                                                        [bootstrap]
Initialized Drupal 6.20 root directory at /var/www/development [0.08 sec, 7.24 MB]                                                                                                                                                   [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.09 sec, 7.25 MB]                                                                                                                                                        [bootstrap]
Initialized Drupal site default at sites/default [0.09 sec, 7.25 MB]                                                                                                                                                                 [notice]
Found command: updatedb (commandfile=core) [0.19 sec, 7.7 MB]                                                                                                                                                                     [bootstrap]
Initializing drush commandfile: user [0.19 sec, 7.71 MB]                                                                                                                                                                          [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.2 sec, 7.91 MB]                                                                                                                                                [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.33 sec, 13.23 MB]                                                                                                                                                   [bootstrap]
Successfully connected to the Drupal database. [0.33 sec, 13.23 MB]                                                                                                                                                               [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.33 sec, 13.52 MB]                                                                                                                                                       [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_login() [0.87 sec, 56.98 MB]                                                                                                                                                      [bootstrap]
Successfully logged into Drupal as admin (uid=1) [0.88 sec, 57.33 MB]                                                                                                                                                             [bootstrap]
The following updates are pending:

 node_gallery module                                                                                                                                                                     
 6300 - MAJOR UPGRADE - please don't blindly update from 2.x to 3.x!  Your data will migrate, but some of your settings and most of your theming will need to be redone.                 
 6301 - Remove orphaned image nodes in the db                                                                                                                                            
 6302 - Set a default navigator sort view                                                                                                                                                
 6303 - Update for #997980. Add tags filtering to views selection.                                                                                                                       
 6304 - NG2 didn't add a gallery to the table until it contained images.  This update hook gets  those empty (or otherwise missing) galleries into the table. http:drupal.orgnode1008006 


Do you wish to run all pending updates? (y/n): y
Updating module node_gallery from schema version 6299 to schema version 6304 [10.21 sec, 67.1 MB]                                                                                                                                    [notice]
Running: /usr/bin/php /opt/drush/drush.php --php='/usr/bin/php'  --root='/var/www/development' --uri='http://default' updatedb-batch-process '218' '-u' '1' --backend  2>&1 [10.21 sec, 67.17 MB]                                   [command]
The external command could not be executed due to an application error. [152.58 sec, 67.17 MB]                                                                                                                                    [error]
Including /opt/drush/commands/core/clear.cache.inc [152.6 sec, 67.37 MB]                                                                                                                                                          [bootstrap]

Undefined variable: args_printed drush.inc:1209 [152.6 sec, 67.42 MB]                                                                                                                                                                [notice]
implode(): Invalid arguments passed drush.inc:1209 [152.6 sec, 67.42 MB]                                                                                                                                                          [warning]
Calling drupal_flush_all_caches() [152.6 sec, 67.42 MB]                                                                                                                                                                               [debug]
Undefined variable: may_cache qq_widget.module:13 [152.73 sec, 77.6 MB]                                                                                                                                                              [notice]
WD features: Rebuilding realestate_listings / dependencies. [159.09 sec, 143.57 MB]                                                                                                                                                  [notice]
Undefined index:  strongarm features.module:455 [159.57 sec, 145.42 MB]                                                                                                                                                              [notice]
WD features: Rebuild completed for realestate_listings / dependencies. [159.58 sec, 143.58 MB]                                                                                                                                       [notice]
'all' cache was cleared [160.73 sec, 143.56 MB]                                                                                                                                                                                   [success]
Finished performing updates. [160.73 sec, 143.51 MB]                                                                                                                                                                              [ok]
Command dispatch complete [160.73 sec, 143.47 MB]                                                                                                                                                                                    [notice]
 Timer  Cum (sec)  Count  Avg (msec) 
 page   160.534    1      160533.63  

Peak memory usage was 162.46 MB [160.73 sec, 143.47 MB]                                                                                                                                                                              [memory]

I have tried to add watch dog output code at the beginning of the 6300 update hook but I don't see anything output. Once it starts running the batch process I can't get a handle on where the script is failing.

deverman’s picture

Status: Active » Closed (won't fix)

I have made some progress on this. I might not be completely done but I have found by using the dd() command with the devel module enabled I could see that this upgrade does not respect the use of the batch api and it loops through all the photo gallery nodes. I also noticed that since I used a different node and image field name than the standard module I had to change the update script to use the custom image field name. I am running it now and it might take more than a day since it needs to do a node load for each image node. Am closing this issue because I think I am mostly on the way.