{"record":{"id":"e37ad7e52b376368","repo":"docusealco/docuseal","slug":"failed-to-submit-answers","errorCode":null,"errorMessage":"Failed to submit answers","messagePattern":"Failed to submit answers","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/javascript/submission_form/kba_step.vue","lineNumber":571,"sourceCode":"          headers: { 'Content-Type': 'application/json' }\n        })\n\n        const data = await resp.json()\n\n        if (data.result?.action !== 'PASS') {\n          if (data.result?.issues?.length) {\n            this.error = `Knowledge Based Authentication Failed - make sure you provide correct details for the Knowledge Based authentication: ${data.result.issues.join(', ')}`\n          } else {\n            this.error = 'Knowledge Based Authentication Failed - make sure you provide correct answers for the Knowledge Based authentication.'\n          }\n\n          throw new Error('Knowledge Based Authentication Failed')\n        }\n\n        if (!resp.ok) {\n          this.error = 'Failed to submit answers'\n\n          throw new Error('Failed to submit answers')\n        }\n\n        return resp\n      } finally {\n        this.isSubmitting = false\n      }\n    }\n  }\n}\n</script>\n","sourceCodeStart":553,"sourceCodeEnd":582,"githubUrl":"https://github.com/docusealco/docuseal/blob/004a22c1c88109c7ba0b567df011a8cb13894001/app/javascript/submission_form/kba_step.vue#L553-L582","documentation":"Raised when the answers POST returned result.action === 'PASS' but resp.ok is false - a contradictory response where the business payload says success while the HTTP status says error. Because the PASS check runs first, this branch only fires on that mismatch, which almost always means an intermediary (proxy, WAF, middleware) rewrote the status after the body was produced.","triggerScenarios":"A reverse proxy returning 502/504 after the upstream streamed a PASS body; auth or rate-limit middleware injecting 4xx on an otherwise successful response; body and status produced by different layers.","commonSituations":"Gateway timeouts on slow KBA submissions; session cookies expiring mid-quiz so middleware rejects a finished request; WAF rules on POST bodies.","solutions":["Reproduce while watching status vs body in the Network tab to confirm the mismatch.","Inspect every proxy between browser and KBA service (nginx, CDN, WAF) for status rewriting or aggressive timeouts.","Reorder the checks to validate resp.ok first so transport errors are reported as transport errors.","If the mismatch is systemic, fix the middleware that alters statuses."],"exampleFix":"// before\nif (data.result?.action !== 'PASS') { /* KBA failed */ }\nif (!resp.ok) {\n  this.error = 'Failed to submit answers'\n  throw new Error('Failed to submit answers')\n}\n\n// after\nif (!resp.ok) {\n  this.error = 'Failed to submit answers'\n  throw new Error('Failed to submit answers')\n}\nif (data.result?.action !== 'PASS') { /* KBA failed */ }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const resp = await fetch(url, opts)\n  if (!resp.ok) throw new Error(`Failed to submit answers (HTTP ${resp.status})`)\n  const data = await resp.json()\n  if (data.result?.action !== 'PASS') throw new Error('Knowledge Based Authentication Failed')\n} finally {\n  this.isSubmitting = false\n}","preventionTips":["Check resp.ok before interpreting business fields","Include status codes in error telemetry","Alert on status/body inconsistencies - they indicate middleware problems"],"tags":["kba","identity-verification","http-error","status-mismatch"],"backgroundTag":"http-error-response","analyzedSha":"004a22c1c88109c7ba0b567df011a8cb13894001","analyzedAt":"2026-08-21T13:38:23.343Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}