anjlab / yandex-disk

Ruby client for Yandex.Disk with backup gem support
MIT License
33 stars 13 forks source link

Faraday::Error::ConnectionFailed: Broken pipe (Errno::EPIPE) #5

Closed dhampik closed 9 years ago

dhampik commented 9 years ago

I'm trying to make a backup with backup and yandex-disk gems, but when it comes to file uploading, I get Faraday::Error::ConnectionFailed: Broken pipe (Errno::EPIPE) error

[2015/05/05 22:53:26][error] Backtrace:
[2015/05/05 22:53:26][error]   /home/backuper/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/openssl/buffering.rb:326:in `syswrite'
[2015/05/05 22:53:26][error]   /home/backuper/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/openssl/buffering.rb:326:in `do_write'
[2015/05/05 22:53:26][error]   /home/backuper/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/openssl/buffering.rb:344:in `write'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/excon-0.44.4/lib/excon/socket.rb:268:in `write_block'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/excon-0.44.4/lib/excon/socket.rb:80:in `write'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/excon-0.44.4/lib/excon/connection.rb:166:in `request_call'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/excon-0.44.4/lib/excon/middlewares/mock.rb:47:in `request_call'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/excon-0.44.4/lib/excon/middlewares/instrumentor.rb:22:in `request_call'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/excon-0.44.4/lib/excon/middlewares/base.rb:15:in `request_call'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/excon-0.44.4/lib/excon/middlewares/base.rb:15:in `request_call'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/excon-0.44.4/lib/excon/connection.rb:233:in `request'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/faraday-0.8.8/lib/faraday/adapter/excon.rb:45:in `call'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/faraday-0.8.8/lib/faraday/request/authorization.rb:36:in `call'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/faraday-0.8.8/lib/faraday/connection.rb:253:in `run_request'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/faraday-0.8.8/lib/faraday/connection.rb:118:in `put'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/yandex-disk-0.0.7/lib/yandex/disk/client.rb:106:in `put_response'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/yandex-disk-0.0.7/lib/yandex/disk/client.rb:39:in `put!'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/yandex-disk-0.0.7/lib/yandex/disk/backup/storage.rb:28:in `block in transfer!'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/yandex-disk-0.0.7/lib/yandex/disk/backup/storage.rb:24:in `each'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/yandex-disk-0.0.7/lib/yandex/disk/backup/storage.rb:24:in `transfer!'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/backup-4.1.10/lib/backup/storage/base.rb:35:in `perform!'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/backup-4.1.10/lib/backup/model.rb:269:in `each'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/backup-4.1.10/lib/backup/model.rb:269:in `block in perform!'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/backup-4.1.10/lib/backup/model.rb:268:in `each'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/backup-4.1.10/lib/backup/model.rb:268:in `perform!'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/backup-4.1.10/lib/backup/cli.rb:156:in `perform'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/gems/backup-4.1.10/bin/backup:5:in `<top (required)>'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/bin/backup:23:in `load'
[2015/05/05 22:53:26][error]   /home/backuper/mine-fastvps-backuper/shared/bundle/ruby/2.2.0/bin/backup:23:in `<main>'

My config and the way I've got access token are exactly as described in yandex-disk readme. I haven't found any similar bugreport in excon or faraday gems, so looks like yandex-disk bug.

dhampik commented 9 years ago

Never mind, managed to make it work. The issue was that I also had to provide access to webdav and nothing is told about that anywhere. Not sure if access to REST API is required at all, but giving the access to both Yandex Disk REST API and Yandex Disk WebDAV API made it work!