0

Everything was working fine with my site so i figured i had all my permissions correct. Modules work, cron jobs work, logs work in var/log, database backup creation works.

Now i'm trying to roll a 2.3 site back from a backup and i'm getting this error in the admin interface:

You need more permissions to perform a rollback.

No hints were found in debug.log, system.log or exception.log even though all those files have content from previous issues generated while testing the site.

I also tried the command line options from docs here and got the error:

The rollback file is invalid. Verify the file and try again.

$ bin/magento info:backups:list

Showing backup files in /var/www/html/magento/var/backups.
+----------------------------------+-------------+
| Backup Filename                  | Backup Type |
+----------------------------------+-------------+
| 1546537915_media_Test.tgz        | media       |
+----------------------------------+-------------+

$ bin/magento setup:rollback -m 1546537915_media_Test.tgz
Enabling maintenance mode
You are about to remove current code and/or database tables. Are you sure?[y/N]y
Do you want to keep the backups?[y/N]y
The rollback file is invalid. Verify the file and try again.
Disabling maintenance mode

Another attempt where i performed the backup and the restore from the terminal:

filesystemuser $ bin/magento setup:rollback -m 1549047605_filesystem_media.tgz
Enabling maintenance mode
You are about to remove current code and/or database tables. Are you sure?[y/N]y
Do you want to keep the backups?[y/N]y
RecursiveDirectoryIterator::__construct(/var/www/html/magento/var/export): failed to open dir: Permission denied

filesystemuser $ ls -al var/
total 64
drwxrwsr-x 10 filesystemuser  www-data 4096 Feb  1 14:04 .
drwxrwxr-x 15 filesystemuser  www-data 4096 Jan 14 12:40 ..
drwxrwx---  2 filesystemuser  www-data 4096 Feb  1 14:02 backups
drwxrwsr-x 19 filesystemuser  www-data 4096 Jan 14 12:42 cache
drwxrwsr-x  3 www-data www-data 4096 Aug 31 18:38 composer_home
d-wxr-sr-T  3 filesystemuser  www-data 4096 Jan  1 00:00 export
-rw-rw-r--  1 filesystemuser  www-data  126 Jan  4 16:59 .htaccess
drwxrwsr-x  2 www-data www-data 4096 Jan  7 09:43 log
drwxrwsr-x 12 filesystemuser  www-data 4096 Jan 23 19:13 page_cache
-rw-rw-r--  1 www-data www-data  255 Jan  4 18:01 resource_config.json
-rw-rw-r--  1 filesystemuser  www-data 6453 Feb  1 14:04 .setup_cronjob_status
drwxrwsr-x  2 www-data www-data 4096 Jan 15 17:24 tmp
-rw-rw-r--  1 filesystemuser  www-data  148 Feb  1 14:04 .update_cronjob_status
-rwxrwxrwx  1 filesystemuser  www-data  398 Jan 26 17:17 .update_status.txt
drwxrwsr-x  3 www-data www-data 4096 Jan 14 12:43 view_preprocessed

filesystemuser $ ls -al var/export/
ls: cannot open directory 'var/export/': Permission denied

Note the sticky bit setup by magento on the export directory and the owner and user are the same. What the papajohns???

/var/log/syslog has clues after trying web GUI again: Feb 1 14:26:49 magento_sys1 Magento[26545]: main.INFO: You need write permissions for: /var/www/html/magento/var/export/email, /var/www/html/magento/var/export [] []

That suggest the docs for setting up permissions are wrong. Even if permissions setup improperly, the following command does not help: cd /var/www/html/magento2 && sudo find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} + && sudo find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} + && sudo chown -R :apache . && sudo chmod u+x bin/magento . Permissions checked out perfecly during installation wizard and no problems while developing store. I only ran into problems trying to use backup and restore in magento v2.3.0.

What else needs to be done to roll back from a backup in magento 2.3?

The docs say the following for magento 2.3.0:

Deprecation Notice! Magento backup features are deprecated as of v2.3.0. We recommend that all merchants investigate additional backup technologies and binary backup tools (such as Percona XtraBackup).

If it's deprecated as of v2.3.0, why do the docs specifically for v2.3.0 support it and the feature still in the interface?

  • You checked the Magento logs, but are there any errors in the PHP or Apache logs? – andyjv Feb 1 at 19:04
  • @andyjv didn't see any in Apache (which i guess also has php logs in ubuntu 18.04LTS server ???). Checked apache error logs for last 2 days...nothing related. Do you know if backups is going away completely even in terminal? – learnsomemore Feb 1 at 19:21
  • Temporary work around for the problem is to just chmod -R 777 . from magento root directory. That is a bad solution for production and more permissible than magento docs suggest but works for getting more testing done. – learnsomemore Feb 1 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.