Jump to content
  • 0

Database Backups Not Working.


Timothy

Question

11 answers to this question

Recommended Posts

  • 0

Does your server allow the use of the exec() command?

 

Does your server know where mysqldump is, or do you need to run it with the full path, ie /usr/local/bin/mysqldump? You could edit app/models/backup.php to test that by putting in the full path in the exec command before mysqldump.

Link to comment
Share on other sites

  • 0

Does your server allow the use of the exec() command?

 

Does your server know where mysqldump is, or do you need to run it with the full path, ie /usr/local/bin/mysqldump? You could edit app/models/backup.php to test that by putting in the full path in the exec command before mysqldump.

 

BTW, CORE-136 is scheduled for 3.2.0 and will allow users to specify the path to the mysqldump executable.

Link to comment
Share on other sites

  • 0

Does your server allow the use of the exec() command?

 

Does your server know where mysqldump is, or do you need to run it with the full path, ie /usr/local/bin/mysqldump? You could edit app/models/backup.php to test that by putting in the full path in the exec command before mysqldump.

 

The server does allow the use of exec. In fact it has no disabled functions. The user Blesta is running under does have /usr/local/bin in path and can execute mysqldump binary.

 

Changing the backup.php to hard code the path to mysqldump gets me a step further. Now I get 373 byte backup. Basically the first 10 lines of sql and then it cuts off.

Link to comment
Share on other sites

  • 0

It looks like there are two problems. 

 

Mysqldump was not working with the Blesta database user due to not having lock tables permissions. My previous manual test used a admin user that did have those privileges. Updating the privileges of the Blesta database user to to be able to lock tables fixes the dump with a hard coded mysqldump path.

 

The question I have now is why does it require a hard coded path when mysqldump is in the path environment and works correctly when run as the Blesta server user. Also, are there any other side affects of not have lock tables permissions with Blesta? Perhaps a check when Blesta is installed for the lock tables permission would be useful.

 

In any case, with a hard coded path the issue is solved for the moment.

Link to comment
Share on other sites

  • 0

Sounds to me like the Blesta cron user doesn't have mysqldump set in their environment path variable.

 

As for locks, they're not required at all. The only time it's used is for mysqldump execution, though that's only because your default database setting is to lock tables on a dump. Perhaps a feature request is in order to allow users to choose whether or not to lock on database dump (i.e. mysqldump --single-transaction --quick)?

Link to comment
Share on other sites

  • 0

Perhaps as an addition to CORE-136 you could allow people a place to to add advanced parameters that are then passed directly to mysqldump. I think this is probably a corner case scenario but it might be useful enough considering you already have CORE-136 open.

 

This thread can be marked as solved. It looks like both the issues are server specific and not Blesta at all. Sorry for the noise.

Link to comment
Share on other sites

  • 0

I also had a problem with the environment path but it resulted in the Apache CPU usage shooting up to 100%. I didn't notice anything until I started receiving health monitor alerts from the server. In the end I had to kill the cpu process for the cron job.

Perhaps there needs to be a test of some sorts to prevent this occuring?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...