{"record":{"id":"241060c9500949d5","repo":"windmill-labs/windmill","slug":"pointererrors-join-n","errorCode":null,"errorMessage":"pointerErrors.join(\"\\n\")","messagePattern":"pointerErrors\\.join\\(\"\\\\n\"\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/sync/sync.ts","lineNumber":5449,"sourceCode":"        typeof parsed?.value === \"string\" &&\n        parsed.value.startsWith(\"!inline_fileset \")\n      ) {\n        const serverPath =\n          wsNameForPointerCheck && isWorkspaceSpecificFile(change.path)\n            ? fromWorkspaceSpecificPath(change.path, wsNameForPointerCheck)\n            : change.path;\n        try {\n          validateFilesetPointer(\n            parsed.value.split(\" \")[1],\n            removeType(serverPath, \"resource\"),\n          );\n        } catch (e) {\n          pointerErrors.push(e instanceof Error ? e.message : String(e));\n        }\n      }\n    }\n    if (pointerErrors.length > 0) {\n      throw new Error(pointerErrors.join(\"\\n\"));\n    }\n  }\n\n  // Handle JSON output for dry-run\n  if (opts.dryRun && opts.jsonOutput) {\n    const result = {\n      success: true,\n      changes: changes.map((change) => ({\n        type: change.name,\n        path: change.path,\n        ...(change.name === \"edited\" && change.codebase\n          ? { codebase_changed: true }\n          : {}),\n        ...(specificItems && isSpecificItem(change.path, specificItems)\n          ? {\n              workspace_specific: true,\n              workspace_specific_path: getWorkspaceSpecificPath(\n                change.path,","sourceCodeStart":5431,"sourceCodeEnd":5467,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/sync/sync.ts#L5431-L5467","documentation":"windmill's `wmill sync push` collects per-item failures during a push and, after processing everything, throws a single Error whose message is all collected messages joined by newlines. This is an aggregate 'push finished with N failure(s)' report, not a single root cause. Each line corresponds to one remote item that could not be pushed.","triggerScenarios":"Running `wmill sync push` (with or without --dry-run plumbing) when one or more individual item pushes throw — e.g. a remote API call fails for a script/flow/app — while the CLI is in the code path that pushes dependency pointers/related objects in a try/catch loop that appends to pointerErrors.","commonSituations":"Partial sync failures: stale local state referencing deleted remote objects, permission errors on specific items, renamed paths, or network blips mid-push. Developers see a multi-line error and often misread it as one bug when it is several.","solutions":["Read each line of the message as a separate failure and fix them individually","Re-run `wmill sync push` after fixing the first batch; the aggregate shrinks","Use `wmill sync push --dry-run --json-output` to see the structured result before a real push","Check workspace login/permissions (`wmill switch`, token expiry) if many items fail at once"],"exampleFix":"// before: treating the aggregate as one error\ntry { await wmill.sync.push(opts); } catch (e) { log.error(String(e)); }\n// after: handle each line separately\ntry { await wmill.sync.push(opts); } catch (e) {\n  for (const line of String(e.message).split(\"\\n\")) log.error(line);\n}","handlingStrategy":"try-catch","validationCode":"// dry-run first to surface failures without side effects\nconst res = await wmill.sync.push({ ...opts, dryRun: true, jsonOutput: true });\nif (res.errors?.length) console.warn(res.errors);","typeGuard":null,"tryCatchPattern":"try {\n  await wmill.sync.push(opts);\n} catch (e) {\n  const failures = String(e.message).split(\"\\n\");\n  for (const f of failures) console.error(\"sync item failed:\", f);\n}","preventionTips":["Run --dry-run --json-output before real pushes","Keep the sync folder fully in git so state is reviewable","Check workspace/token validity before bulk pushes","Re-run pushes after fixes since the error is an aggregate of independent items"],"tags":["cli","sync","aggregate-error","push"],"backgroundTag":"sync-push-aggregate-failure","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"}