{"record":{"id":"b04227a30fd2e278","repo":"thedotmack/claude-mem","slug":"pull-wedged-the-same-page-keeps-failing-backing","errorCode":null,"errorMessage":"Pull wedged: the same page keeps failing; backing off and retrying","messagePattern":"Pull wedged: the same page keeps failing; backing off and retrying","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/services/sync/SyncClient.ts","lineNumber":888,"sourceCode":"   * unmoved — log distinctly so the wedge is visible in the logs.\n   */\n  private recordFailure(error: unknown): void {\n    const err = error instanceof Error ? error : new Error(String(error));\n    let cursor: string | null = null;\n    try {\n      cursor = this.apply.getCursor();\n    } catch { /* DB may be closing — cursor stays null */ }\n    if (cursor === this.failCursor) {\n      this.failStreak++;\n    } else {\n      this.failCursor = cursor;\n      this.failStreak = 1;\n    }\n    this.backoffMs = this.backoffMs === 0\n      ? this.backoffInitialMs\n      : Math.min(this.backoffMs * 2, this.backoffMaxMs);\n    if (this.failStreak >= 3) {\n      logger.warn('SYNC_CLIENT', 'Pull wedged: the same page keeps failing; backing off and retrying', {\n        cursor,\n        failStreak: this.failStreak,\n        backoffMs: this.backoffMs,\n      }, err);\n    } else {\n      logger.debug('SYNC_CLIENT', 'Pull failed (non-blocking; will retry)', {\n        cursor,\n        backoffMs: this.backoffMs,\n      }, err);\n    }\n  }\n}\n","sourceCodeStart":870,"sourceCodeEnd":901,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/services/sync/SyncClient.ts#L870-L901","documentation":"SyncClient pull loop failed to advance: the same page cursor failed three or more consecutive times. Instead of crashing, the client logs a warning and applies exponential backoff (doubling from backoffInitialMs up to backoffMaxMs) before retrying the same cursor.","triggerScenarios":"The pull request for a given cursor throws repeatedly (>=3 consecutive failures on the same page) — e.g. persistent 5xx responses, network outage, or a corrupt/hub-side page that always errors.","commonSituations":"Hub server briefly down or restarting; network partition on a laptop; a hub bug that makes one specific page always fail; rate limiting responses.","solutions":["Wait — the client retries automatically with exponential backoff; check hub health in the meantime.","Inspect the logged `cursor` and `err` to see whether the failure is network-level or a hub data error.","If a specific page always fails (hub data bug), fix/remove the offending records on the hub or reset the epoch/cursor to force a re-pull.","Check hub logs and connectivity (DNS, VPN, proxy) if backoff never recovers."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"async function canReachHub(url) {\n  try { const r = await fetch(url + '/health'); return r.ok; } catch { return false; }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await client.pullPage(cursor);\n} catch (err) {\n  if (err instanceof Error && client.failStreak >= 3) {\n    await sleep(client.backoffMs); // client already backs off; just wait\n  }\n}","preventionTips":["Monitor hub availability and restart it proactively","Keep backoffMaxMs sane so retries never hammer a down hub","Alert on failStreak >= 3 instead of discovering it in logs"],"tags":["sync","network","retry","backoff"],"backgroundTag":"request-timeout","analyzedSha":"d8bc9755e74915e5c3b999181e10a67c889bce2a","analyzedAt":"2026-09-17T16:40:26.182Z","contentChangedAt":"2026-09-17T16:40:26.182Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}