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

Errno::ENOENT: No such file or directory - Rails.root + /tmp/uploads/20121024-1032-18976-9140 #881

Closed
didip opened this issue Oct 24, 2012 · 4 comments

Comments

@didip
Copy link

didip commented Oct 24, 2012

Version Info:

  • carrierwave (0.7.0)
  • Rails (3.2.8)

I have a PDF file, created with backtick and 644 permission, when I tried to use Uploader.new.store!(File.open('/tmp/the_real_one.pdf')) I got:

Errno::ENOENT:
   No such file or directory - #{Rails.root}/tmp/uploads/20121024-1032-18976-4616/12345.pdf

I'm sure that's the tempfile that Carrierwave created. And sure enough, this directory doesn't exist:

#{Rails.root}/tmp/uploads/20121024-1032-18976-4616

# but this one exists:
#{Rails.root}/tmp/uploads

The initializer and uploader class can be seen here: https://gist.github.com/3947572

This is the stacktrace generated by rspec: https://gist.github.com/3949536

I'm not doing anything fancy (e.g. mounting the uploader to a model), I must have missed something obvious here.

@didip
Copy link
Author

didip commented Oct 25, 2012

More investigation shows that mkdir! in https://github.com/jnicklas/carrierwave/blob/master/lib/carrierwave/sanitized_file.rb

sometimes created the directory, sometimes didn't...

@ismailasci
Copy link

@didip I could not reproduce this with ruby (1.9.3), carrierwave (0.7.1), rails (3.2.8)

@didip
Copy link
Author

didip commented Nov 10, 2012

That's odd. Let's close this issue for now, maybe reopen it if other people have the same problem.

@didip didip closed this as completed Nov 10, 2012
@mumualex
Copy link

I've same problem:

  • on 100 simultaneous upload (for tests env), 2-3 files are in the same tmp directory that an other one
  • when a file is processed, the tmp directory is deleted even if an other file is present
  • when this other file must be processed, it's not found...

The proposed temporary configuration fix doesn't change anything:
config.delete_tmp_file_after_storage = false
config.delete_cache_id_after_storage = false

Some ideas ?

ruby 1.9.3, carrierwave 0.7.1, rails 3.2.9

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

3 participants