Error when uploading to Amazon S3

117 views
Skip to first unread message

mag...@studioalice.se

unread,
May 24, 2015, 2:12:59 PM5/24/15
to refine...@googlegroups.com
Hi
This is the first time I'm using Amazon S3, and it's a tiny bit confusing to use.

Well, trying to upload an image using the Images tab in admin gives the error:
"We are sorry, but something went wrong"
(I'm sorry for that too)

I have followed the guide "Using Amazon S2 for uploads" (and read through a multitude of threads) with no luck. Have done these steps:
- Added the gem "fog" and "dragonfly-s3_data_storage"
- Run "heroku config S3_ XXXX" in the terminal
- Added S3 keys to the file environments/production.rb:
ENV['S3_KEY']='AKIA...'
ENV
['S3_SECRET']='O0oUW...'
ENV
['S3_BUCKET']='bucket'
ENV
['S3_REGION']='Frankfurt'
Refinery::Core.config.s3_backend = true


I'm started to think that it is a permission error of some kind in the Amazon S3 account??? I have added an IAM user with full S3 permissions. And in the permissions for the bucket I have granted "Authenticated Users" to List, Upload/Delete and View Permissions.

Is this the right way? Now I'm out of ideas to try…

Best,
Magnus

Philip Arndt

unread,
May 24, 2015, 10:03:40 PM5/24/15
to refine...@googlegroups.com
Can you use the Heroku logs to tell us what's going on when that error happens?

Use: heroku logs --tail

And then upload an image.

mag...@studioalice.se

unread,
May 25, 2015, 12:04:21 AM5/25/15
to refine...@googlegroups.com
Hi
Here are the output from the logs.

2015-05-25T03:53:06.762736+00:00 app[web.1]: Started POST "/refinery/images?dialog=true" for 85.225.68.93 at 2015-05-25 03:53:06 +0000
2015-05-25T03:53:06.864924+00:00 app[web.1]:
2015-05-25T03:53:06.864928+00:00 app[web.1]: Excon::Errors::SocketError (getaddrinfo: Name or service not known (SocketError)):
2015-05-25T03:53:06.864930+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/socket.rb:108:in `getaddrinfo'
2015-05-25T03:53:06.864931+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/socket.rb:108:in `
connect'
2015-05-25T03:53:06.864933+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/ssl_socket.rb:148:in `connect'

2015-05-25T03:53:06.864934+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/socket.rb:28:in `initialize'
2015-05-25T03:53:06.864936+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/ssl_socket.rb:8:in `
initialize'
2015-05-25T03:53:06.864938+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/connection.rb:387:in `new'

2015-05-25T03:53:06.864939+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/connection.rb:387:in `socket'
2015-05-25T03:53:06.864940+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/connection.rb:106:in `
request_call'
2015-05-25T03:53:06.864941+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/middlewares/mock.rb:47:in `request_call'

2015-05-25T03:53:06.864944+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/middlewares/instrumentor.rb:22:in `request_call'
2015-05-25T03:53:06.864945+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/middlewares/base.rb:15:in `
request_call'
2015-05-25T03:53:06.864947+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/middlewares/base.rb:15:in `request_call'

2015-05-25T03:53:06.864948+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/middlewares/base.rb:15:in `request_call'
2015-05-25T03:53:06.864949+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/connection.rb:233:in `
request'
2015-05-25T03:53:06.864951+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/middlewares/idempotent.rb:26:in `error_call'

2015-05-25T03:53:06.864952+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/middlewares/base.rb:10:in `error_call'
2015-05-25T03:53:06.864953+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/middlewares/base.rb:10:in `
error_call'
2015-05-25T03:53:06.864954+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/connection.rb:256:in `rescue in request'

2015-05-25T03:53:06.864955+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/connection.rb:204:in `request'
2015-05-25T03:53:06.864957+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/middlewares/idempotent.rb:26:in `
error_call'
2015-05-25T03:53:06.864958+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/middlewares/base.rb:10:in `error_call'

2015-05-25T03:53:06.864959+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/middlewares/base.rb:10:in `error_call'
2015-05-25T03:53:06.864960+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/connection.rb:256:in `
rescue in request'
2015-05-25T03:53:06.864961+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/connection.rb:204:in `request'

2015-05-25T03:53:06.864963+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/middlewares/idempotent.rb:26:in `error_call'
2015-05-25T03:53:06.864964+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/middlewares/base.rb:10:in `
error_call'
2015-05-25T03:53:06.864965+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/middlewares/base.rb:10:in `error_call'

2015-05-25T03:53:06.864966+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/connection.rb:256:in `rescue in request'
2015-05-25T03:53:06.864967+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/excon-0.45.3/lib/excon/connection.rb:204:in `
request'
2015-05-25T03:53:06.864969+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/fog-xml-0.1.2/lib/fog/xml/sax_parser_connection.rb:35:in `request'

2015-05-25T03:53:06.864970+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/fog-xml-0.1.2/lib/fog/xml/connection.rb:7:in `request'
2015-05-25T03:53:06.864971+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/fog-aws-0.3.0/lib/fog/aws/storage.rb:596:in `
_request'
2015-05-25T03:53:06.864972+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/fog-aws-0.3.0/lib/fog/aws/storage.rb:591:in `request'

2015-05-25T03:53:06.864974+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/fog-aws-0.3.0/lib/fog/aws/requests/storage/get_service.rb:21:in `get_service'
2015-05-25T03:53:06.864975+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/fog-aws-0.3.0/lib/fog/aws/requests/storage/sync_clock.rb:9:in `
sync_clock'
2015-05-25T03:53:06.864976+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-s3_data_store-1.1.0/lib/dragonfly/s3_data_store.rb:97:in `storage'

2015-05-25T03:53:06.864978+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-s3_data_store-1.1.0/lib/dragonfly/s3_data_store.rb:169:in `rescue in rescuing_socket_errors'
2015-05-25T03:53:06.864980+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-s3_data_store-1.1.0/lib/dragonfly/s3_data_store.rb:167:in `
rescuing_socket_errors'
2015-05-25T03:53:06.864981+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-s3_data_store-1.1.0/lib/dragonfly/s3_data_store.rb:103:in `bucket_exists?'

2015-05-25T03:53:06.864983+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-s3_data_store-1.1.0/lib/dragonfly/s3_data_store.rb:126:in `ensure_bucket_initialized'
2015-05-25T03:53:06.864984+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-s3_data_store-1.1.0/lib/dragonfly/s3_data_store.rb:43:in `
write'
2015-05-25T03:53:06.864989+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-1.0.10/lib/dragonfly/content.rb:180:in `store'

2015-05-25T03:53:06.864991+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-1.0.10/lib/dragonfly/model/attachment.rb:179:in `store_job!'
2015-05-25T03:53:06.864992+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-1.0.10/lib/dragonfly/model/attachment.rb:77:in `
save!'
2015-05-25T03:53:06.864993+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-1.0.10/lib/dragonfly/model/instance_methods.rb:16:in `block in save_dragonfly_attachments'

2015-05-25T03:53:06.864994+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-1.0.10/lib/dragonfly/model/instance_methods.rb:15:in `each'
2015-05-25T03:53:06.864996+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-1.0.10/lib/dragonfly/model/instance_methods.rb:15:in `
save_dragonfly_attachments'
2015-05-25T03:53:06.864997+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:424:in `block in make_lambda'

2015-05-25T03:53:06.864998+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:160:in `call'
2015-05-25T03:53:06.865000+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:160:in `
block in halting'
2015-05-25T03:53:06.865001+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:86:in `call'

2015-05-25T03:53:06.865002+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:86:in `run_callbacks'
2015-05-25T03:53:06.865004+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/callbacks.rb:302:in `
create_or_update'
2015-05-25T03:53:06.865005+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/persistence.rb:103:in `save'

2015-05-25T03:53:06.865006+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/validations.rb:51:in `save'
2015-05-25T03:53:06.865008+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/attribute_methods/dirty.rb:21:in `
save'
2015-05-25T03:53:06.865009+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/transactions.rb:268:in `block (2 levels) in save'

2015-05-25T03:53:06.865011+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
2015-05-25T03:53:06.865013+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `
block in transaction'
2015-05-25T03:53:06.865014+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'

2015-05-25T03:53:06.865016+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
2015-05-25T03:53:06.865017+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/transactions.rb:208:in `
transaction'
2015-05-25T03:53:06.865018+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/transactions.rb:326:in `with_transaction_returning_status'

2015-05-25T03:53:06.865019+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/transactions.rb:268:in `block in save'
2015-05-25T03:53:06.865021+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/transactions.rb:283:in `
rollback_active_record_state!'
2015-05-25T03:53:06.865022+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/transactions.rb:267:in `save'

2015-05-25T03:53:06.865023+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/persistence.rb:34:in `create'
2015-05-25T03:53:06.865025+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/refinerycms-521324391baf/images/app/controllers/refinery/admin/images_controller.rb:45:in `
block in create'
2015-05-25T03:53:06.865026+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/refinerycms-521324391baf/images/app/controllers/refinery/admin/images_controller.rb:43:in `each'

2015-05-25T03:53:06.865027+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/refinerycms-521324391baf/images/app/controllers/refinery/admin/images_controller.rb:43:in `create'
2015-05-25T03:53:06.865029+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_controller/metal/implicit_render.rb:4:in `
send_action'
2015-05-25T03:53:06.865030+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/abstract_controller/base.rb:189:in `process_action'

2015-05-25T03:53:06.865032+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_controller/metal/rendering.rb:10:in `process_action'
2015-05-25T03:53:06.865033+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/abstract_controller/callbacks.rb:20:in `
block in process_action'
2015-05-25T03:53:06.865034+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:113:in `call'

2015-05-25T03:53:06.865035+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:113:in `call'
2015-05-25T03:53:06.865040+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `
block in halting'
2015-05-25T03:53:06.865041+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `call'

2015-05-25T03:53:06.865043+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `block in halting'
2015-05-25T03:53:06.865044+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:215:in `
call'
2015-05-25T03:53:06.865045+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'

2015-05-25T03:53:06.865063+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `call'
2015-05-25T03:53:06.865064+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `
block in halting'
2015-05-25T03:53:06.865065+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `call'

2015-05-25T03:53:06.865067+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `block in halting'
2015-05-25T03:53:06.865068+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `
call'
2015-05-25T03:53:06.865069+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `block in halting'

2015-05-25T03:53:06.865071+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `call'
2015-05-25T03:53:06.865072+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `
block in halting'
2015-05-25T03:53:06.865073+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `call'

2015-05-25T03:53:06.865075+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `block in halting'
2015-05-25T03:53:06.865076+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:229:in `
call'
2015-05-25T03:53:06.865077+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:229:in `block in halting'

2015-05-25T03:53:06.865078+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:229:in `call'
2015-05-25T03:53:06.865080+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:229:in `
block in halting'
2015-05-25T03:53:06.865081+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `call'

2015-05-25T03:53:06.865082+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `block in halting'
2015-05-25T03:53:06.865083+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `
call'
2015-05-25T03:53:06.865084+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `block in halting'

2015-05-25T03:53:06.865085+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `call'
2015-05-25T03:53:06.865086+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `
block in halting'
2015-05-25T03:53:06.865088+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `call'

2015-05-25T03:53:06.865089+00:00 app[web.1]:   vendor/bundl
e
/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `block in halting'
2015-05-25T03:53:06.865090+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `
call'
2015-05-25T03:53:06.865091+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:166:in `block in halting'

2015-05-25T03:53:06.865092+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:149:in `call'
2015-05-25T03:53:06.865093+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:149:in `
block in halting_and_conditional'
2015-05-25T03:53:06.865095+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:149:in `call'

2015-05-25T03:53:06.865096+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
2015-05-25T03:53:06.865097+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:86:in `
call'
2015-05-25T03:53:06.865098+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:86:in `run_callbacks'

2015-05-25T03:53:06.865100+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/abstract_controller/callbacks.rb:19:in `process_action'
2015-05-25T03:53:06.865101+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_controller/metal/rescue.rb:29:in `
process_action'
2015-05-25T03:53:06.865102+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'

2015-05-25T03:53:06.865107+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/notifications.rb:159:in `block in instrument'
2015-05-25T03:53:06.865109+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/notifications/instrumenter.rb:20:in `
instrument'
2015-05-25T03:53:06.865110+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/notifications.rb:159:in `instrument'

2015-05-25T03:53:06.865111+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
2015-05-25T03:53:06.865113+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_controller/metal/params_wrapper.rb:250:in `
process_action'
2015-05-25T03:53:06.865114+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/railties/controller_runtime.rb:18:in `process_action'

2015-05-25T03:53:06.865115+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/abstract_controller/base.rb:136:in `process'
2015-05-25T03:53:06.865116+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionview-4.1.8/lib/action_view/rendering.rb:30:in `
process'
2015-05-25T03:53:06.865118+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_controller/metal.rb:196:in `dispatch'

2015-05-25T03:53:06.865119+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
2015-05-25T03:53:06.865120+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_controller/metal.rb:232:in `
block in action'
2015-05-25T03:53:06.865121+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/routing/route_set.rb:82:in `call'

2015-05-25T03:53:06.865122+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
2015-05-25T03:53:06.865124+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/routing/route_set.rb:50:in `
call'
2015-05-25T03:53:06.865125+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/journey/router.rb:73:in `block in call'

2015-05-25T03:53:06.865126+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/journey/router.rb:59:in `each'
2015-05-25T03:53:06.865127+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/journey/router.rb:59:in `
call'
2015-05-25T03:53:06.865129+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/routing/route_set.rb:678:in `call'

2015-05-25T03:53:06.865130+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.1.8/lib/rails/engine.rb:514:in `call'
2015-05-25T03:53:06.865131+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.1.8/lib/rails/railtie.rb:194:in `
public_send'
2015-05-25T03:53:06.865133+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.1.8/lib/rails/railtie.rb:194:in `method_missing'

2015-05-25T03:53:06.865134+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/journey/router.rb:73:in `block in call'
2015-05-25T03:53:06.865135+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/journey/router.rb:59:in `
each'
2015-05-25T03:53:06.865137+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/journey/router.rb:59:in `call'

2015-05-25T03:53:06.865138+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/routing/route_set.rb:678:in `call'
2015-05-25T03:53:06.865139+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-1.0.10/lib/dragonfly/middleware.rb:14:in `
call'
2015-05-25T03:53:06.865141+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-1.0.10/lib/dragonfly/middleware.rb:14:in `call'

2015-05-25T03:53:06.865142+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
2015-05-25T03:53:06.865143+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `
catch'
2015-05-25T03:53:06.865145+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'

2015-05-25T03:53:06.865146+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.5.3/lib/rack/etag.rb:23:in `call'
2015-05-25T03:53:06.865148+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.5.3/lib/rack/conditionalget.rb:35:in `
call'
2015-05-25T03:53:06.865149+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.5.3/lib/rack/head.rb:11:in `call'

2015-05-25T03:53:06.865150+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
2015-05-25T03:53:06.865151+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/flash.rb:254:in `
call'
2015-05-25T03:53:06.865153+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.5.3/lib/rack/session/abstract/id.rb:225:in `context'

2015-05-25T03:53:06.865154+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.5.3/lib/rack/session/abstract/id.rb:220:in `call'
2015-05-25T03:53:06.865155+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/cookies.rb:560:in `
call'
2015-05-25T03:53:06.865156+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/query_cache.rb:36:in `call'

2015-05-25T03:53:06.865158+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
2015-05-25T03:53:06.865162+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/callbacks.rb:29:in `
block in call'
2015-05-25T03:53:06.865163+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/callbacks.rb:82:in `run_callbacks'

2015-05-25T03:53:06.865164+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2015-05-25T03:53:06.865165+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/reloader.rb:73:in `
call'
2015-05-25T03:53:06.865167+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'

2015-05-25T03:53:06.865168+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
2015-05-25T03:53:06.865169+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/show_exceptions.rb:30:in `
call'
2015-05-25T03:53:06.865170+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.1.8/lib/rails/rack/logger.rb:38:in `call_app'

2015-05-25T03:53:06.865171+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.1.8/lib/rails/rack/logger.rb:20:in `block in call'
2015-05-25T03:53:06.865173+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/tagged_logging.rb:68:in `
block in tagged'
2015-05-25T03:53:06.865174+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/tagged_logging.rb:26:in `tagged'

2015-05-25T03:53:06.865175+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/tagged_logging.rb:68:in `tagged'
2015-05-25T03:53:06.865186+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.1.8/lib/rails/rack/logger.rb:20:in `
call'
2015-05-25T03:53:06.865188+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/request_id.rb:21:in `call'

2015-05-25T03:53:06.865189+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.5.3/lib/rack/methodoverride.rb:21:in `call'
2015-05-25T03:53:06.865190+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.5.3/lib/rack/runtime.rb:17:in `
call'
2015-05-25T03:53:06.865191+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.1.8/lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'

2015-05-25T03:53:06.865193+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/dragonfly-1.0.10/lib/dragonfly/cookie_monster.rb:9:in `call'
2015-05-25T03:53:06.865194+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.5.3/lib/rack/lock.rb:17:in `
call'
2015-05-25T03:53:06.865195+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/static.rb:84:in `call'

2015-05-25T03:53:06.865196+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.5.3/lib/rack/sendfile.rb:112:in `call'
2015-05-25T03:53:06.865198+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.1.8/lib/rails/engine.rb:514:in `
call'
2015-05-25T03:53:06.865199+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.1.8/lib/rails/application.rb:144:in `call'

2015-05-25T03:53:06.865200+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.5.3/lib/rack/lock.rb:17:in `call'
2015-05-25T03:53:06.865202+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.5.3/lib/rack/content_length.rb:14:in `
call'
2015-05-25T03:53:06.865203+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.5.3/lib/rack/handler/webrick.rb:60:in `service'

2015-05-25T03:53:06.865204+00:00 app[web.1]:   vendor/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
2015-05-25T03:53:06.865206+00:00 app[web.1]:   vendor/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `
run'
2015-05-25T03:53:06.865207+00:00 app[web.1]:   vendor/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'

2015-05-25T03:53:06.865208+00:00 app[web.1]:
2015-05-25T03:53:06.865209+00:00 app[web.1]:
2015-05-25T03:53:06.796555+00:00 app[web.1]: Processing by Refinery::Admin::ImagesController#create as HTML
2015-05-25T03:53:06.796658+00:00 app[web.1]:   Parameters: {"utf8"=>"✓", "authenticity_token"=>"ROBBHSUnYPAPUUi837F9ZCPeLdYJfuPvKdozYfYBrRo=", "image"=>{"image"=>[#<ActionDispatch::Http::UploadedFile:0x007f7545987210 @tempfile=#<Tempfile:/tmp/RackMultipart20150525-3-1766r91>, @original_filename="t1.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"image[image][]\"; filename=\"t1.jpg\"\r\nContent-Type: image/jpeg\r\n">], "image_title"=>"", "image_alt"=>""}, "wymeditor"=>"", "modal"=>"true", "dialog"=>"true", "app_dialog"=>"true", "field"=>"", "update_image"=>"", "thumbnail"=>"", "callback"=>"", "conditions"=>"", "locale"=>:en}
2015-05-25T03:53:06.860346+00:00 app[web.1]: Completed 500 Internal Server Error in 64ms


Best,
Magnus

mag...@studioalice.se

unread,
May 29, 2015, 5:29:29 AM5/29/15
to refine...@googlegroups.com
Now I have tried *everything* ;) without any luck. The error message in the log is (as far as I understand it) this:

2015-05-29T08:43:52.468152+00:00 app[web.1]: Excon::Errors::Forbidden (Expected(200) <=> Actual(403 Forbidden)
2015-05-29T08:43:52.468154+00:00 app[web.1]: excon.error.response
2015-05-29T08:43:52.468157+00:00 app[web.1]:   :body          => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><AWSAccessKeyId>AKIAJWETD6FQR7HRTM6A</AWSAccessKeyId><StringToSign>AWS4-HMAC-SHA256\n20150529T084351Z\n20150529/us-east-1/s3/aws4_request\nc38429b96e99d94230016feb8375c10a2ad02cb052c2340203aa2a51d00528c8</StringToSign><SignatureProvided>2aef89d2df07e4394711d040e3ffa0cd9aba934ecdc5b5afce70e3b919b6d5b5</SignatureProvided><StringToSignBytes>41 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 0a 32 30 31 35 30 35 32 39 54 30 38 34 33 35 31 5a 0a 32 30 31 35 30 35 32 39 2f 75 73 2d 65 61 73 74 2d 31 2f 73 33 2f 61 77 73 34 5f 72 65 71 75 65 73 74 0a 63 33 38 34 32 39 62 39 36 65 39 39 64 39 34 32 33 30 30 31 36 66 65 62 38 33 37 35 63 31 30 61 32 61 64 30 32 63 62 30 35 32 63 32 33 34 30 32 30 33 61 61 32 61 35 31 64 30 30 35 32 38 63 38</StringToSignBytes><CanonicalRequest>GET\n/savepsk/\nlocation=\nhost:s3.amazonaws.com\nx-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nx-amz-date:20150529T084351Z\n\nhost;x-amz-content-sha256;x-amz-date\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855</CanonicalRequest><CanonicalRequestBytes>47 45 54 0a 2f 73 61 76 65 70 73 6b 2f 0a 6c 6f 63 61 74 69 6f 6e 3d 0a 68 6f 73 74 3a 73 33 2e 61 6d 61 7a 6f 6e 61 77 73 2e 63 6f 6d 0a 78 2d 61 6d 7a 2d 63 6f 6e 74 65 6e 74 2d 73 68 61 32 35 36 3a 65 33 62 30 63 34 34 32 39 38 66 63 31 63 31 34 39 61 66 62 66 34 63 38 39 39 36 66 62 39 32 34 32 37 61 65 34 31 65 34 36 34 39 62 39 33 34 63 61 34 39 35 39 39 31 62 37 38 35 32 62 38 35 35 0a 78 2d 61 6d 7a 2d 64 61 74 65 3a 32 30 31 35 30 35 32 39 54 30 38 34 33 35 31 5a 0a 0a 68 6f 73 74 3b 78 2d 61 6d 7a 2d 63 6f 6e 74 65 6e 74 2d 73 68 61 32 35 36 3b 78 2d 61 6d 7a 2d 64 61 74 65 0a 65 33 62 30 63 34 34 32 39 38 66 63 31 63 31 34 39 61 66 62 66 34 63 38 39 39 36 66 62 39 32 34 32 37 61 65 34 31 65 34 36 34 39 62 39 33 34 63 61 34 39 35 39 39 31 62 37 38 35 32 62 38 35 35</CanonicalRequestBytes><RequestId>9C0AAB550724D76E</RequestId><HostId>hG/LnIQjit+Lyt8WEVdcbX4naeKydgRXbqq6s9ppwDjLxUIysOuAgW49oQMBFQFYQn9H795jutA=</HostId></Error>"


The error "SignaturDoesNotMatch" made me believe there was something wrong with the IAW user, so I created a new one with S3 access and administration rights.

Also done:
heroku config:add AWS_ACCESS_KEY_ID=XXXXX AWS_SECRET_ACCESS_KEY=XyZ FOG_DIRECTORY=savepsk FOG_PROVIDER=AWS FOG_REGION=us-east-1


heroku config:add S3_BUCKET=savepsk S3_KEY=XXXXX S3_REGION=us-east-1 S3_SECRET=XyZ



Add this code to config/enviroments.rb
ENV['S3_KEY']='XXXXX'
ENV
['S3_SECRET']='XyZ'
ENV
['S3_BUCKET']='savepsk'
ENV
['S3_REGION']='us-east-1'


And this to environments/production.rb
Refinery::Core.config.s3_backend = true



Question: Do I need to have a region set? Which one? When  I created the bucket I set the region to "Frankfurt" - but the URL for the bucket is ("region=us-west-2"

and if I check under the menu top right ("Global") it says "S3 does not require region selection".

Any tips to try is very welcome :)

Kind regards,
Magnus

Tom Connolly

unread,
May 29, 2015, 8:59:25 PM5/29/15
to refine...@googlegroups.com
This is definitely telling you your public key or private key does not match. Double check that the correct set is the active set. It's shown on the S3 panel (I haven't been there in a while, so you might have to do some poking around). Like all my errors, it's probably quite simple to fix. The "key" is finding it!

mag...@studioalice.se

unread,
May 30, 2015, 4:31:50 AM5/30/15
to refine...@googlegroups.com
Yes! Now it is working :=)
I did three changes:
1. Instead of creating and using a IAW user's key and secrets, I used the root access credentials.
2. New bucket with permission set to:
me: All permissions
everyone: view permission
3. Region name was set to "eu-central-1". Why do they call it "Frankfurt" when creating the bucket?

I don't know which of the changes which solved the problem – I'm just happy that it is working now! :=)

-- Magnus
Reply all
Reply to author
Forward
0 new messages