-
Notifications
You must be signed in to change notification settings - Fork 244
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
IOError: closed stream #467
Comments
I'm having this issue in production right now, so I had no other choice than dig deeper into it. I've debugged with pry where the temp object is initialized to see what I'm receiving or why the test is different than a normal request, so I started with the successful case (uploading a file through a request):
as you can see, there is no problem to get the tempfile size before this is being closed.
after closing gives no problem either to get the size.
The file size is displayed correctly, but after this is closed, it starts to raise the exception:
If I comment |
thanks for the detailed debug info. So just to clarify, this is just in tests right? (I noticed you said "I'm having this issue in production right now" - did you mean a CI server or something?) Also I notice that you're initializing the Also, to get the tests to pass it would probably be sufficient just to do (unless there's something I'm missing) factory :attachment do
file Rails.root.join('spec/fixtures/quokka.jpg')
end |
We were using Passing a file itself helped indeed
|
Recently I've added a new validation to my dragonfly model
and it works great in my app, but since then, my specs started to fail:
My model and factory has nothing special (I guess):
I checked this issue's comment, but I don't have that
meta_request
gem in my project. And I repeat, that attachment factory is working ok without the size validation.Any ideas what it could be?
The text was updated successfully, but these errors were encountered: