Menu

#619 Upgrade of existing Data Model hangs with "mysqldump error code 2".

2.0
closed
backup (8)
fixed
Setup/Packaging
major
2.0 beta
defect
2012-11-28
2012-11-20
dguembel
No

When trying to update an existing 1.2.1 data model to 2.0, setup hangs in the step when it makes a copy of the original db.

Please see attached screenshot for the GUI messages; the setup.log says:

2012-11-20 11:09:04 - Info - operation 'async_action', peak memory usage. 3943264
2012-11-20 11:09:05 - Info - operation 'async_action', peak memory usage. 3937584
2012-11-20 11:09:05 - Info - Data file: '/tmp/itop-MHqyIT'
2012-11-20 11:09:05 - Info - Executing command: mysqldump --opt --default-character-set=utf8 --add-drop-database --host='localhost' --user=xxxxx --password=xxxxx --result-file='/tmp/itop-MHqyIT' 'itop_XYZ_staging' 
2012-11-20 11:09:05 - Error - retcode=2

2012-11-20 11:09:05 - Error - An exception occurred: Failed to execute mysqldump. Return code: 2
2012-11-20 11:09:05 - Stack trace:
#0 /var/www/itop20XYZ/web/setup/backup.class.inc.php(87): DBBackup->DoBackup('/tmp/itop-MHqyI...')
#1 /var/www/itop20XYZ/web/setup/applicationinstaller.class.inc.php(409): DBBackup->CreateZip('/var/www/itop20...', '/var/www/itop20...')
#2 /var/www/itop20XYZ/web/setup/applicationinstaller.class.inc.php(180): ApplicationInstaller::DoBackup('localhost', 'root', '[...]', 'itop_XYZ_stagi...', '', '/var/www/itop20...', '/var/www/itop20...')
#3 /var/www/itop20XYZ/web/setup/wizardsteps.class.inc.php(1941): ApplicationInstaller->ExecuteStep('backup')
#4 /var/www/itop20XYZ/web/setup/ajax.dataloader.php(166): WizStepSummary->AsyncAction(Object(ajax_page), 'execute_step', Array)
#5 {main}
2012-11-20 11:09:05 - Info - operation 'async_action', peak memory usage. 3936272

Also, the log contains the DB password in plain text (in the stack trace), that might not be intended?

1 Attachments

Discussion

  • dguembel

    dguembel - 2012-11-20

    Screenshot of setup GUI

     
  • Romain Quetiez

    Romain Quetiez - 2012-11-20
    • keywords backup added
    • milestone set to 2.0

    David,

    Could you please attempt to execute the command as shown in the log (and add the option --verbose).

    We suspect an issue with file permissions (/tmp ?)...

    Regards,
    Romain

     
  • Denis

    Denis - 2012-11-21
    • status changed from new to assigned

    The command line that is lanunched to perform the backup is now in "verbose" mode. All the output goes to the log file for debugging purpose.

     
  • dguembel

    dguembel - 2012-11-21

    The output was:

    -- Connecting to localhost...
    mysqldump: Got error: 1449: The user specified as a definer ('itopstaging'@'%') does not exist when using LOCK TABLES
    

    That said, the DB is from a different system (exported and re-imported via phpmyadmin/mysqldump), so the user that originally created the DB on system A might not exist on the system B where I ran the upgrade.

    (The upgrade went through fine when I simply skipped the "mysqldump" step (and worked around the ItopWelcome problem)).

     
  • Romain Quetiez

    Romain Quetiez - 2012-11-26
    • owner changed from dflaven to etaloc

    Suspected root cause: some views are invalid. Fix: drop them and the setup will rebuild them.

    1) Erwan to reproduce

    2) mysqldump is currently launched with option 'verbose'. This option should be removed from the Setup in 2.0 RC.

     
  • Denis

    Denis - 2012-11-28
    • status changed from assigned to closed
    • resolution set to fixed

    Apparently the problem happens when the MySQL user account that created the views/triggers no longer exists. (Maybe due to a previous export / re-import).

    According to this link: http://dba.stackexchange.com/questions/9249/how-do-i-change-the-definer-of-a-view-in-mysql a possible work-around is to use the flag: --single-transaction to avoid locking issues. So I changed the backup command to add this option.

    Fix committed as revision [2477]

     

Log in to post a comment.