Closed (duplicate)
Project:
Drush
Version:
7.x-5.8
Component:
Core Commands
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Apr 2011 at 23:35 UTC
Updated:
22 Jul 2013 at 23:33 UTC
I've searched and searched, and wrapped my head around site aliases, but I keep hitting a wall.
When I run:
drush sql-sync @dev @live
I get the following output:
Load alias @live [notice]
Load alias @dev [notice]
Load alias @live [notice]
Load alias @dev [notice]
Load alias @live [notice]
Error: no database record could be found for @dev [error]
Command dispatch complete
Attached is my aliases.drushrc.php
Both of the following commands return the status of both fully working Drupal 6 installs:
drush @live status
drush @dev status
So then can anyone suggest what might be wrong? Why am I getting this error when I try to sql-sync:
Error: no database record could be found for @dev
Thanks for any help!
| Comment | File | Size | Author |
|---|---|---|---|
| aliases.drushrc.php_.txt | 1.06 KB | wOOge |
Comments
Comment #1
greg.1.anderson commentedPlease try with 5.x-HEAD and see if it works for you there; I reproduced your setup on master, and had no troubles.
If you get the same result, also try:
drush @live sql-conf --alldrush @dev sql-conf --alldrush sa @live --show-passwords --with-dbdrush sa @dev --show-passwords --with-dbThe --show-passwords is optional, of course.
When you define your database record inside your site alias, then drush will use the record you provided, and will not attempt to look up the db record on the remote (or local) site. Therefore, you should never get the "no database record could be found for..." error when you have your db record defined in your alias.
That's the theory, anyway. It would be interesting to know why that code path is being run on your system. Do you have any other aliases.drushrc.php files anywhere on your system? Anything that might define another copy of @live or @dev? Try
drush sato see a list of all of the aliases drush knows about.Comment #2
wOOge commentedThanks for the help, but still no dice — I installed the latest 5.x-dev and commented out the database records in my site alias. I searched my dev box for any other aliases.drushrc.php, but found no other. I then ran the following commands on the dev box:
Ran each of the following commands separately and they each came back with:
Ran each of the following commands separately and they each came back nearly identical output (save for the different live and dev environments):
All with the same result:
Does the sql-dump directory and file have to have special permissions? Could that be the issue?
I'm using D7 and XAMPP on Mac OS X for @dev and an Ubuntu LAMP for @live.
Thanks again for your help with this!!
Comment #3
wOOge commentedComment #4
greg.1.anderson commentedDrush does the equivalent of
drush @dev sql-conf --allto find the database record for your site, unless the database record is already present in the alias, in which case you should never get the error you're seeing.Could you post the output from your sql-sync command with the --debug flag included?
Comment #5
wOOge commentedHmm... strange. Ok here is the output for
drush sql-sync --debug @dev @liveYou can see that @dev and @live get read twice for some reason... could that be a symptom?
Comment #6
greg.1.anderson commentedNot enough info in the debug output; too bad. You'll have to dig deeper; unfortunately, this is working on my machine, so it's hard to say what the failure point is.
Comment #7
wOOge commentedCorrection I'm using D6 in this instance — too many sites on the go ;)
Comment #8
wOOge commentedOk I did some digging. It seems that
$source_db_urlandtarget_db_urlinsidesync.sql.inc, starting at line 144are not getting any values passed to them from reading the aliases file.If I hard code the values:
It seems to work and I get the
"You will destroy data from 1/1 and replace with data from 1/1"etc…However there is a warning about using
"temporary files to store and transfer sql-dump"— which is strange because I've defined these inside my aliases file as well — so something else is not getting passed.After hitting "Y" to try the sync, I get the following:
Now that all said, if I do a
drush status @liveit's able to connect to live and give me the full status back, so it's not a connection issue. It seems variables are not getting passed to the sync function, that are getting passed to other functions.My limited knowledge of drush is limiting my ability to diagnose any farther.
Any of this help? — using drush to sync sites would save so much time over the db dumps and gzip uploads every week.
I really appreciate your time and help!!
Comment #9
greg.1.anderson commentedShouldn't matter which version of Drupal you use here; I'm still on d6 for most of my sites too.
Comment #10
greg.1.anderson commentedDup of #1085890: Deceptive error message when alias record not found: "no database record could be found for @site".
Comment #11
Sree12 commentedHi,
I am having the exactly same issue wOOge is having .Can anyone please guide if you have solved the same.Its very urgently needed.
Thanks
Comment #12
greg.1.anderson commentedThis is a dup of a fixed issue, so try with the latest version of Drush. Asking questions in closed issues is inadvisable, because it takes a bit of luck for anyone to see your question.
Comment #13
artis commentedIn case anyone is looking here for any answer. I got this error message on a non-root shell user because I didn't sudo.