fog-aws: NoMethodError (undefined method `copy_object' for "close":String)
Since today on my production server, I’m experiencing a weird error that seems to come from fog-was’s copy_object method call. I’ve checked other library invovled and none of them have a method name copy_object.
Stack
- ruby 2.7.0
- rails 6.1.3
- carrierwave 3.0.4
- fog-core 2.3.0
- fog-aws 3.21.0
When doing a regular file assignment:
object.image = File.open(...)
object.save!
I’m getting the following error:
NoMethodError (undefined method `copy_object' for "close":String)
If I try to do the same with remote_attribute_url I still get the error. Not sure if this is a carrierwave issue or not. Anyone can help ?
EDIT
Not sure if this is related but whenever I’m affecting a file to my model uploader, i’m getting the following warning:
[fog][DEPRECATION] #connection= is deprecated, pass :service in at creation (/Users/loic/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/fog-core-2.3.0/lib/fog/core/attributes.rb:134:in `block in merge_attributes')
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 31 (15 by maintainers)
@geemus Hello, good to hear! I’ll test it ASAP.
Released in v3.27.0.
@sectasy0 hopefully this will resolve it for you, I’ll be curious to hear when you get a chance to try it.
I’ve created a PR #725 with this change.
I will plan on trying to do a release with that change in the next few days, and will post here when I do. Hopefully then we can try things with this change and confirm if the issues is still happening or if it has resolved.
Thanks for sharing further details, I hadn’t had a chance to look over the weekend but have reviewed now. Unfortunately it’s not obvious to me from reviewing this where the error is occurring, it seems as though it may be in the internals of carrierwave, rather than in fog or in your usage (though I could be missing something still). I think you may be better served by reporting this against the carrierwave repository and hopefully someone with more familiarity there can be of more direct help.
Hi @sectasy0 . In my situation, I fix it by removing versions(:thumb, :medium, etc…) on the uploader file. I don’t why is that happening. So you might want to limit the uploading size to prevent large file.
Glad to hear you have a workaround for now. Unfortunately on my side I haven’t used these libraries myself in quite some time, so I don’t have an existing setup that I can easily change to test against.