Ask, reply and learn. Join the community of Akaunting.
Ever since I upgrade to .27, I get a crash every day because the laravel log file is created as the root user. Assuming this is not a bug, How do I tell Akaunting to create the file as the correct user?
Here's the error I get EVERY. DAY. since upgrading to .27 and when a new log file is created - I chown and I'm good for another 24 hours:
UnexpectedValueException
HTTP 500 Internal Server Error
The stream or file "/akaunting/storage/logs/laravel-2021-11-18.log" could not be opened in append mode: failed to open stream: Permission denied
Exception Stack Trace
UnexpectedValueException
in /akaunting/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php (line 146)
in /akaunting/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php -> write (line 125)
in /akaunting/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php -> write (line 48)
in /akaunting/vendor/monolog/monolog/src/Monolog/Logger.php -> handle (line 327)
in /akaunting/vendor/monolog/monolog/src/Monolog/Logger.php -> addRecord (line 565)
in /akaunting/vendor/laravel/framework/src/Illuminate/Log/Logger.php -> error (line 183)
in /akaunting/vendor/laravel/framework/src/Illuminate/Log/Logger.php -> writeLog (line 94)
in /akaunting/vendor/laravel/framework/src/Illuminate/Log/LogManager.php -> error (line 581)
in /akaunting/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php -> error (line 252)
Handler->report(object(UnexpectedValueException)) in /akaunting/app/Exceptions/Handler.php (line 43)
*
* @throws \Exception
*/
public function report(Throwable $exception)
{
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
in /akaunting/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php -> report (line 136)
HandleExceptions->handleException(object(UnexpectedValueException))
DYING OVER HERE ....
-S.
Hello Scott. I Believe you are running your project in self-hosted installation right?
Take a look at this tutorial to fix your project permissions.
https://vijayasankarn.wordpress.com/2017/02/04/securely-setting-file-permissions-for-laravel-framework/
Hi, Thanks for the reply! Correct, self-hosted and Unfortunately, I have all those permissions set: All files are 644 and all directories are 755.
The problem is, the log file is getting created by the root user. Everything was working fine until I upgraded to 2.1.27.
Showing 1 to 4 of 4 discussions