this message is added to PHP's error.log.

Where do I get that file_scan_directory() function?

Comments

ronan’s picture

Not sure what's going on here, i'll try and take a look at his as soon as I can.

tetramentis’s picture

thanks, let me know how I can assist.

ronan’s picture

This is odd. That function should exist when Drupal is fully bootstrapped and cron should be running under a full bootstrap.

How are you running cron? Are you using poormanscron or running an actual cron job? The only thing I can think of is that poormanscron is running in a partially bootstrapped environment because of caching.

I can easily put an if around the code and kill the error, but I'd like to get to the bottom of this if I can.

Thanks
Ronan

tetramentis’s picture

Priority: Normal » Minor

You are right, I'm using poormanscron.

Thanks for looking into this.

ronan’s picture

Ah, I'll try and reproduce the issue with poormanscron and let you know.

ronan’s picture

hmm.. no luck. I set up poormanscron and ran it runs fine with caching off and not at all when caching is on (is poormanscron supposed to work when caching is on?) but no error either way. I'd like to figure this out rather than just put an if around the code in question, because the code in question cleans up failed backups and I'd rather not disable that if this is a common set up.

Any other ideas as to how to reproduce this? any other modules that might be relevent?

Thanks
Ronan

tetramentis’s picture

Ronan,

I have a multi-site install, with an invalid default configuration (i.e. site1/ and site2/ configurations are correct, but default/ is not).

I've just checked - there are fresh error messages in the log file. However, time of the messages does not match any "cron ran" recent log events.

Both sites have caching enabled ("normal", not "aggressive"), and all other options enabled on the Performance page. Poormanscron is running - I can see event log records. Enabled detailed logging, just in case.

site1 had this message when I navigated to the "Backup and migrate" page:
Created sites/site1/files/backup_migrate/manual directory; clearly the Backup module wasn't configured for site1 previously, only enabled.
I've just temporarily disabled B&M for site1.

Site2 has a single manual backup, with a filename "-2009-01-27T16-29-28.sql.bz", which I had just removed - to see if it was treated as a failed backup and was causing the messages (dash as a first symbol looks strange).

Backup schedules are disabled (set to 0) for both sites.

One more thing: during initial install, I've accidentally put all the non-core modules into /modules, and then just moved non-core modules to /sites/all/modules. Several modules had problems after that, and had to be uninstalled and then installed a-fresh again. I do not remember if B&M had problems after the move.

These modules were active on site2:
administration menu
archive
(core, core additional modules - won't list)
search 404
captcha, ascii art captcha, math captcha, random captcha type
google analytics
voting api
vote up/down
xml sitemap (:engines, :file, :menu, :node)
YUI, YUI calendar
account reminder
backup and migrate
bad behavior
fckeditor
glossary
IMCE
invisimail
meta tags
pathauto
poormanscron
token
weblinks

Thanks!

ronan’s picture

Status: Active » Fixed

Eureka!

I think I have it now. As I suspected, it was a combination of poormanscron and caching. With normal caching, poormanscron runs without Drupal fully bootstrapped, hence the error. I'm now manually bootstrapping during cron to prevent this.

Please grab the most recent dev (as soon as it rolls) and let me know if it fixes the issue.

Thanks for your help and for taking the time to help me figure this out.

R

tetramentis’s picture

Thank you for the package and the fix.

I'm only using stable/recommended versions, but I'll surely report if there will be any problems when I upgrade.

Status: Fixed » Closed (fixed)

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

mecvo1984’s picture

I just received this exact error today on my Drupal 6 installation. New installation. Ran Backup & Migrate afterwards, it ran fine. Next time I went to use the site, got the error. Also running PoorManscron. Any advice suggested, would like to use this module. I have it running fine on my other IIS site, it is set up identically on both sites with identical modules. Thanks.

I just installed the latest June dev roll and got the same error. Is there a way to comment this out somewhere?

ronan’s picture

This is fixed in the latest dev. I'll roll a release as soon as I get a chance, but in the mean time, you can download the dev version as it is very stable.

mecvo1984’s picture

Greetings,

I dl'd the latest dev and installed it. Ran update.php which reported no errors. Immediately afterwards got the same error again. Have disabled the module on that box for now. Running same module (Jan. version) on another identical Drupal installation that uses the same modules and versions.

Both Jan. and June dev modules throw the same php error on this box. Any ideas where I can look to troubleshoot this further?

crutch’s picture

Getting same error 10/30/09. Have server cron running. But let me see if I have both poormanscron and server cron running at same time.

crutch’s picture

Disabled Poormanscron and now error has gone.

- Error was being written to screen on home page only.
- Error was being written to screen even though Error reporting was "Write to log file only".
- Only showed itself after setting up server cron, with Poormanscron enabled. (After setting up server cron, I no longer needed Poormanscron, but forgot to disable it)

crutch’s picture

Status: Closed (fixed) » Needs review
mecvo1984’s picture

Using latest module on this, still have same prob on same server. This server is set up identically to the other with same modules etc. Can't figure out why this server has the prob and the other one (running 4 drupal sites off same codebase) does not. Any ideas where to look? All our drupal sites run on IIS without prob. Need to use backup & migrate w/ poormanscron on this server like we do on the other sites that don't have this prob. For now I'm enabling the module, doing the backup, then disabling it right afterwards so users don't get the error. Not ideal.

ronan’s picture

Version: 6.x-1.2 » 6.x-2.x-dev

Have you tried this with version 2? Version 1.x is slowly falling out of support so if this is fixed in the 2.x branch I'd probably rather call this fixed and move on rather than spinning our wheels on it any more.

crutch’s picture

From my experience it seems that poormanscron is not the optimum cron method to trigger backup and migrate...try to use server cron and disable poormanscron. Backup and Migrate runs all the scheduled jobs for me as expected using server cron but poormanscron seems to fail for scheduled backups.

marse’s picture

06-Aug-2009 01:25:31] PHP Fatal error: Call to undefined function
file_scan_directory() in
/sites/all/modules/backup_migrate/backup_m
igrate.module on line 122

Since August 6th, this error message has been coming up in the logs on the server. I just checked and noticed because a third of my database tables were somehow blown out today. Bluehost, the hosting company, has been unhelpful - as much as I like them, they can sometimes be apathetic.

Could the loss of tables been because of this module? Has this issue been resolved? I'm using poormanscron BTW.

Mark

ronan’s picture

I've never had anybody else report tables being damaged by a backup by this module. It's not likely, since backups are read-only on the db and should not change any of the data, but that's not to say it's impossible. The restore operation overwrites your tables and if it fails it could certainly cause damage but there is no scheduled restore so this error and poormanscron are probably unrelated.

Have your scheduled backups been working? Do you have a working backup to restore from? If half your tables are gone then this may be your only option for recovery. The fatal error you are having effects only the removal of temp files during the post-backup clean up phase so it probably isn't preventing backups from occuring.

I hope this helps.

ronan’s picture

Status: Needs review » Fixed

I think this is all fixed, but let me know if that's not true.

Status: Fixed » Closed (fixed)

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