500 error when accessing /jsonapi/

Created on 10 December 2023, 6 months ago
Updated 12 December 2023, 6 months ago

Problem/Motivation

When accessing our Drupal 9.5.11 site via jsonapi during a Gatsby build process it fails and gives a 500 error.

{"jsonapi":{"version":"1.0","meta":{"links":{"self":{"href":"http:\/\/jsonapi.org\/format\/1.0\/"}}}},"errors":[{"title":"Internal Server Error","status":"500","detail":"Syntax error","links":{"via":{"href":"https:\/\/branch-sitename.pantheonsite.io\/jsonapi\/"},"info":{"href":"http:\/\/www.w3.org\/Protocols\/rfc2616\/rfc2616-sec10.html#sec10.5.1"}}}]}

It is a multilingual site with two languages.

This failed when we updated a number of components on Drupal as it had been working previously.

Initially we thought it could be one of two key updates:

  1. update to 9.5.11 with this security update: https://www.drupal.org/sa-core-2023-006 β†’
  2. applying this patch https://www.drupal.org/project/drupal/issues/3274419 πŸ› Make BaseFieldOverride inherit internal property from the base field Fixed to fix path aliases

Backing those changes out has not seemed to fix the issue.

When comparing the failing branch to a non failing branch we discovered this additional information:

Working branch:

  • /jsonapi reditrects to /en/jsonapi
  • /en/jsonapi/ redirects to /en/jsonapi

This is expected.

Failing branch:

  • /en/jsonapi - works
  • /jsonapi - 500 error
  • /en/jsonapi/ - 500 error

Other redirects on the failing branch behave as expected.

Steps to reproduce

I am unable to reproduce it currently.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ’¬ Support request
Status

Closed: works as designed

Version

9.5

Component
JSON APIΒ  β†’

Last updated 1 day ago

Created by

πŸ‡¨πŸ‡¦Canada ridefree

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ridefree
  • Status changed to Postponed: needs info 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States cilefen

    Drupal 9 is end-of-life. Also, the exception details are not shown.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10
  • πŸ‡¨πŸ‡¦Canada ridefree

    Thanks both.

    I'm aware of 9.5 EOL and am thankful for the reminder here. On this particular project the d10 upgrade hasn't happened yet, and there was a need to resolve this issue to unblock a front end dev. I'd hesitated to put this up here, but figured it was worth seeing if it had occurred for others.

    That said, after rolling back and stepping through each of the updates, we've narrowed it down to the JSON:API Book β†’ module. When we back this out the problem goes away, and it seems to be interfering with the ability to redirect to /en/jsonapi

    We are investigating to see if we can recommend a fix there, and will follow up with an issue on that module page to document it.

    I'm unsure what best practice is for this issue.

    We don't think that it is a JSON:API issue itself. Shall we close this and then I can comment here with the link to the JSON:API book issue when we create it?

  • Status changed to Closed: works as designed 6 months ago
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Thanks

Production build 0.69.0 2024