Heroku 500 Error, while using Heroku, Rails -
i trying upload images s3 using paperclip. works in development, when force heroku status 500.
i've looked on current topics , reasons either lack of pg gem , bucket name not configured i've checked those.
my error log says this
2014-06-22t23:13:44.118505+00:00 app[web.1]: i, [2014-06-22t23:13:44.118013 #2] info -- : command :: convert '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y3[0]' -auto-orient -resize "x100" -crop "100x100+99+0" +repage -set colorspace srgb -strip '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y320140622-2-10cae74.jpg' 2014-06-22t23:13:44.040021+00:00 app[web.1]: i, [2014-06-22t23:13:31.758844 #2] info -- : rendered patients/new.html.erb within layouts/application (2.6ms) 2014-06-22t23:13:44.040023+00:00 app[web.1]: i, [2014-06-22t23:13:31.759625 #2] info -- : completed 200 ok in 5ms (views: 3.8ms | activerecord: 0.0ms) 2014-06-22t23:13:44.040024+00:00 app[web.1]: i, [2014-06-22t23:13:44.027440 #2] info -- : started post "/patients" 107.19.177.84 @ 2014-06-22 23:13:44 +0000 2014-06-22t23:13:44.040026+00:00 app[web.1]: i, [2014-06-22t23:13:44.031624 #2] info -- : processing patientscontroller#create html 2014-06-22t23:13:44.081130+00:00 app[web.1]: i, [2014-06-22t23:13:44.080608 #2] info -- : command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y3[0]' 2>/dev/null 2014-06-22t23:13:44.040028+00:00 app[web.1]: i, [2014-06-22t23:13:44.031790 #2] info -- : parameters: {"utf8"=>"✓", "authenticity_token"=>"6lvlnwstg6qcoilibt1pjvux1mvp+wbnhux4yyvphdi=", "patient"=>{"name"=>"yitao zhang", "number"=>"6503916966", "email"=>"yitaoz@stanford.edu", "appointment"=>"2014-06-16", "avatar"=>#<actiondispatch::http::uploadedfile:0x007f7324f6e7f0 @tempfile=#<tempfile:/tmp/rackmultipart20140622-2-1gopf5s>, @original_filename="images.jpeg", @content_type="image/jpeg", @headers="content-disposition: form-data; name=\"patient[avatar]\"; filename=\"images.jpeg\"\r\ncontent-type: image/jpeg\r\n">, "description"=>"adsafasdf"}, "commit"=>"submit"} 2014-06-22t23:13:44.184102+00:00 app[web.1]: i, [2014-06-22t23:13:44.183584 #2] info -- : command :: file -b --mime '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y320140622-2-10cae74.jpg' 2014-06-22t23:13:44.040030+00:00 app[web.1]: i, [2014-06-22t23:13:44.038575 #2] info -- : command :: file -b --mime-type '/tmp/8f2ed61a3cb4149d8c9abca38721647720140622-2-1c1dac6' 2014-06-22t23:13:44.260870+00:00 app[web.1]: i, [2014-06-22t23:13:44.260288 #2] info -- : command :: convert '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y3[0]' -auto-orient -resize "x480" -crop "480x480+478+0" +repage -set colorspace srgb -strip '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y320140622-2-ye2lmv.jpg' 2014-06-22t23:13:44.470900+00:00 app[web.1]: i, [2014-06-22t23:13:44.470357 #2] info -- : command :: file -b --mime '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y320140622-2-ye2lmv.jpg' 2014-06-22t23:13:44.544510+00:00 app[web.1]: i, [2014-06-22t23:13:44.543987 #2] info -- : command :: convert '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y3[0]' -auto-orient -resize "600>" -set colorspace srgb -strip '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y320140622-2-1rbg2jr.jpg' 2014-06-22t23:13:44.621867+00:00 app[web.1]: i, [2014-06-22t23:13:44.621332 #2] info -- : command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y3[0]' 2>/dev/null 2014-06-22t23:13:44.590252+00:00 app[web.1]: i, [2014-06-22t23:13:44.589723 #2] info -- : command :: file -b --mime '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y320140622-2-1rbg2jr.jpg' 2014-06-22t23:13:44.506015+00:00 app[web.1]: i, [2014-06-22t23:13:44.505469 #2] info -- : command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y3[0]' 2>/dev/null 2014-06-22t23:13:44.662154+00:00 app[web.1]: i, [2014-06-22t23:13:44.661637 #2] info -- : command :: convert '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y3[0]' -auto-orient -resize "1200>" -set colorspace srgb -strip -sharpen 0x0.5 '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y320140622-2-fpzvpn.jpg' 2014-06-22t23:13:44.743824+00:00 app[web.1]: i, [2014-06-22t23:13:44.743315 #2] info -- : command :: file -b --mime '/tmp/eba6328b7631122493d269f7c5d3781d20140622-2-1f1t7y320140622-2-fpzvpn.jpg' 2014-06-22t23:13:44.836262+00:00 heroku[router]: at=info method=post path="/patients" host=glacial-scrubland-2600.herokuapp.com request_id=47cf63e3-59f9-4dc0-be18-fc06ae702775 fwd="107.19.177.84" dyno=web.1 connect=1ms service=1078ms status=500 bytes=1543 2014-06-22t23:13:44.790408+00:00 app[web.1]: i, [2014-06-22t23:13:44.789786 #2] info -- : command :: file -b --mime-type '/tmp/47f9c6187d138877e010f0255fe25ac920140622-2-1fmy0hr'
the hint have status=500.
would appreciate thoughts / help!
env vars
the pertinent issue you've not got env
variables set correctly. these environment specific - meaning have set them in each "environment" (server) deploy app to
a mutual problem many deploy heroku without setting these env vars, consequently preventing scheme accessing info needs.
the solution utilize heroku config:set variable=value
in cmd
--
production
your log doesn't have errors, isn't helpful
one other piece of speculation, therefore, thought you've not set production
environment options in rails itself:
#config/environments/production.rb config.paperclip_defaults = { :storage => :s3, :s3_credentials => { :bucket => env['s3_bucket_name'], :access_key_id => env['aws_access_key_id'], :secret_access_key => env['aws_secret_access_key'] } }
there issue may have, how paperclip
uses bucket
option. we've found requires setup work correctly:
#config/environments/production.rb config.paperclip.defaults = { storage: :s3, s3_host_name: 's3-eu-west-1.amazonaws.com', s3_credentials: { access_key_id: env['aws_access_key_id'], secret_access_key: env['aws_secret_access_key'] }, bucket: env['s3_bucket_name'] }
ruby-on-rails heroku
No comments:
Post a Comment