{"record":{"id":"177c68a3b1cabc82","repo":"windmill-labs/windmill","slug":"could-not-read-the-shared-ui-folder-from-the-remot","errorCode":null,"errorMessage":"Could not read the shared UI folder from the remote; skipping its push so --keep-deleted does not clear it.","messagePattern":"Could not read the shared UI folder from the remote; skipping its push so --keep-deleted does not clear it\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/commands/shared_ui.ts","lineNumber":129,"sourceCode":" * pushes an empty map (clearing the remote store) if the remote is non-empty —\n * unless `keepDeleted`, which folds remote-only files back into the map.\n */\nexport async function pushSharedUi(\n  workspace: string,\n  keepDeleted?: boolean,\n): Promise<boolean> {\n  const localDir = path.join(process.cwd(), SHARED_UI_DIR);\n  if (!fs.existsSync(localDir)) {\n    return false;\n  }\n\n  const files = await readDirRecursive(localDir);\n  const remote = await fetchSharedUi(workspace);\n  // The store is written whole, so a remote-only file is pruned by omission\n  // alone. An unreadable store leaves no way to carry those files over, so\n  // the shared UI is left untouched rather than cleared.\n  if (remote === undefined && keepDeleted) {\n    log.warn(\n      colors.yellow(\n        \"Could not read the shared UI folder from the remote; skipping its push so --keep-deleted does not clear it.\",\n      ),\n    );\n    return false;\n  }\n\n  // Same comparison as diffSharedUi, off the same two maps, so preview and\n  // push never diverge.\n  if (sharedUiChanges(files, remote ?? {}, keepDeleted).length === 0) {\n    log.info(colors.gray(\"Shared UI folder up to date\"));\n    return false;\n  }\n\n  if (keepDeleted) {\n    for (const [rel, content] of Object.entries(remote!)) {\n      // defineProperty, not assignment: `files.__proto__ = \"...\"` runs the\n      // inherited setter and creates no own property, so a remote `ui/__proto__`","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/shared_ui.ts#L111-L147","documentation":"Pushing the shared UI folder writes the remote store wholesale: remote-only files are pruned by omission of the local set. If the remote store cannot be read at all while --keep-deleted is set, pruning by omission would delete everything, so the push of the shared UI is skipped entirely and a warning is emitted instead of clearing the remote.","triggerScenarios":"Running a push with --keep-deleted when fetchSharedUi() returns undefined — the remote shared UI store is unreadable/missing due to API error, old backend, or permission problems.","commonSituations":"Older backends without the shared UI store endpoint; transient API/auth failures during sync; workspaces where shared UI was never initialized remotely.","solutions":["Investigate why fetchSharedUi failed (check backend version, auth, workspace) and fix it, then re-push","Drop --keep-deleted for this run if you actually intend to replace the remote shared UI","Verify the remote shared UI contents after fixing, since the push was skipped"],"exampleFix":"// before\nwmill sync push --keep-deleted   # shared UI skipped: remote unreadable\n// after\nwmill sync push   # without --keep-deleted, or fix backend/auth first then re-run with --keep-deleted","handlingStrategy":"validation","validationCode":"if (await fetchSharedUi(workspace) === undefined) console.warn('avoid --keep-deleted');","typeGuard":"function sharedUiReadable(v: unknown): v is Record<string, string> { return typeof v === 'object' && v !== null; }","tryCatchPattern":"try { await pushSharedUi({workspace, keepDeleted:true}); } catch { console.warn('shared UI push skipped; nothing deleted'); }","preventionTips":["use --keep-deleted only on healthy remotes","check backend/auth first","diff remote after skipped pushes"],"tags":["cli","shared-ui","keep-deleted"],"backgroundTag":"remote-store-unreadable","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}