{"record":{"id":"fc26aff0e5c8b6c5","repo":"windmill-labs/windmill","slug":"invalid-settings-format-expected-include-path-arr","errorCode":null,"errorMessage":"Invalid settings format. Expected include_path array","messagePattern":"Invalid settings format\\. Expected include_path array","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/gitsync-settings/pull.ts","lineNumber":56,"sourceCode":"    promotion?: string;\n  },\n) {\n  const workspace = await resolveWorkspace(opts);\n  await requireLogin(opts);\n\n  try {\n    // Parse and validate --with-backend-settings if provided\n    let settings: any;\n    if (opts.withBackendSettings) {\n      try {\n        const parsedSettings = JSON.parse(opts.withBackendSettings);\n\n        // Validate the structure matches expected format (raw settings object)\n        if (\n          !parsedSettings.include_path ||\n          !Array.isArray(parsedSettings.include_path)\n        ) {\n          throw new Error(\n            \"Invalid settings format. Expected include_path array\",\n          );\n        }\n        if (\n          !parsedSettings.include_type ||\n          !Array.isArray(parsedSettings.include_type)\n        ) {\n          throw new Error(\n            \"Invalid settings format. Expected include_type array\",\n          );\n        }\n\n        // Create mock backend response with single repository using provided settings\n        const mockRepositoryPath = opts.repository || \"u/mock/repo\";\n        settings = {\n          git_sync: {\n            repositories: [{\n              git_repo_resource_path: mockRepositoryPath,","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/gitsync-settings/pull.ts#L38-L74","documentation":"Schema validation of the --with-backend-settings flag in the git-sync settings pull command: the flag's JSON parsed, but the resulting object's include_path is missing or not an array. The flag is meant to carry a raw backend git-sync settings object (as read from the backend's settings endpoint); the input at fault is the JSON string passed to --with-backend-settings, whose include_path field is absent or of the wrong type.","triggerScenarios":"Thrown at cli/src/commands/gitsync-settings/pull.ts:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the settings object verbatim from the backend/API (it must include include_path as an array of strings)","Add or fix the field: \\\"include_path\\\": [\\\"f/myfolder/*\\\"] in the JSON you pass","Omit --with-backend-settings entirely to let the command fetch settings from the backend"],"exampleFix":null,"handlingStrategy":"validation","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"}