I'm attempting to install and use Migrate module, and whenever I navigate to /admin/content/migrate on my local, I get the following error:

Fatal error: Class 'Database' not found in /Users/steve/Sites/ridethis/sites/all/modules/dbtng/dbtng.module on line 179

On my server, I just get a WSOD. I've verified that the DBTNG module files are all in place.

Thanks.

CommentFileSizeAuthor
#15 install-errors-989466-15.patch598 bytesmikeryan

Comments

mikey_p’s picture

Are you using Autoload 2.0-rc1?

wonder95’s picture

Status: Active » Closed (fixed)

Hmmm, that is listed under Requirements, isn't it?

Installing Autoload 2.0-rc1 fixed the problem.

Thanks.

joachim’s picture

Status: Closed (fixed) » Active

This is broken again with autoload 6.x-2.0.

ludo.r’s picture

I get the same error with with autoload 6.x-2.0

kaynen’s picture

Try rebuilding the theme registry. That worked for me. In my case, using the Devel module, I just used "flush all caches" and the error no longer occurred.

willieseabrook’s picture

I confirm this is still happening on:

migrate-6.x-2.0-rc1
autoload-6.x-2.0
dbtng-6.x-1.0-alpha7

xenophyle’s picture

Subscribing

I should add that clearing the theme registry doesn't work for me. I get the error as soon as I clear the cache and try to go back to the migrate page.

xenophyle’s picture

Some progress:

I printed out the value of $lookup_cache at autoload.module line 184 and saw that the path to dbtng was wrong (sites/all/modules/dbtng instead of sites/all/modules/contrib/dbtng). I think this was the result of moving the dbtng module into the contrib folder after enabling the module, but I can't remember for sure if that's what I did.

I wasn't able to fix this by clearing the cache, since I just kept getting this error everytime I tried to clear the cache, but I disabled the migrate, dbtng and autoload modules and then re-enabled them, and that fixed it.

xenophyle’s picture

Never mind, the error came back after a few minutes.

xenophyle’s picture

I feel like I'm spamming this issue, but one more thing... I don't know if this is a mistake or just something I don't understand, but I notice the .info file uses "files[] =", which is not supported until D7.

joachim’s picture

> the .info file uses "files[] =", which is not supported until D7.

That is what autoload module (branch 2.x) uses to detect classes.

xenophyle’s picture

I really need to be able to use the migrate module and I want to help fix it, but I'm clueless what the autoload and dbtng modules are doing. It looks like dbtng is trying to load DatabaseTasks, but I can't tell where it expects to get it from.
Could someone provide a hint that might help me debug?
Thanks

kristen pol’s picture

Subscribe... I see the error as well with:

autoload 6.x-2.0
dbtng 6.x-1.0-alpha7
migrate 6.x-2.0-rc2

Kristen

mikeryan’s picture

One thing I think people haven't mentioned here is that they're enabling all the modules at one time at admin/build/modules - try enabling one at a time (i.e., first autoload, then dbtng, then migrate and its relations). I finally ran across this (I usually use drush to enable and disable modules one at a time)... I find that if I enable Autoload and DBTNG at the same time (no Migrate), I get "Fatal error: Call to undefined function autoload_registry_update() in /Users/mikeryan/html/migrate62/sites/all/modules/dbtng/dbtng.install on line 9". Actually, I get that enabling all three at once as well... I did the the "Class 'Database' not found" error once, but can't reproduce it now. Anyway, the place to start is dbtng.install...

mikeryan’s picture

Status: Active » Needs review
StatusFileSize
new598 bytes

OK, with this patch I can enable autoload and dbtng, or autoload, dbtng, and the whole bunch of migrate modules, without error. Be sure you have uninstalled (not just disabled) all the relevant modules before trying this.

mikeryan’s picture

Status: Needs review » Needs work

OK, that may work for interactive enabling, but it breaks Migrate simpletests, which die with the "Class 'Database not found" error...

xenophyle’s picture

I had not been enabling them all at once, since I didn't think it was possible to enable a module without first enabling the one(s) it depends on.

mikey_p’s picture

Status: Needs work » Fixed

Committed, thanks. This will be in rc2.

Status: Fixed » Closed (fixed)

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