{"record":{"id":"0c9bea67caf83901","repo":"windmill-labs/windmill","slug":"skipping-label-err-instanceof-error-err-me","errorCode":null,"errorMessage":"Skipping ${label}: ${err instanceof Error ? err.message : err}","messagePattern":"Skipping (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/commands/generate-metadata/generate-metadata.ts","lineNumber":391,"sourceCode":"      while (pool.size < parallelism && queue.length > 0) {\n        const task = queue.shift()!;\n        const p = (async () => {\n          try {\n            if (task.kind === \"script\") {\n              await generateScriptMetadataInternal(\n                task.scriptPath, stubWorkspace, rehashOpts, false, true, {}, codebases, false,\n              );\n              counts.scripts++;\n            } else if (task.kind === \"flow\") {\n              await generateFlowLockInternal(task.folder, false, stubWorkspace, rehashOpts, false, true);\n              counts.flows++;\n            } else {\n              await generateAppLocksInternal(task.folder, task.rawApp, false, stubWorkspace, rehashOpts, false, true);\n              counts.apps++;\n            }\n          } catch (err) {\n            const label = task.kind === \"script\" ? task.scriptPath : task.folder;\n            log.warn(`Skipping ${label}: ${err instanceof Error ? err.message : err}`);\n          }\n        })();\n        pool.add(p);\n        p.then(() => pool.delete(p));\n      }\n      if (pool.size > 0) {\n        await Promise.race(pool);\n      }\n    }\n  } finally {\n    await flushLockfileBatch();\n  }\n\n  if (counts.scripts + counts.flows + counts.apps > 0 || !rehashFilter?.missingOnly) {\n    log.info(\n      `Rehashed ${colors.bold(String(counts.scripts))} script(s), ` +\n      `${colors.bold(String(counts.flows))} flow(s), ` +\n      `${colors.bold(String(counts.apps))} app(s) from disk.`,","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/generate-metadata/generate-metadata.ts#L373-L409","documentation":"Warning from the `wmill generate-metadata rehash` command. rehashOnly processes script/folder tasks through a small concurrency pool; when the per-task work (generateAppLocksInternal or the script rehash path) throws for a single task, it logs `Skipping <scriptPath|folder>: <message>` and moves on, so one bad item doesn't abort the whole rehash run. Counts are only incremented for tasks that succeed.","triggerScenarios":"Running `wmill generate-metadata rehash` over a set of scripts/folders when one task's rehash or lock regeneration throws: invalid or missing raw app/script file contents, schema/lock file parse errors, permission errors reading the folder, or an API/workspace error during lock generation (stubWorkspace calls).","commonSituations":"Repo containing a hand-edited or corrupt app with invalid JSON/config that can't be rehashed; a folder whose raw_app.yaml/app files were partially deleted; version drift where lockfile format changed and old metadata can't be parsed; running in CI on a shallow/partial checkout missing files the task expects.","solutions":["Read the per-task message in the warning; it names the skipped script path or folder — inspect that item's files directly.","Fix or regenerate the offending item: for scripts run `wmill script generate-metadata`/rehash on it individually; for apps validate the raw app definition files (JSON/YAML parse, required fields).","Restore the missing/corrupted files (git checkout/restore) or delete stale metadata files and regenerate them.","Re-run `wmill generate-metadata rehash` after fixing; verify the summary counts now include the previously skipped items."],"exampleFix":"// before: item skipped during rehash\nSkipping u/admin/broken_app: SyntaxError: Unexpected token in JSON\n// after: repair the item, then rehash just it\nwmill generate-metadata rehash --folder u/admin/broken_app  # after fixing the bad JSON in raw app files","handlingStrategy":"validation","validationCode":"// pre-validate each app folder before batch rehash\nfor (const f of folders) {\n  const cfg = path.join(f, 'raw_app.yaml'); // or the app's config file\n  if (!existsSync(cfg)) console.warn(`Pre-check: ${f} missing app config; rehash will skip it`);\n}","typeGuard":"function isFatalRehashError(err: unknown): boolean {\n  const msg = err instanceof Error ? err.message : String(err);\n  return /EACCES|ENOENT|SyntaxError|YAMLException/i.test(msg);\n}","tryCatchPattern":"try {\n  await generateMetadataForTask(task);\n} catch (err) {\n  const msg = err instanceof Error ? err.message : String(err);\n  log.warn(`Skipping ${task.folder}: ${msg}`);\n  failures.push(task.folder); // collect and re-run failed items after fixing\n}","preventionTips":["Run in a complete checkout (not shallow/partial) so all app/script files exist before rehashing.","Commit generated metadata and avoid hand-editing lock/JSON files that rehash parses.","Rehash individual failing items first (`wmill generate-metadata` scoped to one folder) to fix them in isolation.","Review 'Skipping ...' warnings after each run and treat any remaining skips as release blockers."],"tags":["cli","batch-processing","partial-failure","metadata","skipped-item"],"backgroundTag":"batch-partial-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"}