{"record":{"id":"f81772281e0a5274","repo":"influxdata/influxdb","slug":"failed-to-bind-address","errorCode":null,"errorMessage":"Failed to bind address","messagePattern":"Failed to bind address","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3/src/commands/serve.rs","lineNumber":126,"sourceCode":"\nconst MIN_SNAPSHOTS_TO_LOAD_ON_START: u64 = 100;\n\nmod cli_params;\n#[cfg(test)]\nmod tests;\n\n#[derive(Debug, Error)]\npub enum Error {\n    #[error(\"Cannot parse object store config: {0}\")]\n    ObjectStoreParsing(#[from] influxdb3_clap_blocks::object_store::ParseError),\n\n    #[error(\"Tracing config error: {0}\")]\n    TracingConfig(#[from] trace_exporters::Error),\n\n    #[error(\"Error initializing tokio runtime: {0}\")]\n    TokioRuntime(#[source] std::io::Error),\n\n    #[error(\"Failed to bind address\")]\n    BindAddress(#[source] std::io::Error),\n\n    #[error(\"Server error: {0}\")]\n    Server(#[source] influxdb3_server::Error),\n\n    #[error(\"Token error: {0}\")]\n    TokenError(CatalogError),\n\n    #[error(\"Write buffer error: {0}\")]\n    WriteBuffer(#[from] influxdb3_write::write_buffer::Error),\n\n    #[error(\"invalid token: {0}\")]\n    InvalidToken(#[from] hex::FromHexError),\n\n    #[error(\"failed to initialize write buffer: {0:?}\")]\n    WriteBufferInit(#[source] anyhow::Error),\n\n    #[error(\"failed to initialize catalog: {0}\")]","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3/src/commands/serve.rs#L108-L144","documentation":"A serve-command `Error` variant (`BindAddress`) with a `std::io::Error` source, returned when the HTTP server cannot bind to the configured listen address. The most common underlying cause is the port already being in use, or lacking permission to bind the address/port.","triggerScenarios":"`influxdb3 serve` tries to bind the HTTP (or gRPC/trace) listener address and the OS refuses — EADDRINUSE, EACCES on privileged ports, or invalid bind address.","commonSituations":"Another influxdb3 instance still running on the default 8181 port; binding to a port <1024 without root; binding to an IP not assigned to the host; leftover docker container holding the port.","solutions":["Free the port: find and stop the process using it (`lsof -i :8181` / `ss -ltnp`).","Bind to a different `--http-bind-address` port.","Use an unprivileged port or run with appropriate permissions; verify the host/IP is valid."],"exampleFix":"// before\ninfluxdb3 serve --http-bind-address 0.0.0.0:8181  # port already in use\n// after\ninfluxdb3 serve --http-bind-address 0.0.0.0:8182","handlingStrategy":"validation","validationCode":"use std::net::TcpListener;\nassert!(TcpListener::bind((\"0.0.0.0\", 8181)).is_ok(), \"port 8181 already in use\");","typeGuard":null,"tryCatchPattern":"match serve(config) {\n    Err(serve::Error::BindAddress(io)) if io.kind() == std::io::ErrorKind::AddrInUse => {\n        eprintln!(\"port in use; pick another --http-bind-address\");\n    }\n    Err(e) => return Err(e.into()),\n    Ok(_) => {}\n}","preventionTips":["Pre-flight check the bind port before starting serve","Use distinct ports per instance in dev/docker environments","Never bind privileged ports without appropriate capabilities"],"tags":["rust","network","bind","port-conflict"],"backgroundTag":"address-already-in-use","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}