{"record":{"id":"b42a7b934dea489e","repo":"hcengineering/platform","slug":"invalid-conflictstrategy-must-be-skip-or-dupli","errorCode":null,"errorMessage":"Invalid conflictStrategy. Must be \"skip\" or \"duplicate\"","messagePattern":"Invalid conflictStrategy\\. Must be \"skip\" or \"duplicate\"","errorType":"http","errorClass":"ApiError","httpStatus":400,"severity":"error","filePath":"services/export/pod-export/src/server.ts","lineNumber":500,"sourceCode":"          objectSpace?: Ref<Space>\n          fieldMappers?: Record<string, Record<string, any>>\n          skipDeletedObsolete?: boolean\n          exportOnlyEffective?: boolean\n          includeChildren?: boolean\n        } = req.body\n\n        // Validate required parameters\n        if (targetWorkspace == null || typeof targetWorkspace !== 'string') {\n          measureCtx.warn(`Invalid targetWorkspace parameter: ${String(targetWorkspace)}`)\n          throw new ApiError(400, 'Missing or invalid required parameter: targetWorkspace')\n        }\n        if (_class == null || typeof _class !== 'string') {\n          measureCtx.warn(`Invalid _class parameter: ${String(_class)}`)\n          throw new ApiError(400, 'Missing or invalid required parameter: _class')\n        }\n        if (conflictStrategy !== undefined && conflictStrategy !== 'skip' && conflictStrategy !== 'duplicate') {\n          measureCtx.warn(`Invalid conflictStrategy: ${String(conflictStrategy)}`)\n          throw new ApiError(400, 'Invalid conflictStrategy. Must be \"skip\" or \"duplicate\"')\n        }\n        if (includeAttachments !== undefined && typeof includeAttachments !== 'boolean') {\n          measureCtx.warn(`Invalid includeAttachments: ${String(includeAttachments)}`)\n          throw new ApiError(400, 'Invalid includeAttachments. Must be boolean')\n        }\n\n        decodedToken = decodeToken(token)\n        if (decodedToken.extra?.readonly !== undefined) {\n          throw new ApiError(403, 'Forbidden: read-only token')\n        }\n\n        // Get target workspace info\n        const accountClient = getClient(envConfig.AccountsUrl, token)\n        const targetWsLoginInfo = await accountClient.getLoginWithWorkspaceInfo()\n\n        const targetWsInfo = targetWsLoginInfo.workspaces[targetWorkspace]\n        if (targetWsInfo === undefined) {\n          measureCtx.warn(`Target workspace not found or not accessible: ${targetWorkspace}`)","sourceCodeStart":482,"sourceCodeEnd":518,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/services/export/pod-export/src/server.ts#L482-L518","documentation":"The pod-export server's export endpoint validates the optional `conflictStrategy` query/body parameter. This error (HTTP 400) is thrown by createServer's request handler when the parameter is provided but is neither the string 'skip' nor 'duplicate', i.e. the caller requested an unsupported conflict-resolution behavior.","triggerScenarios":"Calling the export API with conflictStrategy set to any value other than 'skip' or 'duplicate' (e.g. 'overwrite', 'replace', 'skip_conflicts', or a misspelled variant).","commonSituations":"Hand-built HTTP requests or scripts passing an invented strategy name; typos like 'Skip' (case-sensitive check); passing a non-string such as a number or boolean; upgrading client code written against an API that accepted other strategy names.","solutions":["Change the request to use conflictStrategy='skip' or conflictStrategy='duplicate' (exact lowercase strings).","Omit the conflictStrategy parameter entirely if the default behavior is acceptable.","Fix casing/typos — the comparison is case-sensitive, so 'Skip' is rejected."],"exampleFix":"// before\nGET /export?_class=task:Task&conflictStrategy=overwrite\n// after\nGET /export?_class=task:Task&conflictStrategy=skip","handlingStrategy":"validation","validationCode":"const VALID = ['skip', 'duplicate']\nif (conflictStrategy !== undefined && !VALID.includes(conflictStrategy)) {\n  throw new Error(`conflictStrategy must be \"skip\" or \"duplicate\", got: ${conflictStrategy}`)\n}","typeGuard":"function isConflictStrategy(v: unknown): v is 'skip' | 'duplicate' {\n  return v === 'skip' || v === 'duplicate'\n}","tryCatchPattern":"try {\n  await exportPod(params)\n} catch (err) {\n  if (err instanceof ApiError && err.status === 400 && /conflictStrategy/.test(err.message)) {\n    console.error('Fix conflictStrategy: use \"skip\" or \"duplicate\", or omit it')\n  } else throw err\n}","preventionTips":["Type the parameter as 'skip' | 'duplicate' union in client code so the compiler rejects other values.","Never hand-build query strings for this endpoint; use a typed client.","Omit the parameter when default behavior is acceptable."],"tags":["api","validation","bad-request"],"backgroundTag":"invalid-parameter-value","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}