{"record":{"id":"a1ff3a430ccb3371","repo":"netbirdio/netbird","slug":"get-sync-response-w","errorCode":null,"errorMessage":"get sync response: %w","messagePattern":"get sync response: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/embed/embed.go","lineNumber":489,"sourceCode":"\t\tengine := connect.Engine()\n\t\tif engine != nil {\n\t\t\t_ = engine.RunHealthProbes(context.Background(), false)\n\t\t}\n\t}\n\n\treturn c.recorder.GetFullStatus(), nil\n}\n\n// GetLatestSyncResponse returns the latest sync response from the management server.\nfunc (c *Client) GetLatestSyncResponse() (*mgmProto.SyncResponse, error) {\n\tengine, err := c.getEngine()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsyncResp, err := engine.GetLatestSyncResponse()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"get sync response: %w\", err)\n\t}\n\n\treturn syncResp, nil\n}\n\n// SetLogLevel sets the logging level for the client and its components.\nfunc (c *Client) SetLogLevel(levelStr string) error {\n\tlevel, err := logrus.ParseLevel(levelStr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"parse log level: %w\", err)\n\t}\n\n\tlogrus.SetLevel(level)\n\n\tc.mu.Lock()\n\tconnect := c.connect\n\tc.mu.Unlock()\n","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/embed/embed.go#L471-L507","documentation":"Returned by Client.GetLatestSyncResponse when Engine.GetLatestSyncResponse fails. The engine returns \"sync response persistence is disabled\" when no sync store is configured, and the store's Get can fail on read/parse errors. The embedded client enables sync persistence (SetSyncResponsePersistence(true)) in Start, so on a healthy started client the store exists and the error means either persistence was not enabled on this engine or the stored state could not be read.","triggerScenarios":"Calling GetLatestSyncResponse on an engine whose persistence was disabled (e.g. paths through internal clients that never enable it), or when the persisted sync state file is corrupt/unreadable. Note the embed Start also requires a successful sync before the engine reports up, so an empty-but-valid store is normal early.","commonSituations":"Persisted state directory deleted or corrupted mid-run (StatePath on ephemeral storage); a code path that uses the engine before Start completed its first sync; disk full at the time the state was written.","solutions":["Ensure you call GetLatestSyncResponse only after a successful Start, which is what enables persistence for the embedded client.","If the wrapped error is a read/parse failure, remove or reset the DNS/state file at StatePath and restart the client to repopulate it.","Handle a missing latest response gracefully: no sync has completed yet is a normal state, not a hard failure."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if _, err := client.GetLatestSyncResponse(); err != nil {\n    // safe to call only after Start returned nil; gate on your own started flag\n}","typeGuard":null,"tryCatchPattern":"resp, err := client.GetLatestSyncResponse()\nif err != nil {\n    if strings.Contains(err.Error(), \"persistence is disabled\") {\n        // called on an engine where persistence was never enabled: not retried away\n    }\n    // treat as no-sync-yet and continue degraded\n}","preventionTips":["Call GetLatestSyncResponse only after Start succeeds; that is what enables persistence for the embedded client.","Keep StatePath on durable storage and treat a corrupt state file as recoverable by delete-and-restart."],"tags":["sync","persistence","state","embed"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}