Question

I'm getting out of the sudden the following error when using FOG and AWS:

The following keys are invalid: :scheme, :host
Expected(200) <=> Actual(403 Forbidden)

This error occured after doing a bundle update. I just don't get what it's going wrong suddenly.

fog_connection = Fog::Storage.new({:provider => 'AWS',:aws_access_key_id => CUBE_CONF['aws']['access_key'],:aws_secret_access_key => CUBE_CONF['aws']['secret_key'],:region => 'eu-west-1'})

  puts "VideoEntryPandaWorker: established connection with S3"
  # setting the directory
  fog_directory = fog_connection.directories.new(:key => CUBE_CONF['panda']['s3_bucket'])
  puts "VideoEntryPandaWorker: fetched directories from #{CUBE_CONF['panda']['s3_bucket']}"

  # uploading the file
  puts "VideoEntryPandaWorker: creating fog file with src: #{video_entry.video_file.current_path}"
  file = fog_directory.files.new({
                                 :key    => video_entry.video_name,
                                 :body   => File.open(video_entry.video_file.current_path),
                                 :public => true
                             })
  file.save
  puts "VideoEntryPandaWorker: S3 url #{file.public_url}"

Maybe anyone knows what's going wrong ?

Was it helpful?

Solution

I just experienced this myself and I was running Fog 1.11.1 and upgrading to 1.15.0 solved it for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top