{"record":{"id":"b58dee7b293e20f0","repo":"actualbudget/actual","slug":"no-sync-server-set","errorCode":null,"errorMessage":"No sync server set","messagePattern":"No sync server set","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/loot-core/src/server/preferences/app.ts","lineNumber":220,"sourceCode":"        ? true\n        : notifyWhenUpdateIsAvailable, // default to true\n  };\n}\n\nasync function saveMetadataPrefs(prefsToSet: MetadataPrefs) {\n  if (!prefsToSet) {\n    return 'ok';\n  }\n\n  const { cloudFileId } = _getMetadataPrefs();\n\n  // Need to sync the budget name on the server as well\n  if (prefsToSet.budgetName && cloudFileId) {\n    const userToken = await asyncStorage.getItem('user-token');\n\n    const syncServer = getServer()?.SYNC_SERVER;\n    if (!syncServer) {\n      throw new Error('No sync server set');\n    }\n\n    await post(syncServer + '/update-user-filename', {\n      token: userToken,\n      fileId: cloudFileId,\n      name: prefsToSet.budgetName,\n    });\n  }\n\n  await _saveMetadataPrefs(prefsToSet);\n  return 'ok';\n}\n\nasync function loadMetadataPrefs(): Promise<MetadataPrefs> {\n  return _getMetadataPrefs();\n}\n\nasync function saveServerPrefs({ prefs }: { prefs: Record<string, string> }) {","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/loot-core/src/server/preferences/app.ts#L202-L238","documentation":"saveMetadataPrefs (packages/loot-core/src/server/preferences/app.ts:220) throws this plain Error when it needs to push the budget name to the server (prefsToSet.budgetName with a cloudFileId present) but no sync server URL is configured — getServer()?.SYNC_SERVER is undefined. It typically means the client is running without a server base URL set (server-only mode URLs absent from the environment/config).","triggerScenarios":"Renaming a budget (saving metadata with a new budgetName) while a cloudFileId exists, in a build where SYNC_SERVER is not configured — e.g. the web frontend served without the sync server URL configured, or a desktop build in local-only mode that somehow has a cloudFileId.","commonSituations":"Self-hosting the frontend without setting the sync server URL in the server config; missing ACTUAL_SERVER_URL-style environment variable; using a build of the app compiled without server endpoints; renamed cloud budgets after switching from a server-less deployment.","solutions":["Configure the sync server URL so getServer().SYNC_SERVER is defined (set the server base URL in the sync-server config/environment serving the frontend).","If you don't use sync, rename the budget without a cloudFileId (local-only budget).","Restart the deployment after adding the server URL so the config propagates to the client.","Verify with the deployed app that /update-user-filename is reachable once the URL is set."],"exampleFix":"// before: frontend served without sync server configured (SYNC_SERVER undefined)\n// after: in sync-server config / environment\n// .env: ACTUAL_SERVER_URL=https://sync.example.com\n// restart sync-server so the client receives SYNC_SERVER in getServer()","handlingStrategy":"validation","validationCode":"const syncServer = getServer()?.SYNC_SERVER;\nif (prefsToSet.budgetName && cloudFileId && !syncServer) {\n  // don't attempt the rename sync; warn the user the server URL is not configured\n  logger.log('Skipping budget-name sync: no sync server configured');\n  return;\n}","typeGuard":"function hasSyncServer(cfg: unknown): cfg is { SYNC_SERVER: string } {\n  return typeof cfg === 'object' && cfg !== null && typeof (cfg as any).SYNC_SERVER === 'string' && (cfg as any).SYNC_SERVER.length > 0;\n}","tryCatchPattern":"try {\n  await savePrefs(prefsToSet);\n} catch (e) {\n  if (e instanceof Error && e.message === 'No sync server set') {\n    // prompt the user to configure the server URL, or proceed without cloud rename\n    showConfigureServerDialog();\n  } else throw e;\n}","preventionTips":["Set the sync server URL in the deployment config serving the frontend before users rename cloud budgets.","Guard rename flows with a SYNC_SERVER existence check.","For local-only budgets, ensure no cloudFileId is set so server sync is skipped.","Document required environment variables (server URL) in self-hosting setup."],"tags":["configuration","sync-server","environment","preferences"],"backgroundTag":"missing-env-var","analyzedSha":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}