[SolidMean] ForumBackup

[SolidMean] ForumBackup 1.3.01

No permission to download
There are 2 cron processes. One for the database and one for the file system. The database cron will produce one tar.gz file. The file system from will produce one tar.gzfile.

You should only have one tar.gz file if you only ran the database cron.
 
Getting errors recently, the 0 file size one.

Debug error,

Code:
2014-12-20 20:40:33 | INFO | START Database Backup
2014-12-20 20:40:33 | INFO | Created temp config:  /path/backup/.ForumBackup_320bfed.cnf
2014-12-20 20:40:33 | INFO | Running database backup with: mysqldump --defaults-extra-file=/path/backup/.ForumBackup_320bfed.cnf --single-transaction wwefdb | pigz > /var/www/vhosts/wweforums.net/backup/wwefdb_2014-12-20-204033.sql.gz 2>> /path/backup/wwefdb.log
2014-12-20 20:40:57 | INFO | Database backup complete
2014-12-20 20:40:57 | INFO | Deleting old database backups...
2014-12-20 20:40:57 | INFO | No sql backups to delete...
2014-12-20 20:40:57 | INFO | Verified that database backup exists...
2014-12-20 20:40:57 | INFO | Verified that database backup has data...
2014-12-20 20:40:57 | INFO | END Database backup
 
Yes it is, I ran the cron myself.
Think I found the problem. The latest backup that worked was when PHP was being ran as Apache, now it is using fastcgi which creates files/folders with the vhost user. I don't know why it causes a problem though.
 
Could be a permission problem. Make sure the bsck up directory is writable by the vhost user. You may have to set the paths to mysqldump and/or gzip and tar if the vhost user doesn't know where those utilities are.
 
After installing the 1.1.4 update, code backups aren't working for me anymore. Database is fine, but code is no longer backing up. Had hoped that the 1.1.5 would sort it, but no joy.

Server error:

Code backup wasn't created. Run again with debug enabled

  1. SolidMean_ForumBackup_CronEntry_Backup::saveCode()
  2. call_user_func() in XenForo/Model/Cron.php at line 356
  3. XenForo_Model_Cron->runEntry() in XenForo/ControllerAdmin/Cron.php at line 213
  4. XenForo_ControllerAdmin_Cron->actionRun() in XenForo/FrontController.php at line 347
  5. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  6. XenForo_FrontController->run() in /home/mysite/public_html/admin.php at line 13

Debug file reveals

2014-12-26 07:51:42 | INFO | START Database Backup
2014-12-26 07:51:42 | INFO | Turning forum off...
2014-12-26 07:51:42 | INFO | Created temp config: ../MYBACKUPFOLDER/.ForumBackup_adfe165.cnf
2014-12-26 07:51:42 | INFO | Running database backup with: mysqldump --defaults-extra-file=../MYBACKUPFOLDER/.ForumBackup_adfe165.cnf --single-transaction MYSITE_xf | gzip > ../MYBACKUPFOLDER/forumbackup_Friday.sql.gz 2>> ../MYBACKUPFOLDER/forumbackup.log
2014-12-26 07:52:35 | INFO | Database backup complete
2014-12-26 07:52:35 | INFO | Turning forum on...
2014-12-26 07:52:35 | INFO | Deleting old database backups...
2014-12-26 07:52:35 | INFO | No sql backups to delete...
2014-12-26 07:52:35 | INFO | Verified that database backup exists...
2014-12-26 07:52:35 | INFO | Verified that database backup has data...
2014-12-26 07:52:36 | INFO | END Database backup

So up to that point, all ok. Then run code backup manually and I get
2014-12-26 07:53:27 | INFO | START Code Backup
2014-12-26 07:53:27 | INFO | Turning forum off...
2014-12-26 07:53:28 | INFO | Creating the tar file: tar --ignore-failed-read -f /MYBACKUPFOLDER/forumbackup_Friday.code.tar -cP /home/MYSITE/public_html 2>> ../MYBACKUPFOLDER/forumbackup.log
tar: /MYBACKUPFOLDER/forumbackup_Friday.code.tar: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
2014-12-26 07:53:29 | INFO | Compressing the file: gzip /MYBACKUPFOLDER/forumbackup_Friday.code.tar 2>> ../MYBACKUPFOLDER/forumbackup.log
gzip: /MYBACKUPFOLDER/forumbackup_Friday.code.tar: No such file or directory
2014-12-26 07:53:29 | INFO | Code backup complete...
2014-12-26 07:53:29 | INFO | Turning forum on...
2014-12-26 07:53:29 | INFO | Deleting old code backups...
2014-12-26 07:53:29 | INFO | No code backups to delete...
2014-12-26 07:53:29 | ERROR | Code backup wasn't created.

Any ideas on how to sort that?
 
Well, your tar command is failing.
Code:
2014-12-26 07:53:28 | INFO | Creating the tar file: tar --ignore-failed-read -f /MYBACKUPFOLDER/forumbackup_Friday.code.tar -cP /home/MYSITE/public_html 2>> ../MYBACKUPFOLDER/forumbackup.log
tar: /MYBACKUPFOLDER/forumbackup_Friday.code.tar: Cannot open: No such file or directory

Are you using two dots (..) in specifying where your backup directory exists? It appears that way from the debug. I suggest you use the full absolute path to the backup directory.[/Code]
 
Last edited:
Also, you said you had these problems after 1.1.4 was installed, right? If you can send me the unedited debug of both your database and code backup in a PC I'll do some testing.
 
