backdrop-contrib / backup_migrate

Port of the Drupal backup_migrate module to Backdrop
GNU General Public License v2.0
7 stars 14 forks source link

Fatal error "Class 'backup_migrate_destination_filesource' not found" #158

Open jenlampton opened 7 months ago

jenlampton commented 7 months ago

After updating to 1.x-1.0.26 I get a fatal error every time I enable or disable a module or theme:

Error
Class 'backup_migrate_destination_filesource' not found

~This could be related to (or the same as) https://github.com/backdrop-contrib/backup_migrate/issues/145~

Downgrading to 1.x-1.0.25Update available solved the issue.

argiepiano commented 7 months ago

@jenlampton I'm not able to reproduce. Upgrading to 1.0.26 did not produce any issues for me. The release has been out for over 3 weeks, and nobody has reported this (or other) issues.

My guess is that there must be a specific setting or interaction with other contrib modules that's causing this issue for you.

It would be helpful if you posted your site settings found on admin/config/system/backup_migrate/settings. Are there any specific custom destinations in your settings?

EDIT: I don't see how #145 is at all related to this. That issue was about a clumsy UI design.

opi commented 7 months ago

Same here, on a proper LAMP stack on PHP 8.2.16 ;

Downgrade on 1.0.25 as suggested by @jenlampton fix the issue.

opi commented 7 months ago

It should be related to the new implementation of hook_autoload_info() in https://github.com/backdrop-contrib/backup_migrate/compare/1.x-1.0.25...1.x-1.0.26#diff-e13008353617b65df8489186635357d2e81cdea31ba8f4e8a2ca25984dd37716R1972

argiepiano commented 7 months ago

@opi thanks so much for reporting and for the additional info. I'm not able to reproduce the problem, so it's very difficult to troubleshoot. Would you be able to provide more details?

When does this happen Do you see other messages in the log Can you provide a list of the installed contrib modules Can you provide a snapshot of the settings UI page for backup and migrate, to see your profiles, sources and destinations

And if you have the time would you be willing to manually revert the autoload commit and try again to see if that is the culprit?

Thanks

jenlampton commented 7 months ago

It sounds like there is a larger underlying problem with updates. I wonder if fixing https://github.com/backdrop-contrib/backup_migrate/issues/160 would solve this too?

When does this happen

I had it happen on two sites when updating to 1.x-1.0.26. One was running version 1.x-1.0.25, the other was running 1.x-1.0.22.

It happened both on the production server (PHP 7.4.33), and also when I tested PHP 8.2.16 locally.

Do you see other messages in the log

Mostly 404s

Can you provide a list of the installed contrib modules

Site 1, running 1.x-1.0.25 (all the modules below are on the latest versions)

CAPTCHA 
Google Analytics 
Honeypot 
jPlayer 
Nodequeue
On The Web
reCAPTCHA

Site 2, running 1.x-1.0.22 (all the modules below are on the latest versions)

Custom Meta
Footnotes
Google Analytics
Image crop 
Metatag
Views Slideshow 

Can you provide a snapshot of the settings UI page for backup and migrate, to see your profiles, sources and destinations

Screenshot 2024-04-03 at 2 21 40 PM Screenshot 2024-04-03 at 2 25 42 PM
argiepiano commented 7 months ago

I wonder if fixing https://github.com/backdrop-contrib/backup_migrate/issues/160 would solve this too?

Possibly. I'll try to work on this over the weekend

argiepiano commented 7 months ago

@jenlampton thanks for all the details!

You say:

I had it happen on two sites when updating to 1.x-1.0.26. One was running version 1.x-1.0.25, the other was running 1.x-1.0.22. It happened both on the production server, and when running locally.

Is this happening on every page load? update.php call? Cache clearing?

jenlampton commented 7 months ago

Is this happening on every page load? update.php call? Cache clearing?

No, I only saw it on the modules and themes pages. Let me update a site again and see if I can reproduce it on cache clear too.

every time I enable or disable a module or theme

argiepiano commented 6 months ago

@jenlampton @opi, I've been trying to reproduce this problem on and off for the last 2 weeks. I even installed all the contrib modules form @jenlampton "site 2". I overrode the destinations, sources and profiles of backup_migrate. I just can't seem to reproduce, which makes it really hard to debug.

I wonder if you might have a sanitized version of the database of the site that gives you trouble, so that I could use for testing? Also question: is this happening only on those two sites? Have you found this issue on other sites as well? If it's only this site, it may have to do with a specific theme or a contrib module.

argiepiano commented 6 months ago

