Skip to content

Engine reports "successfully started" when the web server failed to start #622

Backlog

Description

@MichaelLeeHobbs

If the web server fails to start, the engine logs a WARN and carries on. It deploys channels, processes messages and logs "server successfully started", but nothing listens on the HTTP or HTTPS port. So the REST API, the Administrator and the web admin are unreachable, a fronting proxy returns 502, and the only sign is a WARN with a stack trace above a success message.

Where

  • Mirth.java:478: startWebServer() catches any exception from new MirthWebServer(...) or startup(), logs Could not start web server. at WARN, and sets webServer to null.
  • Mirth.java:352: startup continues to startEngine() regardless.
  • Mirth.java:401: printSplashScreen() then logs "server successfully started".

How to reproduce

Anything that makes MirthWebServer throw will do. pacmano1 saw it on a #620 build with server.api.trustedproxies = 172.30.0.10x: both connectors down, channels running, and "server successfully started" in the log. From reading the code, setting https.port to a port that's already in use should do the same on main, since the bind failure in startup() lands in the same catch. I haven't run that one.

Why it matters

This came up in review of #620, where a bad server.api.trustedproxies value threw from the constructor (fixed there). Any startup failure in the web server has the same outcome: an engine that looks healthy in its log and keeps moving messages, but can't be managed, with the cause logged as a warning.

Possible fixes

  • Log the failure at ERROR and don't log "successfully started" when the web server isn't running.
  • Or treat it as fatal and stop startup, since an engine nobody can manage is hard to notice and fix.

The second is a behavior change; I'd go with the first unless maintainers prefer failing fast.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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