theodi / publisher

The publishing tool for GOV.UK
MIT License
1 stars 2 forks source link

500 when trying to publish #106

Closed pezholio closed 10 years ago

pezholio commented 10 years ago

I suspect this is something to do with the link between Publisher and Panopticon:

In the Publisher logs:

method=POST path=/admin/editions/534cea86f362be1b910000e4/progress format=html controller=admin/editions action=progress status=500 error='GdsApi::HTTPErrorResponse:<!DOCTYPE html>
<html>
<head>
  <title>We're sorry, but something went wrong (500)</title>
  <style type="text/css">
    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
    div.dialog {
      width: 25em;
      padding: 0 4em;
      margin: 4em auto 0 auto;
      border: 1px solid #ccc;
      border-right-color: #999;
      border-bottom-color: #999;
    }
    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
  </style>
</head>

<body>
  <!-- This file lives in public/500.html -->
  <div class="dialog">
    <h1>We're sorry, but something went wrong.</h1>
    <p>We've been notified about this issue and we'll take a look at it shortly.</p>
  </div>
</body>
</html>
' duration=139.06

GdsApi::HTTPErrorResponse (<!DOCTYPE html>
<html>
<head>
  <title>We're sorry, but something went wrong (500)</title>
  <style type="text/css">
    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
    div.dialog {
      width: 25em;
      padding: 0 4em;
      margin: 4em auto 0 auto;
      border: 1px solid #ccc;
      border-right-color: #999;
      border-bottom-color: #999;
    }
    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
  </style>
</head>

<body>
  <!-- This file lives in public/500.html -->
  <div class="dialog">
    <h1>We're sorry, but something went wrong.</h1>
    <p>We've been notified about this issue and we'll take a look at it shortly.</p>
  </div>
</body>
</html>
):
  /var/www/publisher/shared/bundle/ruby/1.9.1/bundler/gems/gds-api-adapters-1c11cf091bb2/lib/gds_api/json_client.rb:133:in `rescue in do_json_request'
  /var/www/publisher/shared/bundle/ruby/1.9.1/bundler/gems/gds-api-adapters-1c11cf091bb2/lib/gds_api/json_client.rb:120:in `do_json_request'
  /var/www/publisher/shared/bundle/ruby/1.9.1/bundler/gems/gds-api-adapters-1c11cf091bb2/lib/gds_api/json_client.rb:87:in `put_json!'
  /var/www/publisher/shared/bundle/ruby/1.9.1/bundler/gems/gds-api-adapters-1c11cf091bb2/lib/gds_api/panopticon.rb:37:in `put_artefact!'
  /var/www/publisher/shared/bundle/ruby/1.9.1/bundler/gems/gds-api-adapters-1c11cf091bb2/lib/gds_api/panopticon/registerer.rb:49:in `register_artefact'
  /var/www/publisher/shared/bundle/ruby/1.9.1/bundler/gems/gds-api-adapters-1c11cf091bb2/lib/gds_api/panopticon/registerer.rb:40:in `register'
  app/models/enhancements/edition.rb:35:in `register_with_panopticon'
  app/models/enhancements/edition.rb:19:in `was_published'
  govuk_content_models (6.1.0) app/models/workflow.rb:26:in `block (3 levels) in <module:Workflow>'
  state_machine (1.2.0) lib/state_machine/eval_helpers.rb:79:in `call'
  state_machine (1.2.0) lib/state_machine/eval_helpers.rb:79:in `evaluate_method'
  state_machine (1.2.0) lib/state_machine/callback.rb:191:in `block in run_methods'
  state_machine (1.2.0) lib/state_machine/callback.rb:190:in `each'
  state_machine (1.2.0) lib/state_machine/callback.rb:190:in `run_methods'
  state_machine (1.2.0) lib/state_machine/callback.rb:159:in `call'
  state_machine (1.2.0) lib/state_machine/transition.rb:450:in `block (2 levels) in after'
  state_machine (1.2.0) lib/state_machine/transition.rb:450:in `each'
  state_machine (1.2.0) lib/state_machine/transition.rb:450:in `block in after'
  state_machine (1.2.0) lib/state_machine/transition.rb:448:in `catch'
  state_machine (1.2.0) lib/state_machine/transition.rb:448:in `after'
  state_machine (1.2.0) lib/state_machine/transition.rb:251:in `run_callbacks'
  state_machine (1.2.0) lib/state_machine/transition_collection.rb:127:in `run_callbacks'
  state_machine (1.2.0) lib/state_machine/transition_collection.rb:212:in `run_callbacks'
  state_machine (1.2.0) lib/state_machine/transition_collection.rb:63:in `block (2 levels) in perform'
  state_machine (1.2.0) lib/state_machine/transition_collection.rb:63:in `catch'
  state_machine (1.2.0) lib/state_machine/transition_collection.rb:63:in `block in perform'
  state_machine (1.2.0) lib/state_machine/transition_collection.rb:186:in `within_transaction'
  state_machine (1.2.0) lib/state_machine/transition_collection.rb:62:in `perform'
  state_machine (1.2.0) lib/state_machine/integrations/mongoid.rb:440:in `around_save'
  state_machine (1.2.0) lib/state_machine/integrations/mongoid/versions.rb:36:in `update'
  mongoid (2.6.0) lib/mongoid/persistence.rb:189:in `upsert'
  state_machine (1.2.0) lib/state_machine/transition_collection.rb:154:in `block (2 levels) in run_actions'
  state_machine (1.2.0) lib/state_machine/transition_collection.rb:154:in `each'
  state_machine (1.2.0) lib/state_machine/transition_collection.rb:154:in `block in run_actions'
  state_machine (1.2.0) lib/state_machine/transition_collection.rb:170:in `catch_exceptions'
  state_machine (1.2.0) lib/state_machine/transition_collection.rb:148:in `run_actions'
  state_machine (1.2.0) lib/state_machine/transition_collection.rb:60:in `perform'
  state_machine (1.2.0) lib/state_machine/transition.rb:219:in `perform'
  state_machine (1.2.0) lib/state_machine/event.rb:172:in `fire'
  state_machine (1.2.0) lib/state_machine/event.rb:247:in `block in add_actions'
  state_machine (1.2.0) lib/state_machine/machine.rb:765:in `call'
  state_machine (1.2.0) lib/state_machine/machine.rb:765:in `block (2 levels) in define_helper'
  govuk_content_models (6.1.0) app/models/workflow_actor.rb:31:in `take_action'
  govuk_content_models (6.1.0) app/models/workflow_actor.rb:117:in `publish'
  govuk_content_models (6.1.0) app/models/workflow_actor.rb:47:in `progress'
  lib/edition_progressor.rb:22:in `progress'
  app/controllers/admin/editions_controller.rb:107:in `progress'
  actionpack (3.2.16) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (3.2.16) lib/abstract_controller/base.rb:167:in `process_action'
  actionpack (3.2.16) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (3.2.16) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (3.2.16) lib/active_support/callbacks.rb:447:in `_run__3070227690071231848__process_action__1793130796971917516__callbacks'
  activesupport (3.2.16) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.16) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  activesupport (3.2.16) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.16) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (3.2.16) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (3.2.16) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  activesupport (3.2.16) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.16) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.16) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.16) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  actionpack (3.2.16) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  actionpack (3.2.16) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.16) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.2.16) lib/action_controller/metal.rb:203:in `dispatch'
  actionpack (3.2.16) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  actionpack (3.2.16) lib/action_controller/metal.rb:246:in `block in action'
  actionpack (3.2.16) lib/action_dispatch/routing/route_set.rb:73:in `call'
  actionpack (3.2.16) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  actionpack (3.2.16) lib/action_dispatch/routing/route_set.rb:36:in `call'
  journey (1.0.4) lib/journey/router.rb:68:in `block in call'
  journey (1.0.4) lib/journey/router.rb:56:in `each'
  journey (1.0.4) lib/journey/router.rb:56:in `call'
  actionpack (3.2.16) lib/action_dispatch/routing/route_set.rb:608:in `call'
  mongoid (2.6.0) lib/rack/mongoid/middleware/identity_map.rb:33:in `block in call'
  mongoid (2.6.0) lib/mongoid.rb:133:in `unit_of_work'
  mongoid (2.6.0) lib/rack/mongoid/middleware/identity_map.rb:33:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `catch'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  omniauth (1.2.1) lib/omniauth/strategy.rb:186:in `call!'
  omniauth (1.2.1) lib/omniauth/strategy.rb:164:in `call'
  omniauth (1.2.1) lib/omniauth/builder.rb:59:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.4.5) lib/rack/etag.rb:23:in `call'
  rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
  rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.16) lib/active_support/callbacks.rb:405:in `_run__1228065723002945204__call__894739461000894396__callbacks'
  activesupport (3.2.16) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.16) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.16) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.16) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  rack (1.4.5) lib/rack/sendfile.rb:102:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  lograge (0.2.0) lib/lograge/rails_ext/rack/logger.rb:14:in `call_app'
  railties (3.2.16) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.16) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.16) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.16) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  railties (3.2.16) lib/rails/engine.rb:484:in `call'
  railties (3.2.16) lib/rails/application.rb:231:in `call'
  railties (3.2.16) lib/rails/railtie/configurable.rb:30:in `method_missing'
  thin (1.5.1) lib/thin/connection.rb:81:in `block in pre_process'
  thin (1.5.1) lib/thin/connection.rb:79:in `catch'
  thin (1.5.1) lib/thin/connection.rb:79:in `pre_process'
  thin (1.5.1) lib/thin/connection.rb:54:in `process'
  thin (1.5.1) lib/thin/connection.rb:39:in `receive_data'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run_machine'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
  thin (1.5.1) lib/thin/backends/base.rb:63:in `start'
  thin (1.5.1) lib/thin/server.rb:159:in `start'
  thin (1.5.1) lib/thin/controllers/controller.rb:86:in `start'
  thin (1.5.1) lib/thin/runner.rb:187:in `run_command'
  thin (1.5.1) lib/thin/runner.rb:152:in `run!'
  thin (1.5.1) bin/thin:6:in `<top (required)>'
  /var/www/publisher/shared/bundle/ruby/1.9.1/bin/thin:23:in `load'
  /var/www/publisher/shared/bundle/ruby/1.9.1/bin/thin:23:in `<main>'

