Closed (fixed)
Project:
Drush
Version:
All-versions-3.1
Component:
PM (dl, en, up ...)
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
19 May 2010 at 15:59 UTC
Updated:
22 Nov 2010 at 23:10 UTC
Hi,
When I try to update, I get the following errors:
WD php: rename(): The first argument to copy() function cannot be a directory in [error]
/[path to drush]/includes/drush.inc on line 581.
WD php: [error]
rename(/[path to drupal]/sites/all/modules/admin_menu,/[path to drush]/backup/modules/20100519114134/admin_menu):
Success in /[path to drush]/includes/drush.inc on line 581.
Failed to backup project directory /[path to drupal]/sites/all/modules/admin_menu to [error]
/[path to drupal]/backup/modules/20100519114134/admin_menu
rename(): The first argument to copy() function cannot be a directory in [warning]
/[path to drush]/drush/includes/drush.inc on line 581.
rename(/[path to drupal]/sites/all/modules/admin_menu,/[path to drupal]/backup/modules/20100519114134/admin_menu):[warning]
Success in /[path to drush]/drush/includes/drush.inc on line 581.
An error occurred at function : drush_pm_updatecode [error]
WD php: array_merge(): Argument #2 is not an array in /[path to drush]/commands/pm/updatecode.pm.inc [error]
on line 210.
array_merge(): Argument #2 is not an array in /[path to drush]/commands/pm/updatecode.pm.inc on line [warning]
210.
An error occurred at function : drush_pm_update
I'm just running "drush up". There are two modules to update, admin_menu and save_as_draft. The backup directories do get created. If I choose the modules individually, I get the same respective errors.
This is my first time using drush for updating, so I'm not sure if I'm doing something wrong. This is a Red Hat linux server, php 5.2.10. I'm running the command from the Drupal root.
Comments
Comment #1
j0rd commentedsame issue, but php 5.3
" array_merge(): Argument #2 is not an array in /usr/src/drush/commands/pm/updatecode.pm.inc on line[warning]
210."
Comment #2
j0rd commentedupdating title
Comment #3
tribe_of_dan commentedDrush pm-update doesn't work for me either!
subscribe
Comment #4
moshe weitzman commentedfile permissions?
Comment #5
tribe_of_dan commentedHi Moshe, I'm not sure if its a file permissions thing... what could be cuasing that?
Do I need to check the permissions on some specific files?
this is my error message:
Comment #6
davidhernandezI shouldn't have any file permission problems. I've run it as myself and also root.
Comment #7
greg.1.anderson commentedSorry for not responding earlier, y'all.
This is a limitation of PHP. You'll get it when your backup directory is on a different volume than where the update was downloaded to. That's what the error from rename means in #0. I think there's a dup issue somewhere, but I didn't look for it. I guess I'll mark this 'active' for now.
(n.b.: the error from rename in #5 (with an empty source path) is completely different and unrelated -- no idea what's going on there.)
Comment #8
davidhernandezCan you explain what the limitation is exactly?
Comment #9
davidhernandezI researched a bit the problem with rename(); I see now. I do store the my modules directory on a file server that is mounted on my web server and symbolically linked to in the drupal directory. I copied the modules directory locally to the sites/all/modules directory and the update worked fine. I think I can find a solution from here, if it means I have to move some files around.
Comment #10
moshe weitzman commentedComment #11
kanani commentedSo this is kind of a hack but:
worked for me.
Comment #12
greg.1.anderson commentedYeah, I was originally planning on solving this with rsync, but there is some controversy in that rsync is not always available on Windows. I'm in favor of making rsync a requirement, but I guess a decision one way or the other hasn't been firmly made. It would be possible to do just with php, with extra programming (probably less efficiency too).
Comment #13
davidhernandezThe simplest solution I've found is just specifying the backup directory (--backup-dir=). The default is the root of the Drupal install, but I made a backup directory on the same remote server I store my modules, and specify it when I run the command. That works fine, and seems like a proper solution.
Comment #14
davidhernandezActually, now that I think about it (and thinking out loud), is the root of Drupal the best place to put the backups?
Comment #15
greg.1.anderson commentedNo, not best, just simplest.
Comment #16
dpalmer commentedSubscribing
Comment #17
davepoon commentedI am using All-versions-3.1 of drush on Mac.
I have got a similar problem, just couldn't use the "drush up" and "drush upc"
It threw an error like this,
WD php: Notice: Undefined variable: print in pm_update_packages() (line 236 of [error]
/Applications/drush/commands/pm/updatecode.pm.inc).
The examples directory could not be found within the modules directory at [error]
/Applications/MAMP/htdocs/drupal/sites, perhaps the project is enabled but has been deleted from disk.
An error occurred at function : drush_pm_updatecode [error]
WD php: Notice: Undefined index: full_project_path in drush_pm_updatecode_rollback() (line 322 of [error]
/Applications/drush/commands/pm/updatecode.pm.inc).
WD php: Notice: Undefined index: skip_list in drush_pm_updatecode_rollback() (line 322 of [error]
/Applications/drush/commands/pm/updatecode.pm.inc).
WD php: Warning: array_merge(): Argument #2 is not an array in _pm_update_move_files() (line 210 of [error]
/Applications/drush/commands/pm/updatecode.pm.inc).
WD php: Notice: Undefined index: full_project_path in drush_pm_updatecode_rollback() (line 323 of [error]
/Applications/drush/commands/pm/updatecode.pm.inc).
array_merge(): Argument #2 is not an array in _pm_update_move_files() (line 210 of [warning]
/Applications/drush/commands/pm/updatecode.pm.inc).
An error occurred at function : drush_pm_update
I currently just used "drush dl modulename" to manually update/replace the out-dated modules one by one.
Comment #18
stkrzysiak commentedAlthough this comment doesn't directly address the issue at hand, it is the solution that fixed things for me when I saw this error. So I will post in the hope it helps someone someday. Before drush did all my dirty work, I would do a cp -r sites/all/modules from previous sites I had built. I forgot that this copies all files, including .svn directories. Which, turned out to be the 'remote' volumes that drush was trying to access, the repos. So, if anyone has an issue with this error and sees some svn error in drush's output, this is what I did to remove my svn directories(i'm using git now):
find /project_dir -type d -name .svn -exec rm -rf '{}' +
where /project_dir is your drupal directory. Via this site: http://linux.byexamples.com/archives/195/remove-all-svn-directories-at-o...
Comment #19
Ingumsky commentedI had the same error on my Linux machine but I figured out why that occured. And yes, that was file permissions — drush couldn't create and/or use backup directory if launched by ordinary user. When I tried to repeat the same as root it worked flawlessly. Hopefully it helps other users to get rid of this issue.
PS That's my first experience with drush and it works just great. Thank you!
Comment #20
greg.1.anderson commented@jonhattan: you fixed this, yes?
Comment #21
jonhattanThe file permission thing should not happen anymore as backups are now stored in the user home directory, or you can use --backup-dir.
The cross volume thing is the same as #965878: Cross-volume backup failure.