0
votes

I have followed a few tutorials(https://www.youtube.com/watch?v=0_2VBDoowHs , https://devcenter.heroku.com/articles/paperclip-s3) in order to upload images to Amazon S3 on my app

But I keep receiving the error "We're sorry, but something went wrong. If you are the application owner check the logs for more information." when uploading a image

I would like to know a way to test if the app is succeeding on accessing the S3 bucket. Or even a log where I can check what is going on, I can only access the heroku log and it doesn't help too much:

2016-04-03T21:24:05.972064+00:00 heroku[worker.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 30 seconds of SIGTERM

2016-04-03T21:24:05.972138+00:00 heroku[worker.1]: Stopping remaining processes with SIGKILL

2016-04-03T21:24:07.795254+00:00 heroku[worker.1]: Process exited with status 137

2
you can try on your development machine to upload images to s3 with paperclip + s3 settings in development.rbMuhammad Yawar Ali

2 Answers

0
votes

To see if the app is succeeding in uploading a picture to your bucket, just try the upload then check the bucket on AWS. If the upload is there, viola.

Here are some helpful debugging settings for your Heroku app.

In production.rb:

# More meaningful logs
config.log_level = :debug

# More meaningful error pages
config.consider_all_requests_local = true
0
votes

So, it was pretty simple.

It seems that Paperclip doesn't support more recent versions of aws-sdk. So I had to change my Gemfile in order to use aws-sdk 2.0 or older.

gem 'aws-sdk', '< 2.0'

That solved the problem.

Thanks for all the help. Using the environment variables of the AWS keys in development.rb helped a lot on debugging the code.