{"action":"closed","issue":{"url":"https://api.github.com/repos/mysociety/alaveteli/issues/2642","labels_url":"https://api.github.com/repos/mysociety/alaveteli/issues/2642/labels{/name}","comments_url":"https://api.github.com/repos/mysociety/alaveteli/issues/2642/comments","events_url":"https://api.github.com/repos/mysociety/alaveteli/issues/2642/events","html_url":"https://github.com/mysociety/alaveteli/issues/2642","id":93993816,"number":2642,"title":"request#get_attachment_as_html (ArgumentError) \"invalid byte sequence in UTF-8\"","user":{"login":"crowbot","id":2912,"avatar_url":"https://avatars.githubusercontent.com/u/2912?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbot","html_url":"https://github.com/crowbot","followers_url":"https://api.github.com/users/crowbot/followers","following_url":"https://api.github.com/users/crowbot/following{/other_user}","gists_url":"https://api.github.com/users/crowbot/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbot/subscriptions","organizations_url":"https://api.github.com/users/crowbot/orgs","repos_url":"https://api.github.com/users/crowbot/repos","events_url":"https://api.github.com/users/crowbot/events{/privacy}","received_events_url":"https://api.github.com/users/crowbot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mysociety/alaveteli/labels/6%20-%20awaiting%20deploy","name":"6 - awaiting deploy","color":"e11d21"},{"url":"https://api.github.com/repos/mysociety/alaveteli/labels/bug","name":"bug","color":"AE0902"},{"url":"https://api.github.com/repos/mysociety/alaveteli/labels/uk","name":"uk","color":"bfdadc"}],"state":"closed","locked":false,"assignee":{"login":"crowbot","id":2912,"avatar_url":"https://avatars.githubusercontent.com/u/2912?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbot","html_url":"https://github.com/crowbot","followers_url":"https://api.github.com/users/crowbot/followers","following_url":"https://api.github.com/users/crowbot/following{/other_user}","gists_url":"https://api.github.com/users/crowbot/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbot/subscriptions","organizations_url":"https://api.github.com/users/crowbot/orgs","repos_url":"https://api.github.com/users/crowbot/repos","events_url":"https://api.github.com/users/crowbot/events{/privacy}","received_events_url":"https://api.github.com/users/crowbot/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-07-09T08:50:46Z","updated_at":"2015-11-17T18:05:19Z","closed_at":"2015-11-17T18:05:19Z","body":"https://www.whatdotheyknow.com/request/258849/response/674070/attach/html/4/FOI%20Reply%20W%20Evans%2002%2007%2015.pdf.html\r\n\r\n```\r\nlib/attachment_to_html/adapters/pdf.rb:33:in `match'\r\n  lib/attachment_to_html/adapters/pdf.rb:33:in `match'\r\n  lib/attachment_to_html/adapters/pdf.rb:33:in `parse_body'\r\n  lib/attachment_to_html/adapter.rb:25:in `body'\r\n  lib/attachment_to_html/adapters/pdf.rb:43:in `number_of_images_in_body'\r\n  lib/attachment_to_html/adapters/pdf.rb:39:in `contains_too_many_images?'\r\n  lib/attachment_to_html/adapters/pdf.rb:25:in `success?'\r\n  lib/attachment_to_html/attachment_to_html.rb:16:in `to_html'\r\n  app/models/foi_attachment.rb:304:in `body_as_html'\r\n  app/controllers/request_controller.rb:791:in `get_attachment_as_html'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal/implicit_render.rb:4:in `send_action'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/abstract_controller/base.rb:167:in `process_action'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal/rendering.rb:10:in `process_action'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/abstract_controller/callbacks.rb:18:in `block in process_action'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:603:in `block (2 levels) in _run__2716609602767634867__process_action__4378375630055329664__callbacks'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_1162'\r\n  app/controllers/request_controller.rb:741:in `cache_attachments'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_1162'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:602:in `block in _run__2716609602767634867__process_action__4378375630055329664__callbacks'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_1161'\r\n  app/controllers/application_controller.rb:117:in `record_memory'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_1161'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:590:in `_run__2716609602767634867__process_action__4378375630055329664__callbacks'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/abstract_controller/callbacks.rb:17:in `process_action'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal/rescue.rb:29:in `process_action'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/notifications.rb:123:in `block in instrument'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/notifications/instrumenter.rb:20:in `instrument'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/notifications.rb:123:in `instrument'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal/instrumentation.rb:29:in `process_action'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'\r\n  vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/railties/controller_runtime.rb:18:in `process_action'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/rails3/action_controller.rb:28:in `block in process_action'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:352:in `perform_action_with_newrelic_trace'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/rails3/action_controller.rb:27:in `process_action'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/abstract_controller/base.rb:121:in `process'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/abstract_controller/rendering.rb:45:in `process'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal.rb:203:in `dispatch'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_controller/metal.rb:246:in `block in action'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb:73:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb:36:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'\r\n  vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'\r\n  vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb:608:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/rack/agent_hooks.rb:30:in `traced_call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/rack/browser_monitoring.rb:32:in `traced_call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/exception_notification-3.0.1/lib/exception_notifier.rb:41:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/rack-1.4.6/lib/rack/etag.rb:23:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/rack-1.4.6/lib/rack/conditionalget.rb:25:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/head.rb:14:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/params_parser.rb:21:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/flash.rb:242:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/rack-1.4.6/lib/rack/session/abstract/id.rb:210:in `context'\r\n  vendor/bundle/ruby/1.9.1/gems/rack-1.4.6/lib/rack/session/abstract/id.rb:205:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/cookies.rb:341:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/rack-ssl-1.3.4/lib/rack/ssl.rb:27:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  lib/whatdotheyknow/strip_empty_sessions.rb:15:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/query_cache.rb:64:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `_run__4382850875849791461__call__1082431019728527087__callbacks'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/callbacks.rb:27:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/railties-3.2.21/lib/rails/rack/logger.rb:32:in `call_app'\r\n  vendor/bundle/ruby/1.9.1/gems/railties-3.2.21/lib/rails/rack/logger.rb:16:in `block in call'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/tagged_logging.rb:22:in `tagged'\r\n  vendor/bundle/ruby/1.9.1/gems/railties-3.2.21/lib/rails/rack/logger.rb:16:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/request_id.rb:22:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/rack-1.4.6/lib/rack/methodoverride.rb:21:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/rack-1.4.6/lib/rack/runtime.rb:17:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/cache/strategy/local_cache.rb:72:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/rack-1.4.6/lib/rack/lock.rb:15:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.21/lib/action_dispatch/middleware/static.rb:83:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/rack-utf8_sanitizer-1.3.0/lib/rack/utf8_sanitizer.rb:15:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/railties-3.2.21/lib/rails/engine.rb:484:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/railties-3.2.21/lib/rails/application.rb:231:in `call'\r\n  vendor/bundle/ruby/1.9.1/gems/railties-3.2.21/lib/rails/railtie/configurable.rb:30:in `method_missing'\r\n  vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.12.0.288/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'\r\n  /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'\r\n  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'\r\n  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'\r\n  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'\r\n```"}}