{"record":{"id":"9b463ce606a46e1b","repo":"tinyhumansai/openhuman","slug":"daemonlifecycle-auto-start-failed","errorCode":null,"errorMessage":"[DaemonLifecycle] Auto-start failed:","messagePattern":"\\[DaemonLifecycle\\] Auto-start failed:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/hooks/useDaemonLifecycle.ts","lineNumber":86,"sourceCode":"      latestLifecycleRef.current;\n\n    if (!isTauri() || !isAutoStartEnabled || !isMountedRef.current) {\n      return;\n    }\n\n    // Only auto-start if daemon is disconnected and not already recovering\n    if (status === 'disconnected' && !isRecovering && connectionAttempts === 0) {\n      console.log('[DaemonLifecycle] Attempting auto-start of daemon');\n\n      try {\n        setIsRecovering(uid, true);\n        const result = await startDaemon();\n\n        if (result?.result && result.result.state === 'Running') {\n          console.log('[DaemonLifecycle] Auto-start successful');\n          resetConnectionAttempts(uid);\n        } else {\n          console.warn('[DaemonLifecycle] Auto-start failed:', result);\n          incrementConnectionAttempts(uid);\n        }\n      } catch (error) {\n        console.error('[DaemonLifecycle] Auto-start error:', error);\n        incrementConnectionAttempts(uid);\n      } finally {\n        setIsRecovering(uid, false);\n      }\n    }\n  }, []);\n\n  // Retry connection with exponential backoff\n  const scheduleRetry = useCallback(() => {\n    const { connectionAttempts, status, isRecovering } = latestLifecycleRef.current;\n\n    if (!isTauri() || !isMountedRef.current || isRecovering) {\n      return;\n    }","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/hooks/useDaemonLifecycle.ts#L68-L104","documentation":"Auto-starting the daemon failed during the lifecycle hook's one-time auto-start attempt (status was 'disconnected', no recovery in flight, zero prior attempts): startDaemon either threw or returned a non-Running state. The handler increments the connection-attempts counter, which consumes one of the bounded MAX_RECONNECTION_ATTEMPTS before the exponential-backoff retry path takes over.","triggerScenarios":"Thrown at app/src/hooks/useDaemonLifecycle.ts:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the logged error/result for the daemon start failure (port conflict, permissions, missing binary)","Verify the core/daemon service dependencies are installed and healthy via Settings diagnostics","The hook transitions to its retry schedule automatically — monitor whether retries succeed","If attempts are exhausted, restart the app to reset the lifecycle state"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}