In the Panopticon logs:

method=PUT path=/artefacts/introducing-csvlint.json format=json controller=artefacts action=update status=0 duration=0.95

NoMethodError (undefined method `[]' for nil:NilClass):
  actionpack (3.2.16) lib/action_dispatch/middleware/best_standards_support.rb:19:in `call'
  rack (1.4.5) lib/rack/etag.rb:23:in `call'
  rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
  rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.16) lib/active_support/callbacks.rb:405:in `_run__2731846107470098834__call__1278511916807247331__callbacks'
  activesupport (3.2.16) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.16) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.16) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.16) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  airbrake (3.1.15) lib/airbrake/rails/middleware.rb:13:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  lograge (0.1.2) lib/lograge/rails_ext/rack/logger.rb:14:in `call_app'
  railties (3.2.16) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.16) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.16) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.16) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.16) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  airbrake (3.1.15) lib/airbrake/user_informer.rb:16:in `_call'
  airbrake (3.1.15) lib/airbrake/user_informer.rb:12:in `call'
  railties (3.2.16) lib/rails/engine.rb:484:in `call'
  railties (3.2.16) lib/rails/application.rb:231:in `call'
  railties (3.2.16) lib/rails/railtie/configurable.rb:30:in `method_missing'
  thin (1.5.1) lib/thin/connection.rb:81:in `block in pre_process'
  thin (1.5.1) lib/thin/connection.rb:79:in `catch'
  thin (1.5.1) lib/thin/connection.rb:79:in `pre_process'
  thin (1.5.1) lib/thin/connection.rb:54:in `process'
  thin (1.5.1) lib/thin/connection.rb:39:in `receive_data'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run_machine'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
  thin (1.5.1) lib/thin/backends/base.rb:63:in `start'
  thin (1.5.1) lib/thin/server.rb:159:in `start'
  thin (1.5.1) lib/thin/controllers/controller.rb:86:in `start'
  thin (1.5.1) lib/thin/runner.rb:187:in `run_command'
  thin (1.5.1) lib/thin/runner.rb:152:in `run!'
  thin (1.5.1) bin/thin:6:in `<top (required)>'
  /var/www/panopticon/shared/bundle/ruby/1.9.1/bin/thin:23:in `load'
  /var/www/panopticon/shared/bundle/ruby/1.9.1/bin/thin:23:in `<main>'
Floppy commented 10 years ago

Fix under https://github.com/theodi/shared/issues/202

Floppy commented 10 years ago

Panopticon error is thrown at https://github.com/rails/rails/blob/3-2-stable/actionpack/lib/action_dispatch/middleware/best_standards_support.rb#L19

Floppy commented 10 years ago

That error stack report has to be bollocks.