Drupal\Core\File\Exception\InvalidStreamWrapperException: in Drupal\Core\File\FileUrlGenerator->doGenerateString() (line 106 of /docroot/core/lib/Drupal/Core/File/FileUrlGenerator.php)

Created on 16 March 2022, over 2 years ago
Updated 11 August 2023, 10 months ago

Problem/Motivation

Upgrading site from 9.2.8 to 9.3.7 getting this InvalidStreamWrapperException file system issue. Site was broken after this upgrade

💬 Support request
Status

Closed: outdated

Version

9.5

Component
File system  →

Last updated about 5 hours ago

Created by

🇮🇳India akshay_d Bangalore

Live updates comments and jobs are added and updated live.
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.

  • 🇵🇱Poland grzegorz@paniw.eu

    I also struggled with this same problem, after upgrading from drupal 7 to drupal 9.52. Any idea how to solve this problem?

  • Status changed to Postponed: needs info over 1 year ago
  • 🇺🇸United States cilefen

    Provide the information I requested on comment #8.

  • 🇵🇱Poland grzegorz@paniw.eu

    Thanks for response, the extended information is:
    Drupal\Core\File\Exception\InvalidStreamWrapperException: private://logo.png in Drupal\Core\File\FileUrlGenerator->doGenerateString() (line 112 of core/lib/Drupal/Core/File/FileUrlGenerator.php).

  • 🇺🇸United States JGReidy

    I was having this problem. Solved by properly setting up the private file system in settings.php with

    $settings['file_private_path'] = '../someplace';
    

    Details that may be related: I was moving a site and setting up s3fs at the same time. I had moved all the private:// stuff to S3. As with grzegorz the $uri causing the exception was private://bla_bla_bla. Once I made a private_files directory and pointed to it in settings.php, and cleared the caches, I got these messages:

    * Warning: file_exists(): Unable to find the wrapper "private" - did you forget to enable it when you configured PHP? in Drupal\Component\FileSecurity\FileSecurity::writeFile() (line 155 of core/lib/Drupal/Component/FileSecurity/FileSecurity.php).

    * Warning: file_exists(): Unable to find the wrapper "private" - did you forget to enable it when you configured PHP? in system_requirements() (line 714 of core/modules/system/system.install).

    They appeared once. When I went to /admin/config/media/file-system I saw the 'Private file system path' I had set up, and these exceptions had cleared, and the S3 private files were working.

  • Status changed to Closed: outdated 11 months ago
  • 🇺🇸United States cilefen
  • 🇮🇳India Kaustab_Roy

    I faced the same issue I Fixed it by adding this on settings.php
    $settings['file_private_path'] = '../private/files';

    Similar to #20 comment

Production build 0.69.0 2024