Thanks. You should use the full backup path for the forum directory, but I'm interested in finding out why it worked for version 1.1.3 and not 1.1.4.
 
@SneakyDave
Upgraded my server to PHP 5.6.7 and the backup is falling twice, keeping my forum on closed up mode for hours.

Code:
ErrorException: exec() has been disabled for security reasons - library/SolidMean/ForumBackup/Model/Database.php:23
Generated By: Unknown Account, Saturday at 8:00 PM
Code:
Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(2, 'exec() has been...', '/home/nginx/dom...', 23, Array)
#1 /home/nginx/domains/public/library/SolidMean/ForumBackup/Model/Database.php(23): exec('mysqldump --def...')
#2 /home/nginx/domains/public/library/SolidMean/ForumBackup/CronEntry/Backup.php(222): SolidMean_ForumBackup_Model_Database->backup('mysqldump --def...')
#3 /home/nginx/domains/public/library/SolidMean/ForumBackup/CronEntry/Backup.php(48): SolidMean_ForumBackup_CronEntry_Backup::backupDatabase(Object(SolidMean_ForumBackup_Options), Object(SolidMean_ForumBackup_Helper_Log))
#4 [internal function]: SolidMean_ForumBackup_CronEntry_Backup::saveDatabase(Array)
#5 /home/nginx/domains/public/library/XenForo/Model/Cron.php(357): call_user_func(Array, Array)
#6 /home/nginx/domains/public/library/WhoHasReadAThread/Model/Cron.php(30): XenForo_Model_Cron->runEntry(Array)
#7 /home/nginx/domains/public/library/XenForo/Deferred/Cron.php(24): WhoHasReadAThread_Model_Cron->runEntry(Array)
#8 /home/nginx/domains/public/library/XenForo/Model/Deferred.php(294): XenForo_Deferred_Cron->execute(Array, Array, 7.9999971389771, '')
#9 /home/nginx/domains/public/library/XenForo/Model/Deferred.php(428): XenForo_Model_Deferred->runDeferred(Array, 7.9999971389771, '', false)
#10 /home/nginx/domains/public/library/XenForo/Model/Deferred.php(373): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#11 /home/nginx/domains/public/deferred.php(23): XenForo_Model_Deferred->run(false)
#12 {main}
 
The problem is that your host has disabled the exec() function. That PHP function is required to use this addon.

That requirement is specified in the first post.

But I'll update the addon so that it fails more gracefully. Right now, it only checks for the existence of the function when the addon is installed.
 
Thank. It was possibly caused by my centminmod config.
When I tried to specify the path for pigz which is at /usr/bin/pigz on my server, I got the below error.

Code:
file_exists(): open_basedir restriction in effect. File(/usr/bin/pigz) is not within the allowed path(s): (/home/nginx/domains/public/:/usr/local/lib/php/:/tmp/)

[*]XenForo_Application::handlePhpError()
[*]file_exists() in SolidMean/ForumBackup/Option/BinaryPath.php at line 79
[*]SolidMean_ForumBackup_Option_BinaryPath::verifyGzipOption()
[*]call_user_func_array() in XenForo/DataWriter/Option.php at line 346
[*]XenForo_DataWriter_Option->_validateOptionValuePreSave() in XenForo/DataWriter/Option.php at line 211
[*]XenForo_DataWriter_Option->_preSave() in XenForo/DataWriter.php at line 1446
[*]XenForo_DataWriter->preSave() in XenForo/DataWriter.php at line 1385
[*]XenForo_DataWriter->save() in XenForo/Model/Option.php at line 572
[*]XenForo_Model_Option->updateOptions() in XenForo/ControllerAdmin/Option.php at line 179
[*]XenForo_ControllerAdmin_Option->actionSave() in NodesAsTabs/ControllerAdmin/Option.php at line 7
[*]NodesAsTabs_ControllerAdmin_Option->actionSave() in XenForo/FrontController.php at line 347
[*]XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
[*]XenForo_FrontController->run() in /home/nginx/domains/public/admin.php at line 13
 
Well, the reason for that is that the addon tries to confirm that pigz (or the other command line tools) is in the location you specify, but your host has set some base directory restrictions so that scripts cannot "look" or access files outside of your web path.

I assume, if you're using centminmod, that you're administrating your own server? If so, you can set the open_basedir to the default of "none" in your /usr/local/lib/php.ini

Code:
; open_basedir, if set, limits all file operations to the defined directory
; and below.  This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
; http://php.net/open-basedir
;open_basedir =

If you need to have the open_basedir restrictions, then I'm not sure how to get around that error, other than removing the verification that the compression or gzip tool is available, which might be the only solution.
 
Also, I think you'll have other problems if you have open_basedir restrictions on your host.

If you have that enabled, then you'll have to keep your created backup files in a directory at or below your existing web root, which is probably not something you'd want.

If you tried to store them in a directory outside of your web root, you'll get the same error when the addon verifies that the backup was created and isn't 0 length.
 
This isn't backing up my database properly. I have configured the settings accordingly and when I open the database backup, it's just an empty file.

Screenshot_13-40-57.png


Screenshot_13-41-13.png


Screenshot_13-41-23.png


Screenshot_13-41-47.png


Path is correct:
Screenshot_13-42-00.png
 
Can you send me the contents of of your forum back up.log fine in a PC and I'll take a look.

@xenBoost Mike had a similar situation, that I believe is due to a strange permission issue, but I wasn't able to identify what the real problem was.
 
Back
Top Bottom