Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is a recurrent problems for me, and it may or may not be module-specific as it also happenes with Views (but only those two, so far).
I get this error by:
-Download fresh install of Drupal and set i up
-install Views
-install Backup and Migrate.
Now if I try 'drush cc all' I get this error:
Fatal error: Cannot redeclare class backup_migrate_destination_db in /Users/henrikakselsen/sites/drupal-7.8/sites/all/modules/backup_migrate/includes/destinations.db.inc on line 294
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Cannot redeclare class backup_migrate_destination_db in
/Users/henrikakselsen/sites/drupal-7.8/sites/all/modules/backup_migrate/includes/destinations.db.inc, line 294
Macintosh:drupal-7.8 henrikakselsen$ mate /Users/henrikakselsen/sites/drupal-7.8/sites/all/modules/backup_migrate/includes/destinations.db.inc
I've seen a lot others having this issue, but mostly with Views. There seems to be a duplicate call to declare classes somewhere in the system, but I'm hardpressed to know where to start the troubleshoot on this one. I'll post an update if I make progress on it.
Comment | File | Size | Author |
---|---|---|---|
#29 | backup_migrate-n1305254-29.patch | 784 bytes | DamienMcKenna |
Comments
Comment #1
henrikakselsen CreditAttribution: henrikakselsen commentedActually, I don't even need to install Views to get the error message. A clean Drupal-install + backup migrate is enough to get the error on a drush cc all.
Comment #2
ohthehugemanatee CreditAttribution: ohthehugemanatee commentedThank goodness - I thought I was the only one.
Oddly enough, this only happens when I enable backup_migrate with drush. I can enable it just fine through the GUI, which makes me suspect something wrong with the php configuration drush is using.
Comment #3
alesr CreditAttribution: alesr commentedIs there a known solution for this?
I also have this issue with drush and backup and migrate module, but didn't experienced it in the first 3-4 weeks using both modules together.
Doing 'sudo drush cc all' works, but it's not the best soulution, you know.
Comment #4
henrikakselsen CreditAttribution: henrikakselsen commentedTry to use sudo with all your drush commands to see if that does the trick. Similar discussion here: http://drupal.org/node/1296594
Comment #5
jwilson3Sudo works for me, very annoying. So much so that I've created a bash alias for my .bashrc file.
Comment #6
Danny EnglanderI've had my dev site up and running using Drush for weeks and never had this issue until today when I updated a single module on my site, Entity Translation. After I updated that module, I started to experience the issue described here. I am just wondering if anyone else here is using that module? I can use
sudo drush cc all
but get asked for my password every time.Comment #7
jwilson3Update to my previous comment #5, the alias for sudo was so annoying that I tracked down the root cause of the issue (in my case) to be the capitalization of the project folder I was working in. I changed the faulty capitalization and the problems went away.
Note that there are a couple different reasons this could be happening. Another one includes having the same module located in two different places within a single Drupal installation. Both of these issues are discussed on #644126: drush loads duplicate command files.
Comment #8
ronan CreditAttribution: ronan commentedAHA! A solution. Thanks @jwilson3.
Everybody having this issue please read #7 and the post it links to.
Comment #9
Danny EnglanderAs far as the capitalization of the project folder name goes, simply changing it to lowercase is not an option for me as the name of my folder derives from the Git Repo name which happens to be capitalized. I do not have any duplicated modules either but as I mentioned I did not have this issue until I updated Entity Translation. I suppose I should try to dig in to that and perhaps file an issue there if I have time to run some definitive tests.
Comment #10
ohthehugemanatee CreditAttribution: ohthehugemanatee commentedReporting that this issue still exists. I have a capital letter in the name of the folder ABOVE my project folder (~/Sites/sitename), and no duplicate module folders anywhere. I only seem to have this problem on my local install (MAMP), but then I don't use drush directly on the dev server very often so it's possible it's there as well. Anyway, a capital letter in a folder name is a stupid reason to break so badly...
If you're really frustrated, you can comment out the offending function from backup/migrate. The problem comes from backup_migrate_destination_db, which is the province of /includes/destinations.db.inc . It provides the ability to backup directly to another database, ie a database that exists solely for keeping your backup. A more specific version is /includes/destinations.db.mysql.inc , which does the same when the backup holding DB is a mysql db. Nice and convenient, but for those of us who just use this module for convenient DB/filesdir downloads, it's not critical. comment out lines 55-68 of includes/destinations.inc (or just apply the attached patch), and you lose the error. It's not a real fix, but it solves the problem for now.
EDIT: Or just read the linked thread above ( http://drupal.org/node/1296594#comment-5443454 ), and learn that the problem is MAMP using a different version of PHP than Drush... which is a problem in your environment that should be fixed anyway.
Comment #11
kenorb CreditAttribution: kenorb commentedComment #12
kenorb CreditAttribution: kenorb commentedComment #13
kenorb CreditAttribution: kenorb commentedComment #14
kenorb CreditAttribution: kenorb commentedBacktrace:
Comment #15
liza CreditAttribution: liza commentedam getting the same error message as #14 when i run cron from the site. no errors when i run it from drush. am on Drupal 7.23 and BAM 7.x-2.7.
Comment #16
idiaz.ronceroSame error here with Drush, MAMP and Mac, even if I aplied many of the suggested solutions:
This is only FYI and to help identify the causes of the problem. I tried many things but I have no clue.
Comment #17
amcc CreditAttribution: amcc commentedIf you're on a mac you are probably running your site from within the Sites directory which has a capital S.
My problem stemmed from not typing a capital s when cd'ing into the site directory
so 'cd ~/sites/mysite.dev' gave me errors
but 'cd ~/Sites/mysite.dev' fixed it
Comment #18
heathergaye CreditAttribution: heathergaye commentedThankyou, #17! Worked for me. How on earth did you work that out??
Comment #19
amcc CreditAttribution: amcc commentedJust swore at the computer a lot and tried to work out where the hell i had a capital (as mentioned above). I think this might be the root of quite a few issues here.
Comment #20
jaymallison CreditAttribution: jaymallison commentedlol @#17 - I was in sites instead of Sites as well. Ridiculous.
Comment #21
jwilson3#17++ Yes. the question is why is drush case sensitive on an os that is case insensitive.
Comment #22
BassPlaya CreditAttribution: BassPlaya commented#17 doesn't work for me. I'm using: /Users/Me/Sites/www.d7sandbox.dev
I've disabled backup_migrate, uninstalled it, tossed the entire directory out, downloaded it and then enabled it through the Drush command "drush en backup_migrate".
This gave me the following error:
Comment #23
jwilson3On my machine, it is /Users/me (lowercase).... maybe this makes a difference?
Comment #24
BassPlaya CreditAttribution: BassPlaya commented@jwilson3 not really as I changed my own name in the code above to 'Me' simply for privacy reasons.
I have backup_migrate installed on a sandbox site and I don't get that error. Maybe it might have to do with 1) the version or 2) an update process which went awry. I'll investigate this a little further and come back to this.
Comment #25
BassPlaya CreditAttribution: BassPlaya commentedcould it be because I'm using drush version: 7.0-dev that I'm still seeing this annoying message? And because of this message, it doesn't allow me to clear my caches, even more annoying.
Any help?
Comment #26
robbdavis CreditAttribution: robbdavis commentedCD into Sites still didn't work for me. Drush 7.0-dev threw the Fatal error listed above. The only fix so far is to rename Sites to sites. If you're looking for an easy way to do that on a Mac, try Path Finder... it's free for 30 days and it's actually a great finder replacement.
R.
Comment #27
Stolzenhain CreditAttribution: Stolzenhain commentedJust so I understand this correctly: cd'ing to lower-cased folders in the OSX terminal doesn't fix the issue as long as you have original uppercase folder filenames?
Comment #28
fb-multimediaI was using a path:
'/users/myaccount/Sites/' in my drush aliases.drushrc.php config.
changed it to :
'/Users/myaccount/Sites/ '
fix the issue.
So check the uppercase and lowercase to be exact on your path.
hope this help.
Comment #29
DamienMcKennaSo it sounds like this is a "works as designed" issue caused by people running Drush commands on a different path than Drupal is using? Or maybe the DRUPAL_ROOT usage in backup_migrate_include_path() should be wrapped around drupal_realpath()?
Comment #30
henrikakselsen CreditAttribution: henrikakselsen commentedComment #31
yog_kulkarni CreditAttribution: yog_kulkarni commentedCheck uppercase and lowercase in your path. I checked the case and gave the exact path. It worked.
Comment #32
couturier CreditAttribution: couturier as a volunteer commentedCan anyone verify if this is still an issue with the 7.x-3.2 version released September 27, 2017?
Comment #33
DamienMcKennaI wonder if #2930316: Refactor module after all class files are listed in info file might help?
Comment #34
DamienMcKennaLets work on #2930316: Refactor module after all class files are listed in info file first.