xing/paperclip-storage-ftp

Rails 3.2.12: (Net::FTPPermError) "550 The system cannot find the path specified" (1.2.7)

Closed this issue · 6 comments

Hello,
Ruby 2.0.0 | Rails 3.2.12 | paperclip (4.3.0)

Yesterday This gem's version was updated to 1.2.7 and pushed to ruby gems.
Since then I keep getting this error when trying to upload files: Both local and production (heroku)

Thing is- It works when I'm using 1.2.6- so... I guess 1.2.7 broke something.

One thing I should note is I used relative path in my paperclip settings, not absolute path (no "/" at the beginning of the path)
And the ftp account leads directly to the some_directory path. Example:

config.paperclip_defaults = {
:path => ":class/:attachment/:id/:style/:hash.:extension",
:url => "https://files.domain.com/dir_1/dir_2/some_diretory/:class/:attachment/:id/:style/:hash.:extension",
:hash_secret => "blahblah", # long secret string
:default_style => :normal,
:storage => :ftp,
:default_url => "/assets/example/:class_:attachment.jpg",
:ftp_servers => [
{
:host => "domain.com",
:user => "user",
:password => "password",
:passive => true
}
]
}
Again: the ftp account leads directly to the some_directory path

I Use Heroku, here are the logs (more or less same logs when I get error on my local machine):

: Net::FTPPermError (550 The system cannot find the path specified.
: vendor/ruby-2.0.0/lib/ruby/2.0.0/monitor.rb:211:in mon_synchronize' : vendor/ruby-2.0.0/lib/ruby/2.0.0/net/ftp.rb:326:ingetresp'
: vendor/ruby-2.0.0/lib/ruby/2.0.0/net/ftp.rb:414:in transfercmd' : vendor/ruby-2.0.0/lib/ruby/2.0.0/net/ftp.rb:351:inblock in sendcmd'
: vendor/ruby-2.0.0/lib/ruby/2.0.0/net/ftp.rb:349:in sendcmd' : vendor/ruby-2.0.0/lib/ruby/2.0.0/net/ftp.rb:517:inblock (2 levels) in retrlines'
: vendor/ruby-2.0.0/lib/ruby/2.0.0/net/ftp.rb:199:in with_binary' : vendor/ruby-2.0.0/lib/ruby/2.0.0/monitor.rb:211:inmon_synchronize'
: vendor/ruby-2.0.0/lib/ruby/2.0.0/net/ftp.rb:514:in retrlines' : vendor/ruby-2.0.0/lib/ruby/2.0.0/net/ftp.rb:515:inblock in retrlines'
: vendor/ruby-2.0.0/lib/ruby/2.0.0/net/ftp.rb:747:in nlst' : vendor/bundle/ruby/2.0.0/gems/paperclip-storage-ftp-1.2.7/lib/paperclip/storage/ftp/server.rb:103:inmktree'
: vendor/bundle/ruby/2.0.0/gems/paperclip-storage-ftp-1.2.7/lib/paperclip/storage/ftp/server.rb:113:in block in mktree' : vendor/bundle/ruby/2.0.0/gems/paperclip-storage-ftp-1.2.7/lib/paperclip/storage/ftp/server.rb:112:inmktree'
: vendor/bundle/ruby/2.0.0/gems/paperclip-storage-ftp-1.2.7/lib/paperclip/storage/ftp/server.rb:112:in each' : vendor/bundle/ruby/2.0.0/gems/paperclip-storage-ftp-1.2.7/lib/paperclip/storage/ftp/server.rb:113:inblock in mktree'
: vendor/bundle/ruby/2.0.0/gems/paperclip-storage-ftp-1.2.7/lib/paperclip/storage/ftp/server.rb:112:in mktree' : : vendor/bundle/ruby/2.0.0/gems/paperclip-storage-ftp-1.2.7/lib/paperclip/storage/ftp/server.rb:112:ineach'
:
: vendor/bundle/ruby/2.0.0/gems/paperclip-storage-ftp-1.2.7/lib/paperclip/storage/ftp/server.rb:68:in put_files' : vendor/bundle/ruby/2.0.0/gems/paperclip-storage-ftp-1.2.7/lib/paperclip/storage/ftp.rb:49:inblock (3 levels) in flush_writes'
: Completed 500 Internal Server Error in 8720ms

Thanks for the report! Will have a look.

Hello Boosty,
I used this gem in my project to upload photo on my own ftp server and I got success in that too. But
i am getting two random errors which i mentioned below.

  Net::FTPReplyError - 150 Connecting to port 3270
  or 
  Net::FTPPermError - 500 ?

I think it's same like above issue. So i need to know that did you found any solution for that ?

you can also answer me on my question here you can go.

http://stackoverflow.com/questions/33540851/getting-random-error-while-upload-photo-with-paperclip-on-my-ftp-server

Thank you.

I solve this with increase timeout :ftp_connect_timeout => 10000.
is this a right way for this.?

toao commented

@pmokariya your problem sounds like it's "simply" a connectivity issue and unrelated to the problem discussed here. so on slow or unstable connections increasing the timeout as you did might be the right solution.

Closing this due to lack of activity.

I implemented handling of the mentioned error: #39

New gem version is 1.2.8.
@Roko131 @pmokariya If this is still relevant to you, please try the new version and let me know if it's working for you.

Thanks!