fog / fog-google

Fog for Google Cloud Platform
MIT License
99 stars 146 forks source link

hash key "x-goog-acl" is not a Symbol #559

Closed JosephTico closed 2 years ago

JosephTico commented 2 years ago

I'm having this error when trying to upload files to GCS. Currently using version 1.17.0 of the gem, along with Ruby 2.6.5 and Rails 6.1.4.4

Error message: hash key "x-goog-acl" is not a Symbol
Error type: TypeError
Error at: /root/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/fog-google-1.17.0/lib/fog/storage/google_xml/models/file.rb:112:in `save'

I'm not using any special ACL, so don't know where this is coming from.

My Paperclip config is also pretty simple:

Paperclip::Attachment.default_options.update(
  storage: :fog,
  fog_public: true,
  fog_directory: 'xxx',
  fog_credentials: {
    google_storage_access_key_id: 'xxx',
    google_storage_secret_access_key: 'xxx',
    provider: 'Google'
  }
)
JosephTico commented 2 years ago

Update: reverting to version 1.12.1 has fixed the issue, will investigate when this issue was introduced.

Temikus commented 2 years ago

Hmmm could it be Ruby 3.0 fixes?

https://github.com/fog/fog-google/compare/v1.12.1...v1.17.0 lib/fog/storage/google_xml/models/file.rb

Unfortunately I don't use paperclip - @JosephTico can you try removing the ** from options and seeing if it reproduces? If so - we'll need to do better conversion there probably.

github-actions[bot] commented 2 years ago

This issue has been marked inactive and will be closed if no further activity occurs.