API returns Internal Server Error when requested by anonymous user.

Created on 23 May 2023, over 2 years ago

When requesting menu item using
```{baseurl}/api/menu_items/{menuname}```
I am getting the following error:
```"title": "Internal Server Error",
"status": "500",
"detail": "The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\\jsonapi\\CacheableResourceResponse.",```

🐛 Bug report
Status

Active

Version

1.2

Component

Code

Created by

🇮🇳India farhanmae Bengaluru

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

Comments & Activities

  • Issue created by @farhanmae
  • 🇺🇸United States evanjenkins

    I was getting this too but only when pointing urls to existing paths. For instance Drupal has an existing `/about` page and I put that path into the url, there was this error. If I made it to a non-existent path `/about-2` it works as expected.

    Did you happen to resolve this?

  • 🇺🇸United States evanjenkins

    I had to turn off rules module. Not quite sure why this resolved the issue.

  • Status changed to Closed: cannot reproduce 3 months ago
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

    This module adds a route with access set to TRUE and if I install standard and make a request to jsonapi/menu_items/main as the anonymous user I get the expected response - a 200 with the menu links in. If I request for a non-existent main I get the expected 404.

Production build 0.71.5 2024