@jenlampton, @opi: I have a separate issue and PR that replaces all backup_migrate_include() invocations with require_once. This is something that was done years ago in the D7 version.

Can you please apply the patch in #162 to version 1.x-1.0.26 before upgrading from version 25, and test upgrading?

manu-mei-singh commented 6 months ago

Hi All,

We are getting this issue too, but for some reason only on production. We were getting #160 on staging. I resolved this issue on production by deactivating BM before running the DB update 1009 with Bee. Afterwards I re-activated BM, and it seems like it's running ok (as of now). We did the Backdrop before updating BM.

I am not sure if this deactivate/activate BM before/after the update is the best fix...

argiepiano commented 6 months ago

@manu-mei-singh can you please try applying the patch in #162 and try the upgrade again? This would help immensely, as I have still not been able to reproduce this problem.

manu-mei-singh commented 5 months ago

Hi @argiepiano, Apologies for the delay, other things came up. But I finally had time to give this a try!

What I've tried: update production to backup_migrate 1.x-1.0.26 used CLI Bee to to run bee updb got the following error:

Warning: Cannot modify header information - headers already sent by (output started at /files/bee/commands/update.bee.inc:73) in backdrop_send_headers() (line 1646 of /production/public/core/includes/bootstrap.inc).

Error: Class 'backup_migrate_destination_filesource' not found in require_once() (line 13 of /production/public/modules/backup_migrate/includes/BackupMigrateFilesDestinationDbConfigSource.inc

I wasn't sure about patching up a whole folder, so I downloaded a zip of backup_migrate-1.x-1.x-issue-161 and then replaced the file of production/public/modules/backup_migrate/ with backup_migrate-1.x-1.x-issue-161

got the same error: Warning: Cannot modify header information - headers already sent by (output started at /files/bee/commands/update.bee.inc:73) in backdrop_send_headers() (line 1646 of /production/public/core/includes/bootstrap.inc).

Error: Class 'backup_migrate_destination_filesource' not found in require_once() (line 13 of /production/public/modules/backup_migrate/includes/BackupMigrateFilesDestinationDbConfigSource.inc

things I will try next Deactivate backup_migrate and rerun the update.

manu-mei-singh commented 5 months ago

Actually @argiepiano , it's probably more useful if I roll it back to the previous version of Backup_migrate. beyond that I'll wait to hear from you before I proceed

argiepiano commented 5 months ago

Thanks for trying @manu-mei-singh. It's good to know you tried the update with bee. The error about the headers is strange - not sure if this is related to bakcup_migrate.

Are you on Backdrop 1.28.0? If so, can you go to admin/reports/debug in your site and paste here the debug information? It'd be helpful to know that so that I can try to reproduce the issue.

argiepiano commented 5 months ago

@manu-mei-singh also please let me know your "sources" and "destinations" configurations for BM. Do you have a custom source / destination? Have you overridden the ones provided by default?

argiepiano commented 3 months ago

@manu-mei-singh, I think I have found the culprit. I've merged two PRs into the dev branch. Can you please test?

Working on a development version of your site (NOT the production one)

  1. Download the dev branch from here: https://github.com/backdrop-contrib/backup_migrate/archive/refs/heads/1.x-1.x.zip
  2. Unzip and rename the folder as backup_migrate
  3. Remove the backup_migrate folder currently found in the modules and and move the one you download above into modules

After that, clear caches of your site, and try to reproduce the error. You may need to run update.php again if you previous version of BAM was 1.x-1.0.25

argiepiano commented 2 months ago

Pinging @jenlampton, @opi and @manu-mei-singh to see if any of you can test the dev branch. I believe I've fixed the OP, but I can't really tell since I was never able to reproduce the issue. If you could test the dev branch following the instructions pasted above, I will really appreciate it, so that I can make a new release.

manu-mei-singh commented 2 months ago

Hi @argiepiano , I'll see if I can do this this week ( apologies for being incommunicado...vacation, life and COVID)

manu-mei-singh commented 2 months ago

Hi @argiepiano I created a clean Backdrop install on a staging server. I downloaded BAM 1.x-1.0.25. I followed the instructions in the previous note...downloaded the dev branch and ran bee updb no issues at all, but I wasn't able to recreate the earlier issue either.

I don't think I'll have a chance to try to reproduce the issue on an existing project for a few weeks or even at all (where I can roll back to a previous commit) as I'll be working on other projects.

Sorry I couldn't be more helpful at the moment. I'll keep you posted if anything changes and thanks for all your work on this!!!

argiepiano commented 2 months ago

@manu-mei-singh thanks for trying and reporting!