Early rendering exception when creating private files

Created on 10 October 2018, almost 7 years ago
Updated 24 June 2025, about 1 month ago

Hi.

I am trying to create a private file.

{
  "data": {
    "type": "file--document",
    "attributes": {
      "data": "c2F2ZQ==",
      "uri": "private://sometxt.txt"
    }
  }
}

Even though the file is created, I am receing a 500 error: "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\\ResourceResponse."

It seems that a problem appears from getExternalUrl() function from PrivateStream class. The $collect_bubbleable_metadata parameter is not passed in generateFromRoute function (by default it is false). Because of this, the appears the leaked cache metadata error.
Can you please have a look?

πŸ› Bug report
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

file system

Created by

πŸ‡·πŸ‡΄Romania sorina.hriban

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This came up as a daily BSI target

    Think this could do with an issue summary update, using the standard issue template. To include steps to reproduce, proposed solution, etc.

    Thanks!

Production build 0.71.5 2024