There is a fatal error when attempting to backup Entire Site

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zinglooney created an issue. See original summary.

turion’s picture

Happens on my site as well

darragh97’s picture

I have this issue as well

Using WAMP 2.5 Drupal 8.1.2 when I try Backup Source = Entire Site

Mircea Shanti’s picture

Version: 8.x-4.x-dev » 8.x-4.0-alpha1

Any up-dates on this issue?

Tried the quick backup on full site.
Results in:
Fatal error: Call to a member function create() on null in /home/r39491rnba/public_html/artosphere.eu/modules/backup_migrate/vendor/backupmigrate/core/src/Source/MySQLiSource.php on line 48

Also the sheduled one (also full site) results in : Warning: Invalid argument supplied for foreach() in Drupal\Core\Asset\LibraryDiscoveryParser->buildByExtension() (line 133 of /home/r39491rnba/public_html/artosphere.eu/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php). (Message in Log).

luvsharma’s picture

Same error with my Drupal 8 site as well (WampServer Version 3.0.0 64bit)

mgregoire83’s picture

Hi !

I've also this issue when trying to perforl entire site backup.

Message:

Call to a member function create() on null in /modules/backup_migrate/vendor/backupmigrate/core/src/Source/MySQLiSource.php on line 48

Thanks for the solution !

MG

HongPong’s picture

Confirm also having error #6 here.

gplayer01’s picture

I am also getting the same error using backup and migrate with v8.1.8 and my 2 previous versions.

Fatal error: Call to a member function create() on a non-object in /Users/myname/Sites/devdesktop/myname-dev/docroot/modules/backup_migrate/vendor/backupmigrate/core/src/Source/MySQLiSource.php on line 48

rroose’s picture

I'm having this error as well. Just would like to add that it is still possible to create a backup of the database and the public files directory separately as they both function correctly. The error only occurs when making a backup of the entire site.

VitaliyDemchuk’s picture

Same problem. Any solutions?

kingfisher64’s picture

Fatal error: Call to a member function create() on null in modules/backup_migrate/vendor/backupmigrate/core/src/Source/MySQLiSource.php on line 48

When trying to backup site.

Any progress?

samstamport’s picture

I'm getting a similar error message.

"Fatal error: Call to a member function create() on null in C:\UwAmp\www\D8\modules\backup_migrate\vendor\backupmigrate\core\src\Source\MySQLiSource.php on line 48"

I'm using Windows 10 with UwAmp 3.1.0, PHP 5.6.18, and MySQL 5.7.11. Drupal 8.1.8.

Is there a patch for this?

parijke’s picture

same error here

php 7.0.11
mysql 5.6.33
drupal 8.2
bam 8.x-4.alpha1

banacan’s picture

Same for me.

konrad_u’s picture

This issues is related to MySQLi extension not being installed

Robin van Emden’s picture

I have the MySQLi extension installed and enabled but still encounter this fatal error on attempting to backup the "Entire Site". In fact, this error seems to have to do with the object having no knowledge of the getTempFileManager function called in line 48:

$file = $this->getTempFileManager()->create('mysql');

szeidler’s picture

Status: Active » Needs review
FileSize
1.59 KB

The TempFileManager seems to be not available, because the MySQL Source Plugin is not registered properly, when only invoking their class. For that reason I created a hotfix that uses alterBackupMigrate to ensure, that the Plugin is loaded correct. Maybe that would be also possible by defining dependencies in the configuration, but I haven't 100% if that's the right purpose of the dependencies.

Can you please test, if the attached patch fixes it?

Toche’s picture

#17 Didn´t work for me

Drupal core 8.2.5
Mamp pro 3.0.5
PHP 5.5.10
Backup and Migrate 8.x-4.0-alpha1

Backup Source: Entire Site
Backup Destination: Private Files Directory

error: Maximum execution time of 30 seconds exceeded on "/core/lib/Drupal/Core/StreamWrapper/LocalStream.php on line 226"
Changed php.ini
max_execution_time = 60 (and 0 without results)

Then edited sites/default/settings.php and added the following line:
ini_set('max_execution_time', 0);
and it keeps loading for several minutes without any results.

TheodorosPloumis’s picture

#17 and ini_set('max_execution_time', 0); on settings.php solves the issue for me.

Thank you all!

kingfisher64’s picture

patching file EntireSiteSourcePlugin.php
Hunk #1 FAILED at 10 (different line endings).
Hunk #2 FAILED at 25 (different line endings).
Hunk #3 FAILED at 37 (different line endings).
3 out of 3 hunks FAILED -- saving rejects to file EntireSiteSourcePlugin.php.rej

