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

[Heroku] PG::Error: could not open file "/tmp/puma20220411-14-1llyqd": No such file or directory #15

Open
kwent opened this issue Apr 11, 2022 · 3 comments

Comments

@kwent
Copy link

kwent commented Apr 11, 2022

Hi and thank you for this project!

Error

PG::Error: could not open file "/tmp/puma20220411-14-1llyqd": No such file or directory

Backtrace

File /app/vendor/bundle/ruby/3.1.0/gems/active_storage-postgresql-0.3.0/lib/active_storage/postgresql/file.rb line 82 in lo_import
File /app/vendor/bundle/ruby/3.1.0/gems/active_storage-postgresql-0.3.0/lib/active_storage/postgresql/file.rb line 82 in lo_import
File /app/vendor/bundle/ruby/3.1.0/gems/active_storage-postgresql-0.3.0/lib/active_storage/postgresql/file.rb line 60 in import
File /app/vendor/bundle/ruby/3.1.0/gems/active_storage-postgresql-0.3.0/lib/active_storage/postgresql/file.rb line 17 in write_or_import

Versions

ruby '3.1.1'
rails '6.1.5'

Any idea ?

@ianyamey
Copy link

I'm having the same problem. @kwent did you find a workaround?

@kwent
Copy link
Author

kwent commented Jun 15, 2022

i did not.

@dantebronto
Copy link

I might make a PR for this later, but for me the issue was with this line.

I would suspect people who are running into this problem are using direct uploads?

Basically, it's not enough to ask if io.respond_to?(:to_path) because direct uploads do respond to to_path, but for me there wasn't actually a tempfile present at the location indicated by the path. The if/else could probably be inverted to check if the io object has a readable body, or maybe just check that it implements to_path AND the file at that path actually exists.

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