{"record":{"id":"ba5ea710b9e2a35d","repo":"windmill-labs/windmill","slug":"failed-to-compute-shared-ui-diff-for-dry-run-previ","errorCode":null,"errorMessage":"Failed to compute shared UI diff for dry-run preview: ${e}","messagePattern":"Failed to compute shared UI diff for dry-run preview: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/commands/sync/sync.ts","lineNumber":5318,"sourceCode":"      for (const c of await diffSharedUi(\n        workspace.workspaceId,\n        opts.keepDeleted,\n      )) {\n        if (c.type === \"added\") {\n          changes.push({ name: \"added\", path: c.path, content: \"\" });\n        } else if (c.type === \"deleted\") {\n          changes.push({ name: \"deleted\", path: c.path });\n        } else {\n          changes.push({\n            name: \"edited\",\n            path: c.path,\n            before: c.before,\n            after: c.after,\n          });\n        }\n      }\n    } catch (e) {\n      log.warn(`Failed to compute shared UI diff for dry-run preview: ${e}`);\n    }\n  }\n\n  log.info(\n    `remote (${workspace.name}) <- local: ${changes.length} changes to apply`,\n  );\n  // Check that every folder referenced in the changeset has a local folder.meta.yaml\n  const missingFolders: string[] = [];\n  if (changes.length > 0) {\n    const folderNames = new Set<string>();\n    for (const change of changes) {\n      const parts = change.path.split(SEP);\n      if (parts.length >= 3 && parts[0] === \"f\" && change.name !== \"deleted\") {\n        folderNames.add(parts[1]);\n      }\n    }\n    for (const folderName of folderNames) {\n      const basePath = path.join(\"f\", folderName, \"folder.meta.yaml\");","sourceCodeStart":5300,"sourceCodeEnd":5336,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/sync/sync.ts#L5300-L5336","documentation":"During `wmill sync push --dry-run`, the CLI attempts to compute a UI diff for the shared UI folder so the preview shows shared-UI changes alongside file changes. This is wrapped in a catch that downgrades any failure to a log.warn because the shared-UI diff is purely supplemental — the dry-run of the main fileset still completes. The thrown value `e` is interpolated into the message.","triggerScenarios":"Running `wmill sync push --dry-run` on a workspace whose shared UI folder diff computation fails — e.g. the remote shared UI folder cannot be listed (network error, 4xx/5xx from the API, permission denied on the folder) or local shared UI files fail to parse.","commonSituations":"Token lacking read access to the shared UI folder; server unreachable mid-dry-run; malformed shared UI files locally; older server version without the shared UI endpoints.","solutions":["Check the interpolated error `e` in the warning to see the root cause (usually an HTTP status or network error).","Verify the API token/workspace has access to the shared UI folder (retry with an admin token).","Ignore if shared UI diff is irrelevant to you — the dry-run preview of regular files is still produced.","Upgrade the CLI/server if the shared UI endpoints are missing on your server version."],"exampleFix":"// The failure is already handled; if you want the dry run to fail loudly on shared UI errors:\n// before (library code)\n} catch (e) {\n  log.warn(`Failed to compute shared UI diff for dry-run preview: ${e}`);\n}\n// after\n} catch (e) {\n  log.error(`Failed to compute shared UI diff for dry-run preview: ${e}`);\n  process.exit(1);\n}","handlingStrategy":"try-catch","validationCode":"// Before dry-run, check shared UI access:\nconst folders = await wmill.listFolders({ workspace });\n// ensure the shared UI folder exists and the token can read it; otherwise skip the shared-UI diff","typeGuard":"function isHttpError(e: unknown): e is { statusCode: number; message: string } {\n  return typeof e === 'object' && e !== null && 'statusCode' in e;\n}","tryCatchPattern":"try {\n  await computeSharedUiDiff();\n} catch (e) {\n  log.warn(`Skipping shared UI diff (non-fatal): ${e instanceof Error ? e.message : e}`);\n}","preventionTips":["Use a token with read access to the shared UI folder before dry-running","Test connectivity to the workspace API before long sync operations","Pin CLI and server versions to compatible releases","Treat this warning as ignorable unless shared UI matters to your deployment"],"tags":["cli","sync","dry-run","shared-ui"],"backgroundTag":"shared-ui-diff-unavailable","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"}