Patch didn't work for me. Would someone be kind enough to upload the patched file here to try?

Thanks

szeidler’s picture

The patch applies cleanly to the current 8.x-4.x-dev release. The alpha-1 shouldn't be used anymore, because couple of essential issues were only fixed in -dev till now.

kingfisher64’s picture

Thanks szeidler for the information in #21 and for the patch in #17. Worked a treat.

Can this be committed?

Zoltán Balogh’s picture

Version: 8.x-4.0-alpha1 » 8.x-4.x-dev
Status: Needs review » Reviewed & tested by the community

#17 works fine.

DeBeukeleerM’s picture

The patch was cleanly applied

$ git apply -v backup_migrate-entire_site_filemanager_missing-2732195-17.patch
Checking patch src/Plugin/BackupMigrateSource/EntireSiteSourcePlugin.php...
Applied patch src/Plugin/BackupMigrateSource/EntireSiteSourcePlugin.php cleanly.

but,
still have the fatal error

Fatal error: Call to a member function create() on null in D:\wamp\www\social\html\modules\backup_migrate\backup_migrate\vendor\backupmigrate\core\src\Source\MySQLiSource.php on line 48

szeidler’s picture

@DeBeukeleerM: Can you check if your MySQLi extension is loaded in PHP?

imrancluster’s picture

After applying the patch I got the following error-

The backup could not be completed because 2 files could not be read: (/RootDir/vendor/drupal/console/bin/php-parse, /RootDir/vendor/drupal/console/bin/psysh).

anyone can tell me why?

Thanks

DeBeukeleerM’s picture

@szeidler
Yes, the extension is enabled

DeBeukeleerM’s picture

The patch #17 worked for me after uninstall 8.x-4.0-alpha1 en install 8.x-4.x-dev (comment #21). Thank You, @szeidler

couturier’s picture

It would be great to move forward with committing this patch. Users are still reporting this problem with the new 8.x-4.0-alpha2 released on April 4, 2017.

couturier’s picture

Priority: Normal » Major

I'm moving this to major because out of all 35 open issues with Backup and Migrate currently, this one is causing failure for more users than any of the others, including with the April 4, 2017, upgrade to 8.x-4.x-alpha2. With this patch having been successfully tested, I think it might be worth pushing a new alpha as soon as possible for this patch alone. At the very least, a link should be added immediately on the download page as a "Known Issue."

I've tried contacting the maintainers directly about this but haven't been able to get responses since April 10 (ronan) and April 11 (dgorton). While I'm not qualified to alter code for the module, I'd be happy to make the documentation updates myself if I had access to the module and download text pages. It would be great to have at least one additional maintainer who could find time to apply existing patches and push a new release, as there are 8 patches sitting in the queue right now.

Also, I have closed and linked to this issue what appears to be a duplicate: Fatal error: Call to a member function alterBackupMigrate() on a non-object

couturier’s picture

Another issue may possibly be a duplicate of this one. If anyone can confirm the "entire site" backup error, then I will close the following issue as a duplicate: PHP 7.1 in MAMP Pro breaks backup.

couturier’s picture

This patch did indeed resolve the problem referenced in Comment #31, so I have closed it as a duplicate. We should commit this patch and roll a new release of Backup and Migrate as soon as possible given how many users are being affected.

  • ronan committed 14cd3c0 on 8.x-4.x authored by szeidler
    Issue #2732195 by szeidler: Fatal error: Call to a member function...
ronan’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the hard work on this. The patch seems to fix the issue. Applied!

ilclaudio’s picture

I've installed the patch #17 on Drupal 8.3.1 and "drupal/backup_migrate": "^4.0@alpha".
When I execute a "Backup now" of all the site (backup destination: Download) it produces some bam* files on the /tmp directory of the server, but the browser downloads an empty tar.gz file.
If I choose as backup destination a local directory of the server the backup works and the produced archive is not empty.

HongPong’s picture

ilclaudio you may need to open a new issue. Also would suggest trying it on 8.3.2 drupal with the latest dev version of this module.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

dean7115’s picture

I am experiencing the same.

Rafael Cansinos’s picture

Drupal core 8.3.7
DirectAdmin 1.51.4 on Centos 7
PHP 5.5.38 Límite de memoria 128M
5.5.41-MariaDB
Apache/2
Backup and Migrate Versión: 8.x-4.0-alpha2

Backup Source: Entire Site
Backup Destination: Download

I got HTTP ERROR 500

szeidler’s picture

The fix was committed after the 8.x-4.0-alpha2 release. So at the moment you would need to use the dev version.

Hong Cai’s picture

#18 one more vote~
In many sudden shutdown cases, the enough time to execute the command matters.