Skip to content

Honeybadger middleware breaks Rails error messages in development (with Passenger?) #735

@matt17r

Description

@matt17r

Description

Since adding Honeybadger, most (but not all) local errors no longer display in my web browser in development. Instead of the nice(?) red HTML error message screen for pending migrations or unprocessable_content errors, I now just see an unstyled "Bad gateway" <h1> in the web browser and this in the logs:

[ E 2025-09-10 05:44:13.0349 46460/Tb age/Cor/Con/ForwardResponse.cpp:121 ]: [Client 2-1] Error parsing application response header: Bad request (request may not contain both Content-Length and Transfer-Encoding)

Missing routes continue to show the expected Rails HTML error so it's not all error messages.

Environment

Honeybadger gem version: 6.0.6
Rails version: 8.0.2.1
Ruby version: 3.4.4 (2025-05-14 revision a38531fd3f) +PRISM [arm64-darwin24]
Passenger version: 6.0.27
Middleware:

> bin/rails middleware
use Honeybadger::Rack::UserInformer
use Honeybadger::Rack::UserFeedback
use Honeybadger::Rack::ErrorNotifier
use ActionDispatch::HostAuthorization
use Rack::Sendfile
use ActionDispatch::Static
use ActionDispatch::Executor
use ActionDispatch::ServerTiming
use ActiveSupport::Cache::Strategy::LocalCache::Middleware
use Rack::Runtime
use Rack::MethodOverride
use ActionDispatch::RequestId
use ActionDispatch::RemoteIp
use Propshaft::QuietAssets
use Rails::Rack::Logger
use ActionDispatch::ShowExceptions
use WebConsole::Middleware
use ActionDispatch::DebugExceptions
use ActionDispatch::ActionableExceptions
use ActionDispatch::Reloader
use ActionDispatch::Callbacks
use ActiveRecord::Migration::CheckPending
use ActionDispatch::Cookies
use ActionDispatch::Session::CookieStore
use ActionDispatch::Flash
use ActionDispatch::ContentSecurityPolicy::Middleware
use ActionDispatch::PermissionsPolicy::Middleware
use Rack::Head
use Rack::ConditionalGet
use Rack::ETag
use Rack::TempfileReaper
use Warden::Manager
use Flipper::Middleware::Memoizer
run Philoi::Application.routes

Workaround

Removing the middleware in development seems to avoid the issue:

# config/environments/development.rb
require "active_support/core_ext/integer/time"

Rails.application.configure do
  #snip
  config.middleware.delete Honeybadger::Rack::UserInformer
  config.middleware.delete Honeybadger::Rack::UserFeedback
end

I have not tried a different web server in development.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions