snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

New Install PHP 5.6+MariaDB error Whoops, looks like something went wrong.

Open Mikomalo opened this issue 7 years ago • 3 comments

Please confirm you have done the following before posting your bug report:

Describe the bug I have made a correct installation and at the time of configuring the setup I have these errors

To Reproduce

(1/1) UnexpectedValueException The stream or file "/var/www/snipe-it/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

in StreamHandler.php line 107 at StreamHandler->write(array('message' => 'exception 'UnexpectedValueException' with message 'The stream or file "/var/www/snipe-it/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied' in /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107Stack trace:#0 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(39): Monolog\Handler\StreamHandler->write(Array)#1 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Logger.php(344): Monolog\Handler\AbstractProcessingHandler->handle(Array)#2 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Logger.php(707): Monolog\Logger->addRecord(400, Object(UnexpectedValueException), Array)#3 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Log/Writer.php(203): Monolog\Logger->error(Object(UnexpectedValueException), Array)#4 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Log/Writer.php(114): Illuminate\Log\Writer->writeLog('error', Object(UnexpectedValueException), Array)#5 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(221): Illuminate\Log\Writer->error(Object(UnexpectedValueException))#6 /var/www/snipe-it/app/Exceptions/Handler.php(39): Illuminate\Support\Facades\Facade::__callStatic('error', Array)#7 /var/www/snipe-it/app/Exceptions/Handler.php(39): Illuminate\Support\Facades\Log::error(Object(UnexpectedValueException))#8 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(314): App\Exceptions\Handler->report(Object(UnexpectedValueException))#9 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(118): Illuminate\Foundation\Http\Kernel->reportException(Object(UnexpectedValueException))#10 /var/www/snipe-it/public/index.php(59): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))#11 {main}', 'context' => array(), 'level' => 400, 'level_name' => 'ERROR', 'channel' => 'production', 'datetime' => object(DateTime), 'extra' => array(), 'formatted' => '[2019-03-28 22:06:25] production.ERROR: exception 'UnexpectedValueException' with message 'The stream or file "/var/www/snipe-it/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied' in /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107Stack trace:#0 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(39): Monolog\Handler\StreamHandler->write(Array)#1 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Logger.php(344): Monolog\Handler\AbstractProcessingHandler->handle(Array)#2 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Logger.php(707): Monolog\Logger->addRecord(400, Object(UnexpectedValueException), Array)#3 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Log/Writer.php(203): Monolog\Logger->error(Object(UnexpectedValueException), Array)#4 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Log/Writer.php(114): Illuminate\Log\Writer->writeLog('error', Object(UnexpectedValueException), Array)#5 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(221): Illuminate\Log\Writer->error(Object(UnexpectedValueException))#6 /var/www/snipe-it/app/Exceptions/Handler.php(39): Illuminate\Support\Facades\Facade::__callStatic('error', Array)#7 /var/www/snipe-it/app/Exceptions/Handler.php(39): Illuminate\Support\Facades\Log::error(Object(UnexpectedValueException))#8 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(314): App\Exceptions\Handler->report(Object(UnexpectedValueException))#9 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(118): Illuminate\Foundation\Http\Kernel->reportException(Object(UnexpectedValueException))#10 /var/www/snipe-it/public/index.php(59): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))#11 {main} '))in AbstractProcessingHandler.php line 39 at AbstractProcessingHandler->handle(array('message' => 'exception 'UnexpectedValueException' with message 'The stream or file "/var/www/snipe-it/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied' in /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107Stack trace:#0 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(39): Monolog\Handler\StreamHandler->write(Array)#1 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Logger.php(344): Monolog\Handler\AbstractProcessingHandler->handle(Array)#2 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Logger.php(707): Monolog\Logger->addRecord(400, Object(UnexpectedValueException), Array)#3 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Log/Writer.php(203): Monolog\Logger->error(Object(UnexpectedValueException), Array)#4 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Log/Writer.php(114): Illuminate\Log\Writer->writeLog('error', Object(UnexpectedValueException), Array)#5 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(221): Illuminate\Log\Writer->error(Object(UnexpectedValueException))#6 /var/www/snipe-it/app/Exceptions/Handler.php(39): Illuminate\Support\Facades\Facade::__callStatic('error', Array)#7 /var/www/snipe-it/app/Exceptions/Handler.php(39): Illuminate\Support\Facades\Log::error(Object(UnexpectedValueException))#8 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(314): App\Exceptions\Handler->report(Object(UnexpectedValueException))#9 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(118): Illuminate\Foundation\Http\Kernel->reportException(Object(UnexpectedValueException))#10 /var/www/snipe-it/public/index.php(59): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))#11 {main}', 'context' => array(), 'level' => 400, 'level_name' => 'ERROR', 'channel' => 'production', 'datetime' => object(DateTime), 'extra' => array()))in Logger.php line 344 at Logger->addRecord(400, object(UnexpectedValueException), array())in Logger.php line 707 at Logger->error(object(UnexpectedValueException), array())in Writer.php line 203 at Writer->writeLog('error', object(UnexpectedValueException), array())in Writer.php line 114 at Writer->error(object(UnexpectedValueException))in Facade.php line 221 at Facade::__callStatic('error', array(object(UnexpectedValueException)))in Handler.php line 39 at Log::error(object(UnexpectedValueException))in Handler.php line 39 at Handler->report(object(UnexpectedValueException))in HandleExceptions.php line 81 at HandleExceptions->handleException(object(UnexpectedValueException))

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Server (please complete the following information):

  • Snipe-IT Version 4.6.14
  • OS: CENTOS 7 kernel 3.10
  • Web Server: [e.g. Apache, IIS] Apache
  • PHP Version PHP 5.6

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Error Messages

  • WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error
  • If a stacktrace is provided in the error, include that too.
  • Any errors that appear in your browser's error console.
  • Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo.
  • Include any additional information you can find in storage/logs and your webserver's logs.

Additional context

  • Is this a fresh install or an upgrade?
  • What OS and web server you're running Snipe-IT on
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc)
  • Include what you've done so far in the installation, and if you got any error messages along the way.
  • Indicate whether or not you've manually edited any data directly in the database

Add any other context about the problem here.

Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.

Mikomalo avatar Mar 28 '19 21:03 Mikomalo

Hello, this has been posted many times. Please check here.

samotelf avatar Mar 28 '19 22:03 samotelf

The other issues only seem to reference SELinux as the cause. I don't have SELinux enabled and I'm having the same error. Thoughts?

tydonk avatar May 02 '19 17:05 tydonk

Your log file isn't writable. This can happen if you accidentally upgraded Snipe-IT as root, or changed the permissions on the storage directory or any subdirectories or files within the storage directory. The storage directory and all files within must be writable by whatever user the web server runs as.

https://snipe-it.readme.io/docs/installation-issues#section-permission-issues

Common installation/upgrading issues and solutions

snipe avatar May 02 '19 22:05 snipe