{"record":{"id":"44b9024fee068c8a","repo":"netbirdio/netbird","slug":"engine-is-not-running","errorCode":null,"errorMessage":"engine is not running","messagePattern":"engine is not running","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"client/android/client.go","lineNumber":544,"sourceCode":"// SetConnectionListener set the network connection listener\nfunc (c *Client) SetConnectionListener(listener ConnectionListener) {\n\tc.recorder.SetConnectionListener(listener)\n}\n\n// RemoveConnectionListener remove connection listener\nfunc (c *Client) RemoveConnectionListener() {\n\tc.recorder.RemoveConnectionListener()\n}\n\nfunc (c *Client) getRouteManager() (routemanager.Manager, error) {\n\tclient := c.getConnectClient()\n\tif client == nil {\n\t\treturn nil, fmt.Errorf(\"not connected\")\n\t}\n\n\tengine := client.Engine()\n\tif engine == nil {\n\t\treturn nil, fmt.Errorf(\"engine is not running\")\n\t}\n\n\tmanager := engine.GetRouteManager()\n\tif manager == nil {\n\t\treturn nil, fmt.Errorf(\"could not get route manager\")\n\t}\n\n\treturn manager, nil\n}\n\nfunc (c *Client) SelectRoute(id string) error {\n\tmanager, err := c.getRouteManager()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn manager.SelectRoutes([]route.NetID{route.NetID(id)}, true)\n}","sourceCodeStart":526,"sourceCodeEnd":562,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/android/client.go#L526-L562","documentation":"Second gate in Android Client.getRouteManager: the connect client exists, but client.Engine() returns nil, so the engine has not started (or already stopped). Route APIs that need the running engine's route manager fail with this error until the engine is up again.","triggerScenarios":"Route API calls racing engine startup; calling route APIs after Disconnect stopped the engine while the connect client object still exists.","commonSituations":"Disconnect racing a route selection in the UI; engine start failure leaving a half-initialized client.","solutions":["Wait for the connected/running status before issuing route operations.","After calling Disconnect, stop issuing route API calls.","If this persists while connected, check the engine start logs for the underlying failure."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure the engine is live before route operations\nclient := getConnectClient()\nif client == nil || client.Engine() == nil {\n    return fmt.Errorf(\"route APIs require the engine to be running\")\n}","typeGuard":null,"tryCatchPattern":"if err := client.SelectRoute(id); err != nil {\n    if err.Error() == \"engine is not running\" {\n        // engine stopped or still starting: wait for the connected status and retry\n    }\n}","preventionTips":["Wait for the connected status event before enabling route selection in the UI.","Stop issuing route API calls immediately after Disconnect.","If the error persists while connected, investigate engine start failures in the logs."],"tags":["android","routes","lifecycle","engine","precondition"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}