{"record":{"id":"f80699f70f01e318","repo":"FuelLabs/fuel-core","slug":"the-state-of-the-service-is-not-started-state","errorCode":null,"errorMessage":"The state of the service is not started: {state:?}","messagePattern":"The state of the service is not started: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/fuel-core/src/service.rs","lineNumber":235,"sourceCode":"            Default::default(),\n            Default::default(),\n            #[cfg(feature = \"rpc\")]\n            Default::default(),\n        );\n        Self::from_combined_database(combined_database, config).await\n    }\n\n    /// Creates and starts fuel node instance from service config and a pre-existing combined database\n    pub async fn from_combined_database(\n        combined_database: CombinedDatabase,\n        config: Config,\n    ) -> anyhow::Result<Self> {\n        let mut listener = crate::ShutdownListener::spawn();\n        let service = Self::new(combined_database, config, &mut listener)?;\n        let state = service.start_and_await().await?;\n\n        if !state.started() {\n            return Err(anyhow::anyhow!(\n                \"The state of the service is not started: {state:?}\"\n            ));\n        }\n        Ok(service)\n    }\n\n    #[cfg(feature = \"relayer\")]\n    /// Wait for the Relayer to be in sync with\n    /// the data availability layer.\n    ///\n    /// Yields until the relayer reaches a point where it\n    /// considered up to date. Note that there's no guarantee\n    /// the relayer will ever catch up to the da layer and\n    /// may fall behind immediately after this future completes.\n    ///\n    /// The only guarantee is that if this future completes then\n    /// the relayer did reach consistency with the da layer for\n    /// some period of time.","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/fuel-core/src/service.rs#L217-L253","documentation":"Service::from_combined_database builds a node from an existing CombinedDatabase, starts it, and awaits the state transition. If the resulting state is anything but Started (e.g. Stopped/Stopping), startup failed or a shutdown raced it, and this error is returned.","triggerScenarios":"Embedding fuel-core and calling from_combined_database when a subsystem fails during start (bad DB, port conflicts, misconfigured relayer) or when a shutdown signal arrives while start_and_await is pending — the service settles into a non-Started state.","commonSituations":"Custom node binaries reusing a database; CI tests that trigger shutdown early; a failing component (relayer, compression, gas price service) that stops the runner during boot; version mismatch between stored DB state and binary.","solutions":["Check node logs for the underlying subsystem failure that preceded the shutdown — this error is only the symptom","Ensure the database files are compatible with this fuel-core version and not corrupted","Avoid sending shutdown signals until start has completed; sequence startup fully before teardown","Use Service::new + explicit start if you need to inspect the state machine yourself"],"exampleFix":"// before\nlet service = Service::from_combined_database(db, config).await?; // opaque failure\n\n// after\nlet mut listener = ShutdownListener::spawn();\nlet service = Service::new(db, config, &mut listener)?;\nlet state = service.start_and_await().await?;\ntracing::info!(?state, \"node state\"); // inspect why it is not Started\nif !state.started() { /* inspect logs / handle */ }","handlingStrategy":"try-catch","validationCode":"// Rust embedder: pre-flight the pieces start() needs\nfn preflight(db: &CombinedDatabase, config: &Config) -> anyhow::Result<()> {\n    db.on_chain().latest_view()?; // DB readable\n    ensure_free_port(&config.graphql_config.addr)?;\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match Service::from_combined_database(db, config).await { Err(e) if e.to_string().contains(\"state of the service is not started\") => { /* scan logs for the failing subsystem; verify DB compatibility; do not resend shutdown early */ } r => r }","preventionTips":["This error is a symptom — always inspect the subsystem error logged just before it","Verify the CombinedDatabase was produced by a compatible fuel-core version","Sequence shutdown strictly after startup completes","Prefer Service::new + start_and_await when you need to observe intermediate states"],"tags":["node","startup","service","database","embedding"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}