{"record":{"id":"f13e026aa802725c","repo":"windmill-labs/windmill","slug":"sql-migration-could-not-refresh-docs-regenerr","errorCode":null,"errorMessage":"[SQL Migration] Could not refresh docs: ${regenError.message}","messagePattern":"\\[SQL Migration\\] Could not refresh docs: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/app/dev.ts","lineNumber":1371,"sourceCode":"                  result,\n                }),\n              );\n\n              // Delete the SQL file and process next in queue\n              if (currentSqlFile) {\n                await onSqlFileCompleted(currentSqlFile, true);\n              }\n\n              // Regenerate AGENTS.md and DATATABLES.md to reflect schema changes\n              try {\n                await regenerateAgentDocs(workspaceId, process.cwd(), true);\n                log.info(\n                  colors.gray(\n                    `[SQL Migration] Refreshed AGENTS.md and DATATABLES.md`,\n                  ),\n                );\n              } catch (regenError: any) {\n                log.warn(\n                  colors.yellow(\n                    `[SQL Migration] Could not refresh docs: ${regenError.message}`,\n                  ),\n                );\n              }\n            } catch (error: any) {\n              log.error(\n                colors.red(`[SQL Migration] Error: ${error.message}`),\n              );\n              ws.send(\n                JSON.stringify({\n                  type: \"sqlMigrationResult\",\n                  error: true,\n                  message: error.message || String(error),\n                }),\n              );\n              // Don't delete file on error, but clear current so user can retry\n              currentSqlFile = null;","sourceCodeStart":1353,"sourceCodeEnd":1389,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/app/dev.ts#L1353-L1389","documentation":"Non-fatal degradation in `wmill app dev`'s SQL-migration flow: after a migration file was applied and marked completed, the follow-up regenerateAgentDocs call (refreshing AGENTS.md and DATATABLES.md to reflect schema changes) threw. The migration itself succeeded; only the documentation refresh was skipped.","triggerScenarios":"Thrown at cli/src/commands/app/dev.ts:1371 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the docs regeneration once the cause (API error, permissions, disk) is resolved — the SQL file was already consumed","Regenerate AGENTS.md/DATATABLES.md manually with the same regeneration command","Check the wrapped regenError message for the underlying cause (usually workspace API access)"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}