Warning: file_put_contents(public://ipless/ipless-ipless.watching--ipless.watching.css

Created on 13 April 2023, over 1 year ago
Updated 4 October 2023, about 1 year ago

Hello all,

Problem/Motivation

My log messages are full with the warning I paste below:

Warning: file_put_contents(public://ipless/ipless-ipless.watching--ipless.watching.css): Failed to open stream: "Drupal\Core\StreamWrapper\PublicStream::stream_open" call failed in Drupal\ipless\Asset\AssetRenderer->compile() (line 191 of /var/www/html/web/modules/contrib/ipless/src/Asset/AssetRenderer.php)

#0 /var/www/html/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 /var/www/html/web/modules/contrib/ipless/src/Asset/AssetRenderer.php(191): file_put_contents()
#3 /var/www/html/web/modules/contrib/ipless/src/Asset/AssetRenderer.php(143): Drupal\ipless\Asset\AssetRenderer->compile()
#4 /var/www/html/web/modules/contrib/ipless/src/Ipless.php(164): Drupal\ipless\Asset\AssetRenderer->render()
#5 /var/www/html/web/modules/contrib/ipless/src/Ipless.php(108): Drupal\ipless\Ipless->generateCss()
#6 /var/www/html/web/modules/contrib/ipless/src/Ipless.php(90): Drupal\ipless\Ipless->generate()
#7 /var/www/html/web/modules/contrib/ipless/src/EventSubscriber/HtmlResponseIplessSubscriber.php(70): Drupal\ipless\Ipless->processOnResponse()
#8 [internal function]: Drupal\ipless\EventSubscriber\HtmlResponseIplessSubscriber->onRespond()
#9 /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
#10 /var/www/html/web/core/modules/big_pipe/src/Render/BigPipe.php(652): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#11 /var/www/html/web/core/modules/big_pipe/src/Render/BigPipe.php(630): Drupal\big_pipe\Render\BigPipe->filterResponse()
#12 /var/www/html/web/core/modules/big_pipe/src/Render/BigPipe.php(365): Drupal\big_pipe\Render\BigPipe->filterEmbeddedResponse()
#13 /var/www/html/web/core/modules/big_pipe/src/Render/BigPipe.php(304): Drupal\big_pipe\Render\BigPipe->sendPreBody()
#14 /var/www/html/web/core/modules/big_pipe/src/Render/BigPipeResponse.php(112): Drupal\big_pipe\Render\BigPipe->sendContent()
#15 /var/www/html/vendor/symfony/http-foundation/Response.php(381): Drupal\big_pipe\Render\BigPipeResponse->sendContent()
#16 /var/www/html/web/index.php(20): Symfony\Component\HttpFoundation\Response->send()
#17 {main}

What needs to be done, in order to get rid of this warning?

Best,
Orkut

🐛 Bug report
Status

Closed: works as designed

Version

3.0

Component

Code

Created by

🇹🇷Turkey orkut murat yılmaz Istanbul

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.

  • Issue created by @orkut murat yılmaz
  • 🇫🇷France damien laguerre

    This is caused by the "Watch mode".
    If you are on production, you have to disable this functionality in
    Configuration > Development > Performance

    But the error indicates that you can't write to your file directory.
    web/sites/default/files

    Checks the permissions of your directory.
    Something like this might help. Adapt the permissions to your environment.
    chmod 775 web/sites/default/files

  • Status changed to Closed: works as designed over 1 year ago
  • 🇹🇷Turkey kyilmaz80

    I also have this issue. Here is how I solved it:

    The files' permission generated by the function file_put_contents() comes from the PHP process. If the php process runs as root, the generated file is also. When running the drush command as root, the generated files' owner will be root. So, running the drush command as a non-root user solves the issue.

  • 🇹🇷Turkey orkut murat yılmaz Istanbul

    @kyilmaz80, thanks for this comment. it solved my issue too:)

Production build 0.71.5 2024