Skip to main content

HTTP server error codes (mpbx run)

Raised while mpbx run starts its HTTP server (the REST API, the API docs and, when http.web_dir is set, the built web client; W1-WEB-01). Both stop the process at start-up, so they appear in the log and the exit status, never in an HTTP response. The test every_server_code_is_documented in pbx/bin/mpbx/src/static_files.rs keeps this page and the code in step.

CodeKindMeaningWhat to do
MPBX-HTTP-WEB-DIRconfighttp.web_dir (MPBX__HTTP__WEB_DIR) names a directory that does not exist, cannot be read, or has no index.html. The message names the path and the reason. The server does not start without the web client it was told to serve.Build the web client (npm run build in web/mpbx, output dist/mpbx/browser) and point http.web_dir at that directory, or unset http.web_dir to serve the web client embedded in the binary (the production image has one; a binary built without MPBX_WEB_DIST serves the API only).
MPBX-HTTP-CONNECT-SRCconfigAn http.connect_src entry (MPBX__HTTP__CONNECT_SRC) is not a wss:// or https:// origin (host with an optional *. prefix and port, no path, no quotes or spaces). The message names the entry. The server does not start with a Content Security Policy it cannot build safely.Write each entry as an origin, for example wss://sip.example.com:7443. The sip.listen_wss ports under http.base_domain are allowed without an entry.
MPBX-HTTP-LISTENunavailableThe server cannot listen on http.listen (MPBX__HTTP__LISTEN): the port is already in use, the address does not belong to this host, or the process may not bind a port below 1024. The message names the address and the operating-system error.Stop whatever holds the port (lsof -i :<port>), pick a free http.listen, or run on a port above 1024 behind your reverse proxy.