mercredi 15 juin 2016

Errno::ECONNREFUSED - Connection refused - connect(2): while uploading image in Rails 3.1.13

When I tried to upload an image, I am getting the below error in the log:

[paperclip] Saving attachments. [paperclip] saving report_photos/original/2.jpg (0.4ms) rollback transaction Completed 500 Internal Server Error in 948ms

Errno::ECONNREFUSED - Connection refused - connect(2):
/home/abcuser/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/net/http.rb:763:in initialize'
/home/abcuser/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/net/http.rb:763:in
open'
/home/abcuser/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/net/http.rb:763:in block in connect'
/home/abcuser/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/timeout.rb:69:in
timeout'
/home/abcuser/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/timeout.rb:100:in timeout'
/home/abcuser/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/net/http.rb:763:in
connect'
/home/abcuser/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/net/http.rb:756:in do_start'
/home/abcuser/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/net/http.rb:751:in
start' (gem) aws-sdk-1.3.9/lib/net/http/connection_pool/session.rb:84:in for'
(gem) aws-sdk-1.3.9/lib/net/http/connection_pool.rb:190:in
session_for' (gem) aws-sdk-1.3.9/lib/net/http/connection_pool.rb:127:in request' (gem) aws-sdk-1.3.9/lib/net/http/connection_pool/connection.rb:116:in request' (gem) aws-sdk-1.3.9/lib/aws/core/http/net_http_handler.rb:44:in handle'
(gem) aws-sdk-1.3.9/lib/aws/core/client.rb:220:in
block in make_sync_request' (gem) aws-sdk-1.3.9/lib/aws/core/client.rb:234:in retry_server_errors' (gem) aws-sdk-1.3.9/lib/aws/core/client.rb:215:inmake_sync_request'
(gem) aws-sdk-1.3.9/lib/aws/core/client.rb:390:in block (2 levels) in client_request' (gem) aws-sdk-1.3.9/lib/aws/core/client.rb:287:in log_client_request' (gem) aws-sdk-1.3.9/lib/aws/core/client.rb:363:in block in client_request' (gem) aws-sdk-1.3.9/lib/aws/core/client.rb:275:inreturn_or_raise'
(gem) aws-sdk-1.3.9/lib/aws/core/client.rb:362:in client_request'
(eval):3:in
put_object' (gem) aws-sdk-1.3.9/lib/aws/s3/s3_object.rb:315:in write' (gem) paperclip-2.8.0/lib/paperclip/storage/s3.rb:295:inblock in flush_writes' (gem) paperclip-2.8.0/lib/paperclip/storage/s3.rb:281:in each' (gem) paperclip-2.8.0/lib/paperclip/storage/s3.rb:281:inflush_writes'
(gem) paperclip-2.8.0/lib/paperclip/attachment.rb:214:in save'
(gem) paperclip-2.8.0/lib/paperclip.rb:472:in
block in save_attached_files' (gem) paperclip-2.8.0/lib/paperclip.rb:465:in block in each_attachment' (gem) paperclip-2.8.0/lib/paperclip.rb:464:ineach' (gem) paperclip-2.8.0/lib/paperclip.rb:464:in each_attachment' (gem) paperclip-2.8.0/lib/paperclip.rb:471:insave_attached_files' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:416:in _run__816062881__save__1024312303__callbacks' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:405:in __run_callback' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:385:in _run_save_callbacks' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:81:in run_callbacks' (gem) activerecord-3.2.13/lib/active_record/callbacks.rb:264:in create_or_update' (gem) activerecord-3.2.13/lib/active_record/persistence.rb:84:insave'
(gem) activerecord-3.2.13/lib/active_record/validations.rb:50:in save' (gem) activerecord-3.2.13/lib/active_record/attribute_methods/dirty.rb:22:in save' (gem) activerecord-3.2.13/lib/active_record/transactions.rb:259:in block (2 levels) in save' (gem) activerecord-3.2.13/lib/active_record/transactions.rb:313:inblock in with_transaction_returning_status' (gem) activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in transaction' (gem) activerecord-3.2.13/lib/active_record/transactions.rb:208:in transaction' (gem) activerecord-3.2.13/lib/active_record/transactions.rb:311:in with_transaction_returning_status' (gem) activerecord-3.2.13/lib/active_record/transactions.rb:259:inblock in save' (gem) activerecord-3.2.13/lib/active_record/transactions.rb:270:in rollback_active_record_state!' (gem) activerecord-3.2.13/lib/active_record/transactions.rb:258:insave'
app/controllers/photos_controller.rb:56:in block in form_upload'
app/controllers/photos_controller.rb:55:in
each'
app/controllers/photos_controller.rb:55:in form_upload' (gem) actionpack-3.2.13/lib/action_controller/metal/implicit_render.rb:4:in send_action' (gem) actionpack-3.2.13/lib/abstract_controller/base.rb:167:in process_action' (gem) actionpack-3.2.13/lib/action_controller/metal/rendering.rb:10:in process_action' (gem) actionpack-3.2.13/lib/abstract_controller/callbacks.rb:18:in block in process_action' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:447:in _run__786939238__process_action__16233013__callbacks' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:405:in __run_callback' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:385:in _run_process_action_callbacks' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:81:in run_callbacks' (gem) actionpack-3.2.13/lib/abstract_controller/callbacks.rb:17:in process_action' (gem) actionpack-3.2.13/lib/action_controller/metal/rescue.rb:29:in process_action' (gem) actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:30:in block in process_action' (gem) activesupport-3.2.13/lib/active_support/notifications.rb:123:in block in instrument' (gem) activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in instrument' (gem) activesupport-3.2.13/lib/active_support/notifications.rb:123:in instrument' (gem) actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:29:in process_action' (gem) actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:207:in process_action' (gem) activerecord-3.2.13/lib/active_record/railties/controller_runtime.rb:18:in process_action' (gem) actionpack-3.2.13/lib/abstract_controller/base.rb:121:in process'
(gem) actionpack-3.2.13/lib/abstract_controller/rendering.rb:45:in
process' (gem) actionpack-3.2.13/lib/action_controller/metal.rb:203:in dispatch'
(gem) actionpack-3.2.13/lib/action_controller/metal/rack_delegation.rb:14:in
dispatch' (gem) actionpack-3.2.13/lib/action_controller/metal.rb:246:in block in action' (gem) actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:73:in call' (gem) actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:73:in dispatch' (gem) actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:36:in call' (gem) journey-1.0.4/lib/journey/router.rb:68:in block in call' (gem) journey-1.0.4/lib/journey/router.rb:56:ineach' (gem) journey-1.0.4/lib/journey/router.rb:56:in call' (gem) actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:612:in call' (gem) meta_request-0.2.1/lib/meta_request/middlewares/app_request_handler.rb:11:in call' (gem) rack-contrib-1.1.0/lib/rack/contrib/response_headers.rb:17:incall'
(gem) meta_request-0.2.1/lib/meta_request/middlewares/headers.rb:16:in call' (gem) meta_request-0.2.1/lib/meta_request/middlewares/meta_request_handler.rb:13:in call' (gem) better_errors-0.3.2/lib/better_errors/middleware.rb:51:in app_call'
(gem) better_errors-0.3.2/lib/better_errors/middleware.rb:45:in
call' (gem) airbrake-3.1.7/lib/airbrake/rails/middleware.rb:15:in call'
(gem) sass-3.2.5/lib/sass/plugin/rack.rb:54:in
call' (gem) warden-1.0.6/lib/warden/manager.rb:35:in block in call' (gem) warden-1.0.6/lib/warden/manager.rb:34:incatch' (gem) warden-1.0.6/lib/warden/manager.rb:34:in call' (gem) client_side_validations-3.0.12/lib/client_side_validations/middleware.rb:17:in call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb:17:in call' (gem) rack-1.4.7/lib/rack/etag.rb:23:incall' (gem) rack-1.4.7/lib/rack/conditionalget.rb:35:in call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/head.rb:14:incall' (gem) remotipart-1.0.2/lib/remotipart/middleware.rb:30:in call'
(gem) actionpack-3.2.13/lib/action_dispatch/middleware/params_parser.rb:21:in
call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/flash.rb:242:in call' (gem) rack-1.4.7/lib/rack/session/abstract/id.rb:210:in context' (gem) rack-1.4.7/lib/rack/session/abstract/id.rb:205:in call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/cookies.rb:341:in call' (gem) activerecord-3.2.13/lib/active_record/query_cache.rb:64:in call'
(gem) activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in
call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:28:in block in call' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:405:in _run__573045024__call__1024312303__callbacks' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:405:in __run_callback' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:385:in _run_call_callbacks' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:81:in run_callbacks' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:27:in call' (gem) rails-dev-tweaks-0.6.1/lib/rails_dev_tweaks/granular_autoload/middleware.rb:34:in call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/remote_ip.rb:31:in call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/debug_exceptions.rb:16:in call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/show_exceptions.rb:56:in call' (gem) railties-3.2.13/lib/rails/rack/logger.rb:32:in call_app' (gem) railties-3.2.13/lib/rails/rack/logger.rb:16:in block in call' (gem) activesupport-3.2.13/lib/active_support/tagged_logging.rb:22:in tagged' (gem) railties-3.2.13/lib/rails/rack/logger.rb:16:incall' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/request_id.rb:22:in call' (gem) rack-1.4.7/lib/rack/methodoverride.rb:21:incall'
(gem) rack-1.4.7/lib/rack/runtime.rb:17:in call' (gem) activesupport-3.2.13/lib/active_support/cache/strategy/local_cache.rb:72:in call' (gem) rack-1.4.7/lib/rack/lock.rb:15:in call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/static.rb:63:in call' (gem) airbrake-3.1.7/lib/airbrake/user_informer.rb:16:in _call' (gem) airbrake-3.1.7/lib/airbrake/user_informer.rb:12:in call' (gem) railties-3.2.13/lib/rails/engine.rb:479:in call'
(gem) railties-3.2.13/lib/rails/application.rb:223:in
call' (gem) rack-1.4.7/lib/rack/content_length.rb:14:in call' (gem) railties-3.2.13/lib/rails/rack/log_tailer.rb:17:incall' (gem) thin-1.5.0/lib/thin/connection.rb:81:in block in pre_process' (gem) thin-1.5.0/lib/thin/connection.rb:79:incatch' (gem) thin-1.5.0/lib/thin/connection.rb:79:in pre_process' (gem) thin-1.5.0/lib/thin/connection.rb:54:inprocess' (gem) thin-1.5.0/lib/thin/connection.rb:39:in receive_data' (gem) eventmachine-1.0.0/lib/eventmachine.rb:187:inrun_machine' (gem) eventmachine-1.0.0/lib/eventmachine.rb:187:in run' (gem) thin-1.5.0/lib/thin/backends/base.rb:63:instart' (gem) thin-1.5.0/lib/thin/server.rb:159:in start' (gem) rack-1.4.7/lib/rack/handler/thin.rb:13:inrun' (gem) rack-1.4.7/lib/rack/server.rb:268:in start' (gem) railties-3.2.13/lib/rails/commands/server.rb:70:instart' (gem) railties-3.2.13/lib/rails/commands.rb:55:in block in <top (required)>' (gem) railties-3.2.13/lib/rails/commands.rb:50:intap' (gem) railties-3.2.13/lib/rails/commands.rb:50:in <top (required)>'
script/rails:6:in
require' script/rails:6:in `'

Started POST "/__better_errors/98360080/variables" for xxx-xxx-xx-xx(ip address)

This is an maintenance project and I am using rvm with Ruby 1.9.3p551 and Rails Rails 3.2.13 and paperclip used for uploads. Please suggest where I went wrong?

Aucun commentaire:

Enregistrer un commentaire