{"record":{"id":"4700c8af5e9f6491","repo":"linera-io/linera-protocol","slug":"failed-to-start-nickname","errorCode":null,"errorMessage":"Failed to start {nickname}","messagePattern":"Failed to start (.+?)","errorType":"exception","errorClass":"anyhow","httpStatus":null,"severity":"error","filePath":"linera-service/src/cli_wrappers/local_net.rs","lineNumber":925,"sourceCode":"                    .context(\"endpoint should always parse\")?\n                    .tls_config(tls_config)?\n            }\n            _ => bail!(\"Only supported scheme are http and https\"),\n        };\n        let connection = endpoint.connect_lazy();\n        let mut client = HealthClient::new(connection);\n        linera_base::time::timer::sleep(Duration::from_millis(100)).await;\n        for i in 0..10 {\n            linera_base::time::timer::sleep(Duration::from_millis(i * 500)).await;\n            let result = client.check(HealthCheckRequest::default()).await;\n            if result.is_ok() && result.unwrap().get_ref().status() == ServingStatus::Serving {\n                info!(?port, \"Successfully started {nickname}\");\n                return Ok(());\n            } else {\n                warn!(\"Waiting for {nickname} to start\");\n            }\n        }\n        bail!(\"Failed to start {nickname}\");\n    }\n\n    async fn ensure_simple_server_has_started(\n        nickname: &str,\n        port: usize,\n        protocol: &str,\n    ) -> Result<()> {\n        use linera_core::node::ValidatorNode as _;\n\n        let options = linera_rpc::NodeOptions {\n            send_timeout: Duration::from_secs(5),\n            recv_timeout: Duration::from_secs(5),\n            retry_delay: Duration::from_secs(1),\n            max_retries: 1,\n            ..Default::default()\n        };\n        let provider = linera_rpc::simple::SimpleNodeProvider::new(options);\n        let address = format!(\"{protocol}:127.0.0.1:{port}\");","sourceCodeStart":907,"sourceCodeEnd":943,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-service/src/cli_wrappers/local_net.rs#L907-L943","documentation":"`ensure_grpc_server_has_started` spawns nothing itself but polls the gRPC health service (tonic `HealthClient`) at the given port up to 10 times with growing sleeps (100ms + i*500ms), logging 'Waiting for {nickname} to start' each round. If the service never reports `Serving`, it bails with this message — the preceding warn logs are the only diagnostics, so the actual crash reason lives in the spawned process.","triggerScenarios":"A validator, proxy, or block-exporter gRPC process spawned by the local net never becomes healthy within the ~10-probe budget: it crashed on startup, the port is already taken, the binary is missing, or (on grpcs nets) the TLS setup does not line up.","commonSituations":"Port already held by a stale process from an earlier aborted run; the server binary missing from PATH/target; slow machines where startup exceeds the fixed polling budget; leftover net not torn down with `linera net down`.","solutions":["Check the warn logs just above the bail — they name the port/nickname that never came up","Free the port (`lsof -i :<port>` then kill the stale process) and retry","Confirm the server binary exists and runs standalone with the same arguments","Tear down and re-create the net: `linera net down` then `linera net up`"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# Pre-flight: confirm the port is bindable before starting the net\nport=9100\nif lsof -i :$port >/dev/null 2>&1; then echo \"port $port busy\"; exit 1; fi","typeGuard":null,"tryCatchPattern":"match LocalNet::ensure_grpc_server_has_started(&nickname, port, scheme).await {\n    Err(e) if e.to_string().contains(\"Failed to start\") => {\n        // helper already retried 10x with backoff; failure is structural:\n        // free the port / fix the binary, then rebuild the net\n        cleanup_and_recreate_net().await?;\n    }\n    result => result?,\n}","preventionTips":["Always tear nets down with `linera net down` (and kill leaked children) before starting new ones","Check the preceding 'Waiting for {nickname} to start' warns — they name the exact port that failed","On slow machines, verify the server binary starts standalone before blaming the helper's timeout"],"tags":["local-net","grpc","startup","health-check","cli-wrappers"],"backgroundTag":"service-startup-timeout","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}