snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
11k stars 3.17k forks source link

The stream or file "/var/www/snipe-it/storage/logs/laravel.log" could not be opened in append mode #11721

Closed v0idxyz closed 2 years ago

v0idxyz commented 2 years ago

Debug mode

Describe the bug

After following this Guide: https://www.vultr.com/de/docs/how-to-install-snipe-it-on-ubuntu-20-04/ Getting the Stated error when trying to access 192.168.8.68

Reproduction steps

  1. Follow the Guide
  2. Visit Servers Ip Adress

Expected behavior

I don't know, i guess there shouldn't be an error and I should be ready to install

Screenshots

No response

Snipe-IT Version

newest

Operating System

Ubuntu Server 20.04

Web Server

Apache

PHP Version

7.4

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

Error:
The stream or file "/var/www/snipe-it/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied The exception occurred while attempting to log: UnexpectedValueException: The stream or file "/var/www/snipe-it/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied The exception occurred while attempting to log: UnexpectedValueException: The stream or file "/var/www/snipe-it/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied The exception occurred while attempting to log: Your APP_URL in your .env is misconfigured - it is: 192.168.8.86. Many things will work strangely unless you fix it. in /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:146 Stack trace: #0 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(48): Monolog\Handler\StreamHandler->write() #1 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Logger.php(379): Monolog\Handler\AbstractProcessingHandler->handle() #2 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Logger.php(626): Monolog\Logger->addRecord() #3 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Log/Logger.php(183): Monolog\Logger->error() #4 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Log/Logger.php(94): Illuminate\Log\Logger->writeLog() #5 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(590): Illuminate\Log\Logger->error() #6 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Log\LogManager->error() #7 /var/www/snipe-it/app/Providers/AppServiceProvider.php(53): Illuminate\Support\Facades\Facade::__callStatic() #8 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Providers\AppServiceProvider->boot() #9 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() #10 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure() #11 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod() #12 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\Container\BoundMethod::call() #13 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(924): Illuminate\Container\Container->call() #14 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(905): Illuminate\Foundation\Application->bootProvider() #15 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}() #16 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(906): array_walk() #17 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\Foundation\Application->boot() #18 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(237): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap() #19 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(153): Illuminate\Foundation\Application->bootstrapWith() #20 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(137): Illuminate\Foundation\Http\Kernel->bootstrap() #21 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() #22 /var/www/snipe-it/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle() #23 {main} in /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:146 Stack trace: #0 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(48): Monolog\Handler\StreamHandler->write() #1 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Logger.php(379): Monolog\Handler\AbstractProcessingHandler->handle() #2 /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Logger.php(626): Monolog\Logger->addRecord() #3 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Log/Logger.php(183): Monolog\Logger->error() #4 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Log/Logger.php(94): Illuminate\Log\Logger->writeLog() #5 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(590): Illuminate\Log\Logger->error() #6 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Log\LogManager->error() #7 /var/www/snipe-it/app/Exceptions/Handler.php(44): Illuminate\Support\Facades\Facade::__callStatic() #8 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(415): App\Exceptions\Handler->report() #9 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(113): Illuminate\Foundation\Http\Kernel->reportException() #10 /var/www/snipe-it/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle() #11 {main}

php -m:
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
ldap
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

Additional context

No response

welcome[bot] commented 2 years ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

v0idxyz commented 2 years ago

Also dont hit me with the usual "Make Sure to chmod the log files" because in /var/www/snipe-it/ there is no logs folder

v0idxyz commented 2 years ago

Ok i fixed the first issue by adding http:// in front of the IP in the .env file

aquadiode commented 2 years ago

Also dont hit me with the usual "Make Sure to chmod the log files" because in /var/www/snipe-it/ there is no logs folder

What about the storage folder? The path is supposed to be /var/www/snipe-it/storage/logs/laravel.log The tutorial you linked to sets permissions for the snipe folder but I don't think mentions permissions for storage, public/uploads, boostrap/cache to 775 in the Snipe-IT docs. Also check the user is in the right group, whether SELinux is running.

snipe commented 2 years ago

Glad to hear you're all sorted! In the future, if you've resolved your issue, please try to remember to close your ticket - it helps us out a lot. (We have to manage a lot of tickets.)

tenant-tyvm