Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Net::SCP::Error: SCP No such file or directory #104

Open
map7 opened this issue Dec 14, 2016 · 6 comments
Open

Net::SCP::Error: SCP No such file or directory #104

map7 opened this issue Dec 14, 2016 · 6 comments
Milestone

Comments

@map7
Copy link

map7 commented Dec 14, 2016

When I run capistrano-db-tasks using capistrano 3.7.0 to pull my database with 'cap production db:pull --trace' I get the following error;

Net::SCP::Error: SCP did not finish successfully (1): scp: ./db/vinocellar_production_2
016-12-14-104356.sql.bz2: No such file or directory                                   
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/net-scp-1.2.1/lib/net/scp.rb:3
65:in `block (3 levels) in start_command'                                             
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/net-ssh-3.2.0/lib/net/ssh/conn
ection/channel.rb:607:in `call'                                                       
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/net-ssh-3.2.0/lib/net/ssh/conn
ection/channel.rb:607:in `do_close'                                                   
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/net-ssh-3.2.0/lib/net/ssh/conn
ection/session.rb:614:in `channel_close'                                              
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/net-ssh-3.2.0/lib/net/ssh/conn
ection/session.rb:479:in `dispatch_incoming_packets'                                  
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/net-ssh-3.2.0/lib/net/ssh/conn
ection/session.rb:225:in `preprocess'                                                 
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/net-ssh-3.2.0/lib/net/ssh/conn
ection/session.rb:206:in `process'                                                    
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/net-ssh-3.2.0/lib/net/ssh/conn
ection/session.rb:170:in `block in loop'                                              
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/net-ssh-3.2.0/lib/net/ssh/conn
ection/session.rb:170:in `loop'                                                       
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/net-ssh-3.2.0/lib/net/ssh/conn
ection/session.rb:170:in `loop'                                                       
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/net-ssh-3.2.0/lib/net/ssh/conn
ection/channel.rb:269:in `wait'                                                       
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/net-scp-1.2.1/lib/net/scp.rb:3
21:in `download!'                                                                     
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/sshkit-1.11.4/lib/sshkit/backe
nds/netssh.rb:57:in `block in download!'                                              
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/sshkit-1.11.4/lib/sshkit/backe
nds/connection_pool.rb:61:in `with'                                                   
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/sshkit-1.11.4/lib/sshkit/backe
nds/netssh.rb:155:in `with_ssh'                                                       
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/sshkit-1.11.4/lib/sshkit/backe
nds/netssh.rb:56:in `download!'                                                       
/home/map7/code/capistrano-db-tasks-master/lib/capistrano-db-tasks/database.rb:125:in `
download'                                                                             
/home/map7/code/capistrano-db-tasks-master/lib/capistrano-db-tasks/database.rb:212:in `
remote_to_local'                                                                      
/home/map7/code/capistrano-db-tasks-master/lib/capistrano-db-tasks/dbtasks.rb:41:in `bl
ock (4 levels) in <top (required)>'                                                   
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/sshkit-1.11.4/lib/sshkit/backe
nds/abstract.rb:29:in `instance_exec'                                                 
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/sshkit-1.11.4/lib/sshkit/backe
nds/abstract.rb:29:in `run'                                                           
/usr/local/rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/sshkit-1.11.4/lib/sshkit/runne
rs/parallel.rb:12:in `block (2 levels) in execute'                                    
Tasks: TOP => db:pull => db:local:sync

The work around is to set my db_dump_dir to "/tmp" instead of "./db" as it cannot find this. I would assume that this ./db directory should be relative to my Rails.root path on the production server but it doesn't seem to be working.

@map7
Copy link
Author

map7 commented Dec 14, 2016

Still broken in 0.6

@maxigs
Copy link

maxigs commented Dec 30, 2016

Just wanted to let you know that i had the same issue. Didn't look further in it as the workaround with the tmp directory worked fine.

@itolosa
Copy link

itolosa commented Jan 2, 2017

It worked fine by specifying the entire path:

# deploy.rb
set :db_dump_dir, -> { File.join(current_path, 'db') }

@numbata numbata added this to the v0.7 milestone Jan 2, 2017
numbata added a commit to numbata/capistrano-db-tasks that referenced this issue Jan 2, 2017
@numbata
Copy link
Collaborator

numbata commented Jan 2, 2017

@map7 do you have _APP_PATH_/db directory?
@itolosa can you check this branch https://github.com/numbata/capistrano-db-tasks/tree/issues/104/db_dump_dir_fix ?

@itolosa
Copy link

itolosa commented Jan 2, 2017

@numbata I think the error here is to assume that ./ always points to the project directory, and I think is rancid to replace ./ to the current_path. Maybe a Readme update would be great to avoid more confusions

@kakra
Copy link

kakra commented Sep 22, 2021

This even doesn't seem a problem due to a change in THIS repository. I upgraded some unrelated gems in the bundle when I suddenly got this error. I wasn't able to restore the previous behavior because I only discovered this problem later in development. But at least reverting capistrano itself to the last known working version didn't help, neither did reverting sshkit, net-scp, or capistrano-db-tasks fix the problem. So something else must have changed behavior.

But the problem is probably still within THIS repo as it depends on some non-defined defaults when it shouldn't (e.g., the working directory).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants