tedconf / front_end_builds

Rails engine to manage front end builds and deployments
MIT License
75 stars 21 forks source link

ActiveRecord::StatementInvalid: PG::ConnectionBad: PQconsumeInput() SSL error: block type is not 01 #65

Closed anilmaurya closed 9 years ago

anilmaurya commented 9 years ago

I am getting this error when using front_end_builds on production.

env: server: phusion passenger database: postgres 9.4.1 pg gem: 0.18.2 OpenSSL 1.0.1f 6 Jan 2014

front_end_builds work fine for 1 machine, when I add 2nd machine and deploy from second machine then I get this error.

After debugging I came across https://bitbucket.org/ged/ruby-pg/issue/142/async_exec-over-ssl-connection-can-fail-on issue which might be cause of this bug.

Error trace :

[2015-06-26T18:10:07.614972 #20404] ERROR -- : PG::ConnectionBad: PQconsumeInput() SSL error: block type is not 01 : BEGIN I, [2015-06-26T18:10:07.615427 #20404] INFO -- : Completed 500 Internal Server Error in 50ms F, [2015-06-26T18:10:07.617529 #20404] FATAL -- : ActiveRecord::StatementInvalid (PG::ConnectionBad: PQconsumeInput() SSL error: block type is not 01 : BEGIN): vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in async_exec' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:inblock in execute' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract_adapter.rb:373:in block in log' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/notifications/instrumenter.rb:20:ininstrument' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract_adapter.rb:367:in log' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:127:inexecute' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:197:in begin_db_transaction' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:170:ininitialize' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:52:in new' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:52:inbegin' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract/database_statements.rb:231:in begin_transaction' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract/database_statements.rb:208:inwithin_new_transaction' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in transaction' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/transactions.rb:208:intransaction' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/transactions.rb:326:in with_transaction_returning_status' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/transactions.rb:268:inblock in save' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/transactions.rb:283:in rollback_active_record_state!' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/transactions.rb:267:insave' /home/ubuntu/followme/shared/bundle/ruby/2.1.0/bundler/gems/front_end_builds-17750b46e3e0/app/controllers/front_end_builds/builds_controller.rb:17:in create' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal/implicit_render.rb:4:insend_action' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/abstract_controller/base.rb:189:in process_action' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal/rendering.rb:10:inprocess_action' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/abstract_controller/callbacks.rb:20:in block in process_action' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:113:incall' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:113:in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:149:inblock in halting_and_conditional' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:229:in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:229:inblock in halting' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:166:in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:166:inblock in halting' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:166:in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:166:inblock in halting' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:86:in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:86:inrun_callbacks' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/abstract_controller/callbacks.rb:19:in process_action' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal/rescue.rb:29:inprocess_action' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal/instrumentation.rb:31:in block in process_action' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/notifications.rb:159:inblock in instrument' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/notifications/instrumenter.rb:20:in instrument' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/notifications.rb:159:ininstrument' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal/instrumentation.rb:30:in process_action' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal/params_wrapper.rb:250:inprocess_action' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/railties/controller_runtime.rb:18:in process_action' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/abstract_controller/base.rb:136:inprocess' vendor/bundle/ruby/2.1.0/gems/actionview-4.1.7/lib/action_view/rendering.rb:30:in process' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal.rb:196:indispatch' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal/rack_delegation.rb:13:in dispatch' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_controller/metal.rb:232:inblock in action' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/routing/route_set.rb:82:in call' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/routing/route_set.rb:82:indispatch' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/routing/route_set.rb:50:in call' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/journey/router.rb:73:inblock in call' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/journey/router.rb:59:in each' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/journey/router.rb:59:incall' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/routing/route_set.rb:678:in call' vendor/bundle/ruby/2.1.0/bundler/gems/front_end_builds-17750b46e3e0/lib/front_end_builds/middleware/admin_assets.rb:25:incall' vendor/bundle/ruby/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in block in call' vendor/bundle/ruby/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:34:incatch' vendor/bundle/ruby/2.1.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in call' vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/etag.rb:23:incall' vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:35:in call' vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/head.rb:11:incall' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/middleware/params_parser.rb:27:in call' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/query_cache.rb:36:incall' vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in call' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/middleware/callbacks.rb:29:inblock in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/callbacks.rb:82:in run_callbacks' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/middleware/callbacks.rb:27:incall' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/middleware/remote_ip.rb:76:in call' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/middleware/debug_exceptions.rb:17:incall' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/middleware/show_exceptions.rb:30:in call' vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/rack/logger.rb:38:incall_app' vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/rack/logger.rb:20:in block in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/tagged_logging.rb:68:inblock in tagged' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/tagged_logging.rb:26:in tagged' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/tagged_logging.rb:68:intagged' vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/rack/logger.rb:20:in call' vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.7/lib/action_dispatch/middleware/request_id.rb:21:incall' vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in call' vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.7/lib/active_support/cache/strategy/local_cache_middleware.rb:26:incall' vendor/bundle/ruby/2.1.0/gems/rack-cors-0.2.9/lib/rack/cors.rb:54:in call' vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/engine.rb:514:incall' vendor/bundle/ruby/2.1.0/gems/railties-4.1.7/lib/rails/application.rb:144:in call' /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/rack/thread_handler_extension.rb:74:inprocess_request' /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/request_handler/thread_handler.rb:141:in accept_and_process_next_request' /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/request_handler/thread_handler.rb:109:inmain_loop' /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'

ryanto commented 9 years ago

I merged your PR. Thanks for fixing this.