l3montree-dev / l3montree-dev/devguard

Registration submission fails: self-service/registration returns 500 HTML error page

Open
#2,750 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug priority:high
Dominant language
Go
Stars
161
Forks
43
Avg merge
1d 8h
Merged PRs (30d)
37

Description

Error

ResponseError: The Ory API endpoint returned an unexpected HTML or text response. Check your console output for details.

Stack trace

<anonymous> (@ory/elements-react/src/util/sdk-helpers/utils.ts:191)
  ← sO / onSubmitRegistration (@ory/elements-react/src/util/onSubmitRegistration.ts:39)
  ← <anonymous> / useOryFormSubmit (@ory/elements-react/src/components/form/useOryFormSubmit.ts:124)
  ← <anonymous> / react-hook-form createFormControl.ts:1614

Source (node_modules/@ory/elements-react/src/util/sdk-helpers/utils.ts:186-196)

      contentType.includes("text/") ||
      contentType.includes("html") ||
      contentType.includes("xml")
    ) {
      // Handle human-readable content
      await logResponseError(err.response, true)
      throw new ResponseError(
        err.response,
        `The Ory API endpoint returned an unexpected HTML or text response. Check your console output for details.`,
      )
    }

Request context

  • URL: https://main.devguard.org/registration?flow=b4e9c21d-2488-40f3-9f1d-3e9813e58352
  • Culprit route: /registration
  • User submitted the registration form (name, email, confirmed-terms checkbox, submit) after which POST https://main.devguard.org/self-service/registration?flow=b4e9c21d-2488-40f3-9f1d-3e9813e58352 returned 500 with an HTML/text body instead of JSON, which the Ory Elements SDK can't decode ("Unable to decode API response").
  • A React error #418 (hydration mismatch) was also logged as a breadcrumb on page load, ~24s before the form submission — same recurring issue as issue 3305 and related issues.
  • User agent: HeadlessChrome — likely an automated/synthetic test rather than a real user, but the underlying 500 on registration submit would affect real users too.

GlitchTip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the POST to /self-service/registration from the reported /registration flow and inspect the GlitchTip event and server response. Read the SDK handling in node_modules/@ory/elements-react/src/util/sdk-helpers/utils.ts and the cited onSubmitRegistration.ts path to understand the failure boundary. Done means registration no longer returns a 500 HTML/text response and the form receives the expected API response.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, react, typescript
Domain
api, authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.