Bladrak/capistrano-rsync

NoMethodError: undefined method `name' for nil:NilClass

strauss69400 opened this issue · 15 comments

hello,

i'm interested by your module.i need to use rsync for deploy my symfony websites.
so i have installed the extension capistrano-rsync and capistrano-rsync-bladrak.

in two cases, i get this error :

cap aborted!
NoMethodError: undefined method `name' for nil:NilClass

Tasks: TOP => rsync:create_release => rsync:release => rsync => rsync:stage_done => rsync:stage => rsync:create_stage
(See full trace by running task with --trace)
The deploy has failed with an error: undefined method `name' for nil:NilClass.

do you known the solution for resolve this problem.
i thank you very much for your help.

Did you try removing capistrano-rsync? It may enter in conflict with capistrano-rsync-bladrak.

yes i uninstalled capistrano-rsync, but i get this error too.
when i use this scm : gitcopy, i don't have problem

Could you run the command with --trace so we get a more verbose output?

it 's done.

in attached files, the trace.txt

thanks

Le 07/10/2015 16:38, Hugo Briand a écrit :

Could you run the command with |--trace| so we get a more verbose output?


Reply to this email directly or view it on GitHub
#18 (comment).

Digit Gold

Alexandre BELLATON
/Developpeur web / Administrateur système/

Email : webdev@digitgold.ch mailto:f.epinat@digitgold.ch
DIGIT GOLD S.A. - I.T. Designer Echichens - SUISSE

λ bundle exec cap production deploy --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke deploy:set_symfony_env (first_time)
** Execute deploy:set_symfony_env
** Invoke deploy (first_time)
** Execute deploy
** Invoke deploy:starting (first_time)
** Execute deploy:starting
** Invoke deploy:check (first_time)
** Invoke rsync:hook_scm (first_time)
** Execute rsync:hook_scm
** Execute deploy:check
** Invoke rsync:check (first_time)
** Execute rsync:check
INFO [b2f35320] Running /usr/bin/env mkdir -pv /var/www/thecore-demo-capistrano/shared/deploy as **@..__.
DEBUG [b2f35320] Command: ( PATH=/usr/local/bin:$PATH SYMFONY_ENV=prod /usr/bin/env mkdir -pv /var/www/thecore-demo-capistrano/shared/deploy )
INFO [b2f35320] Finished in 0.858 seconds with exit status 0 (successful).
** Invoke rsync:check
** Invoke deploy:check:directories (first_time)
** Execute deploy:check:directories
INFO [0ec7a61a] Running /usr/bin/env mkdir -p /var/www/thecore-demo-capistrano/shared /var/www/thecore-demo-capistrano/releases as **@..__.
DEBUG [0ec7a61a] Command: ( PATH=/usr/local/bin:$PATH SYMFONY_ENV=prod /usr/bin/env mkdir -p /var/www/thecore-demo-capistrano/shared /var/www/thecore-demo-capistrano/releases )
INFO [0ec7a61a] Finished in 0.085 seconds with exit status 0 (successful).
** Invoke deploy:check:linked_dirs (first_time)
** Execute deploy:check:linked_dirs
INFO [eaf18f58] Running /usr/bin/env mkdir -p /var/www/thecore-demo-capistrano/shared/app/logs /var/www/thecore-demo-capistrano/shared/web/uploads /var/www/thecore-demo-capistrano/shared/app/logs /var/www/thecore-demo-capistrano/shared/app/cache /var/www/thecore-demo-capistrano/shared/vendor /var/www/thecore-demo-capistrano/shared/web/uploads as **@..__.
DEBUG [eaf18f58] Command: ( PATH=/usr/local/bin:$PATH SYMFONY_ENV=prod /usr/bin/env mkdir -p /var/www/thecore-demo-capistrano/shared/app/logs /var/www/thecore-demo-capistrano/shared/web/uploads /var/www/thecore-demo-capistrano/shared/app/logs /var/www/thecore-demo-capistrano/shared/app/cache /var/www/thecore-demo-capistrano/shared/vendor /var/www/thecore-demo-capistrano/shared/web/uploads )
INFO [eaf18f58] Finished in 0.095 seconds with exit status 0 (successful).
** Invoke deploy:check:make_linked_dirs (first_time)
** Execute deploy:check:make_linked_dirs
** Invoke deploy:check:linked_files (first_time)
** Execute deploy:check:linked_files
** Invoke deploy:set_previous_revision (first_time)
** Execute deploy:set_previous_revision
DEBUG [a945e8c0] Running /usr/bin/env [ -f /var/www/thecore-demo-capistrano/current/REVISION ] as **@..__.
DEBUG [a945e8c0] Command: [ -f /var/www/thecore-demo-capistrano/current/REVISION ]
DEBUG [a945e8c0] Finished in 0.097 seconds with exit status 1 (failed).
** Invoke deploy:started (first_time)
** Execute deploy:started
** Invoke deploy:updating (first_time)
** Invoke deploy:new_release_path (first_time)
** Execute deploy:new_release_path
** Execute deploy:updating
** Invoke rsync:create_release (first_time)
** Invoke rsync:release (first_time)
** Invoke rsync (first_time)
** Invoke rsync:stage_done (first_time)
** Invoke rsync:stage (first_time)
** Invoke rsync:create_stage (first_time)
** Execute rsync:create_stage
cap aborted!
NoMethodError: undefined method name' for nil:NilClass C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.7.1/lib/sshkit/host.rb:29:ininitialize'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.7.1/lib/sshkit/backends/local.rb:10:in new' C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.7.1/lib/sshkit/backends/local.rb:10:ininitialize'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:59:in new' C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:59:inrun_locally'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-rsync-bladrak-1.3.6/lib/capistrano/rsync.rb:167:in block (2 levels) in <top (required)>' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:240:incall'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:240:in block in execute' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:235:ineach'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:235:in execute' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:179:inblock in invoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/monitor.rb:211:in mon_synchronize' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:172:ininvoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:201:in block in invoke_prerequisites' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:199:ineach'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:199:in invoke_prerequisites' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:178:inblock in invoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/monitor.rb:211:in mon_synchronize' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:172:ininvoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:201:in block in invoke_prerequisites' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:199:ineach'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:199:in invoke_prerequisites' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:178:inblock in invoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/monitor.rb:211:in mon_synchronize' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:172:ininvoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:201:in block in invoke_prerequisites' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:199:ineach'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:199:in invoke_prerequisites' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:178:inblock in invoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/monitor.rb:211:in mon_synchronize' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:172:ininvoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:201:in block in invoke_prerequisites' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:199:ineach'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:199:in invoke_prerequisites' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:178:inblock in invoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/monitor.rb:211:in mon_synchronize' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:172:ininvoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:201:in block in invoke_prerequisites' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:199:ineach'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:199:in invoke_prerequisites' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:178:inblock in invoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/monitor.rb:211:in mon_synchronize' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:172:ininvoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:165:in invoke' C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:16:ininvoke'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/tasks/deploy.rake:9:in block (2 levels) in <top (required)>' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:240:incall'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:240:in block in execute' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:235:ineach'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:235:in execute' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:179:inblock in invoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/monitor.rb:211:in mon_synchronize' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:172:ininvoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:165:in invoke' C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:16:ininvoke'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:65:in block (2 levels) in <top (required)>' C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:64:ineach'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:64:in block in <top (required)>' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:240:incall'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:240:in block in execute' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:235:ineach'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:235:in execute' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:179:inblock in invoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/monitor.rb:211:in mon_synchronize' C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:172:ininvoke_with_call_chain'
C:/Ruby22/lib/ruby/2.2.0/rake/task.rb:165:in invoke' C:/Ruby22/lib/ruby/2.2.0/rake/application.rb:150:ininvoke_task'
C:/Ruby22/lib/ruby/2.2.0/rake/application.rb:106:in block (2 levels) in top_level' C:/Ruby22/lib/ruby/2.2.0/rake/application.rb:106:ineach'
C:/Ruby22/lib/ruby/2.2.0/rake/application.rb:106:in block in top_level' C:/Ruby22/lib/ruby/2.2.0/rake/application.rb:115:inrun_with_threads'
C:/Ruby22/lib/ruby/2.2.0/rake/application.rb:100:in top_level' C:/Ruby22/lib/ruby/2.2.0/rake/application.rb:78:inblock in run'
C:/Ruby22/lib/ruby/2.2.0/rake/application.rb:176:in standard_exception_handling' C:/Ruby22/lib/ruby/2.2.0/rake/application.rb:75:inrun'
C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/application.rb:15:in run' C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/bin/cap:3:in<top (required)>'
C:/Ruby22/lib/ruby/gems/2.2.0/bin/cap:23:in load' C:/Ruby22/lib/ruby/gems/2.2.0/bin/cap:23:in

'
Tasks: TOP => rsync:create_release => rsync:release => rsync => rsync:stage_done => rsync:stage => rsync:create_stage
The deploy has failed with an error: undefined method `name' for nil:NilClass
** Invoke deploy:failed (first_time)
** Execute deploy:failed

