Search code examples
ruby-on-railsloggingherokuredmine-plugins

My app crashes on Heroku, and I can't understand Heroku logs


I develop a Redmine plugin in Ruby on Rails. Locally, the application works fine both in development and production modes.

But when I deploy it to Heroku, some pages are crashing, specifically some (but not all) custom tabs in project page. I can't understand the log received by command heroku logs. They don't contain errors in my code, only framework modules without error descriptions.

Ruby versions are same at me and Heroku (the only difference is a platform - x86_64-linux at Heroku and i386-mingw32 at me)

May be reason in different DBMS - Heroku uses Postgres and I use Sqlite? But crashing page has no data yet, and I don't commit sqlite gems and settings.

Here are the logs:

    > vendor/ruby-2.1.5/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/core_ext/benchmark.rb:12:in `ms'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_controller/metal/instrumentation.rb:41:in `block in render'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
    > vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_controller/metal/instrumentation.rb:40:in `render'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:198:in `process_action'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_controller/metal/rendering.rb:10:in `process_action'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:117:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:117:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `block in halting'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `_run_callbacks'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_process_action_callbacks'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/abstract_controller/callbacks.rb:19:in `process_action'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_controller/metal/rescue.rb:29:in `process_action'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `block in instrument'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `instrument'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:137:in `process'
    > vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
    > vendor/bundle/ruby/2.1.0/gems/actionview-4.2.0/lib/action_view/rendering.rb:30:in `process'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_controller/metal.rb:195:in `dispatch'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_controller/metal.rb:236:in `block in action'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:73:in `call'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:42:in `serve'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:43:in `block in serve'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:30:in `each'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:30:in `serve'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:802:in `call'
    > vendor/bundle/ruby/2.1.0/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:186:in `call!'
    > vendor/bundle/ruby/2.1.0/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:164:in `call'
    > vendor/bundle/ruby/2.1.0/gems/omniauth-1.2.2/lib/omniauth/builder.rb:59:in `call'
    > vendor/bundle/ruby/2.1.0/gems/rack-openid-1.4.2/lib/rack/openid.rb:98:in `call'
    > vendor/bundle/ruby/2.1.0/gems/request_store-1.0.5/lib/request_store/middleware.rb:9:in `call'
    > vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/etag.rb:24:in `call'
    > vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/conditionalget.rb:25:in `call'
    > vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-xml_parser-1.0.2/lib/action_dispatch/xml_params_parser.rb:16:in `call'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/flash.rb:260:in `call'
    > vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:in `context'
    > vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:220:in `call'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/cookies.rb:560:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/query_cache.rb:36:in `call'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in `_run_callbacks'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_call_callbacks'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
    > vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:38:in `call_app'
    > vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `block in call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `block in tagged'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:26:in `tagged'
    > vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `tagged'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
    > vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
    > vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'
    > vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
    > vendor/bundle/ruby/2.1.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/static.rb:113:in `call'
    > vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/engine.rb:518:in `call'
    > vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/content_length.rb:15:in `call'
    > vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
    > vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:88:in `service'
    > vendor/bundle/ruby/2.1.0/gems/railties-4.2.0/lib/rails/application.rb:164:in `call'
    > vendor/ruby-2.1.5/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
    > vendor/ruby-2.1.5/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
    > vendor/bundle/ruby/2.1.0/gems/rack-1.6.4/lib/rack/lock.rb:17:in `call'
    > vendor/ruby-2.1.5/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'

Solution

  • I was need to run heroku logs --tail command for receive full logs. There I saw my bug, it was in wrong query parameters.

    MyEntity.where 'id in (?)', my_array
    

    id field has integer type when my_array contains non-integer elements

    Thanks franciscod for advice about logs!