Symfony Exception

UnexpectedValueException

HTTP 500 Internal Server Error

The stream or file "/var/www/420/storage/logs/request-2024-03-19.log" could not be opened in append mode: failed to open stream: Permission denied
The exception occurred while attempting to log: The stream or file "/var/www/420/storage/logs/request-2024-03-19.log" could not be opened in append mode: failed to open stream: Permission denied
The exception occurred while attempting to log: vCZr9rROdm | HTTP/1.0 404 | 44.222.149.13 | null | GET https://4-20.ru/catalog/dlya-gidrousilitelya-rulya-l [] | 0.017776966094971 s | claudebot | {referer}
Context: ["RESPONSE"]
Context: {"exception":{}}

Exception

UnexpectedValueException

  1.             }
  2.             restore_error_handler();
  3.             if (!is_resource($stream)) {
  4.                 $this->stream null;
  5.                 throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened in append mode: '.$this->errorMessage$url) . Utils::getRecordMessageForException($record));
  6.             }
  7.             stream_set_chunk_size($stream$this->streamChunkSize);
  8.             $this->stream $stream;
  9.         }
  1.         if ($this->nextRotation <= $record['datetime']) {
  2.             $this->mustRotate true;
  3.             $this->close();
  4.         }
  5.         parent::write($record);
  6.     }
  7.     /**
  8.      * Rotates the files.
  9.      */
  1.             $record $this->processRecord($record);
  2.         }
  3.         $record['formatted'] = $this->getFormatter()->format($record);
  4.         $this->write($record);
  5.         return false === $this->bubble;
  6.     }
  7.     /**
  1.                     }
  2.                 }
  3.                 // once the record exists, send it to all handlers as long as the bubbling chain is not interrupted
  4.                 try {
  5.                     if (true === $handler->handle($record)) {
  6.                         break;
  7.                     }
  8.                 } catch (Throwable $e) {
  9.                     $this->handleException($e$record);
  1.      * @param string|Stringable $message The log message
  2.      * @param mixed[]           $context The log context
  3.      */
  4.     public function error($message, array $context = []): void
  5.     {
  6.         $this->addRecord(static::ERROR, (string) $message$context);
  7.     }
  8.     /**
  9.      * Adds a log record at the CRITICAL level.
  10.      *
  1.      */
  2.     protected function writeLog($level$message$context)
  3.     {
  4.         $this->logger->{$level}(
  5.             $message $this->formatMessage($message),
  6.             $context array_merge($this->context$context)
  7.         );
  8.         $this->fireLogEvent($level$message$context);
  9.     }
  1.      * @param  array  $context
  2.      * @return void
  3.      */
  4.     public function error($message, array $context = [])
  5.     {
  6.         $this->writeLog(__FUNCTION__$message$context);
  7.     }
  8.     /**
  9.      * Log a warning message to the logs.
  10.      *
  1.      * @param  array  $context
  2.      * @return void
  3.      */
  4.     public function error($message, array $context = [])
  5.     {
  6.         $this->driver()->error($message$context);
  7.     }
  8.     /**
  9.      * Exceptional occurrences that are not errors.
  10.      *
  1.         $logger->error(
  2.             $e->getMessage(),
  3.             array_merge(
  4.                 $this->exceptionContext($e),
  5.                 $this->context(),
  6.                 ['exception' => $e]
  7.             )
  8.         );
  9.     }
  10.     /**
  1.     public function handleException(Throwable $e)
  2.     {
  3.         self::$reservedMemory null;
  4.         try {
  5.             $this->getExceptionHandler()->report($e);
  6.         } catch (Exception $e) {
  7.             //
  8.         }
  9.         if ($this->app->runningInConsole()) {
HandleExceptions->handleException()

Stack Trace

UnexpectedValueException
UnexpectedValueException:
The stream or file "/var/www/420/storage/logs/request-2024-03-19.log" could not be opened in append mode: failed to open stream: Permission denied
The exception occurred while attempting to log: The stream or file "/var/www/420/storage/logs/request-2024-03-19.log" could not be opened in append mode: failed to open stream: Permission denied
The exception occurred while attempting to log: vCZr9rROdm | HTTP/1.0 404 | 44.222.149.13 | null | GET https://4-20.ru/catalog/dlya-gidrousilitelya-rulya-l [] | 0.017776966094971 s | claudebot | {referer}
Context: ["RESPONSE"]
Context: {"exception":{}}

  at /var/www/420/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:146
  at Monolog\Handler\StreamHandler->write()
     (/var/www/420/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php:125)
  at Monolog\Handler\RotatingFileHandler->write()
     (/var/www/420/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:48)
  at Monolog\Handler\AbstractProcessingHandler->handle()
     (/var/www/420/vendor/monolog/monolog/src/Monolog/Logger.php:379)
  at Monolog\Logger->addRecord()
     (/var/www/420/vendor/monolog/monolog/src/Monolog/Logger.php:626)
  at Monolog\Logger->error()
     (/var/www/420/vendor/laravel/framework/src/Illuminate/Log/Logger.php:183)
  at Illuminate\Log\Logger->writeLog()
     (/var/www/420/vendor/laravel/framework/src/Illuminate/Log/Logger.php:94)
  at Illuminate\Log\Logger->error()
     (/var/www/420/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:590)
  at Illuminate\Log\LogManager->error()
     (/var/www/420/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:252)
  at Illuminate\Foundation\Exceptions\Handler->report()
     (/var/www/420/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:165)
  at Illuminate\Foundation\Bootstrap\HandleExceptions->handleException()