It seems you are running this command on windows, and capistrano has some issues with it (see http://stackoverflow.com/questions/31533771/sshkits-run-locally-on-windows) :/
Do you have rsync installed on your client?

yes, rsync is installed on my client and on my server.
but why when i use the strategy gitcopy, i have no problem but only i use rsync.

i don't know what i do, I was no longer the same error.
now i get this error :
Tasks: TOP => rsync:create_release => rsync:release
The deploy has failed with an error: no _dump_data is defined for class Enumerator
** Invoke deploy:failed (first_time)
** Execute deploy:failed.

do you have an idea?
thanks

I'm not sure but I think rsync must be installed on the client (here your windows computer), and I'm not sure you can do that :/

hi,
I managed to install rsync on windows Using the cwRsync software.
Rsync commands work well on my windows shell.
I try a deployment and I still have the same error.
When I use only gim' Capistrano -rsync 'in my gemfile i get this error ssh connection.
it's really strange because i use port 4351in my deploy.rb whereas rsync use port 22.

HEAD is now at f03f1f2 debug
HEAD is now at f03f1f2 debug
ssh: connect to host **** port 22: Bad file number
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(235) [sender=3.1.1]
ssh: connect to host *** port 22: Bad file number
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(235) [sender=3.1.1](Backtrace restricted to imported tasks)
cap aborted!

You can use the :rsync_options symbol to add options to your rsync call, hence specifying your connect port. See rsync man page :)

I tried several solutions but it don't work.
What should I use syntax.
i tried that :
set :rsync_options,{
port: '4351'
}
and that:
set :wpcli_rsync_options, '-avz -e "ssh -p 4351"'.

i thank you for your help

Try replacing set :wpcli_rsync_options, '-avz -e "ssh -p 4351"' with set :rsync_options, ['-avz', '-e "ssh -p 4351"']

@strauss69400 did you fix your issue? If so, can we close this?

i failed to debug the problem, so i dropped.i turned to another deployement solution

Ok, sorry it didn't work out :/ I'll close this then, feel free to re-open it if you reproduce this.