Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No log files being created in /storage/logs folder #14152

Open
2 tasks done
lazyitdrone opened this issue Jan 23, 2024 · 8 comments
Open
2 tasks done

No log files being created in /storage/logs folder #14152

lazyitdrone opened this issue Jan 23, 2024 · 8 comments
Assignees
Labels

Comments

@lazyitdrone
Copy link

Debug mode

Describe the bug

Trying to troubleshoot another issue, but snipeit is not generating any log files in /var/www/snipeit/storage/logs

Reproduction steps

n/a

Expected behavior

Log files being generated as app is used and modified as part of setting up for location

Screenshots

No response

Snipe-IT Version

v6.2.4-pre build 12343 (gb23ce6cfc)

Operating System

Ubuntu 22.04.3 LTS

Web Server

apache2 2.4.52-1ubuntu4.7

PHP Version

php 2:8.1+92ubuntu1

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

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

[Zend Modules]
Zend OPcache

Additional context

Fresh install

Version of Snipe-IT you're running. (If you didn't grab an official release, let us know which branch you pulled from.)
v6.2.4-pre build 12343 (gb23ce6cfc)
What OS and web server you're running Snipe-IT on
Ubuntu 22.04.3 LTS
apache2 2.4.52-1ubuntu4.7
What method you used to install Snipe-IT (install.sh, manual installation, docker, etc)
Git
If you're getting an error in your browser, include that error.
n/a
What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error
n/a
If a stacktrace is provided in the error, include that too.
n/a
Any errors that appear in your browser's error console.
None that I see
Confirm whether the error is reproduceable on the demo.
n/a
Include any additional information you can find in storage/logs and your webserver's logs.
not relevant?
Include what you've done so far in the installation, and if you got any error messages along the way.
Installation is complete, can add users via LDAP, create locations, etc
Indicate whether or not you've manually edited any data directly in the database
No

log folder permissions:
snipeit@server:/var/www/snipeit/storage/logs$ ls -la
total 12
drwxrwxr-x 2 snipeit www-data 4096 Jan 22 14:20 .
drwxrwxr-x 7 snipeit www-data 4096 Jan 19 20:46 ..
-rwxrwxr-x 1 snipeit www-data 14 Jan 19 17:18 .gitignore

trying to see if Apache logs captured anything related to SnipeIT logs folder:
snipeit@$server:/var/www/snipeit/storage/logs$ sudo grep -R /var/log -e "/var/www/snipeit/storage/logs/"
/var/log/auth.log:Jan 23 14:41:45 $server sudo: snipeit : TTY=pts/0 ; PWD=/var/www/snipeit/storage/logs ; USER=root ; COMMAND=/usr/bin/grep -R /var/log -e /var/www/snipeit/storage/logs/
grep: /var/log/journal/0fe10fa460a64fdcbb67653e45114211/user-1000.journal: binary file matches

Also ran script provided on installation website to ensure subfolders have proper permissions:
sudo chown -R snipeit:www-data /var/www/snipeit
sudo usermod -a -G www-data snipeit
sudo find /var/www/snipeit -type f -exec chmod 664 {} ;
sudo chmod -R 775 /var/www/snipeit/storage
sudo chmod -R 775 /var/www/snipeit/public/uploads
sudo chmod -R 775 /var/www/snipeit/bootstrap/cache

Copy link

welcome bot commented Jan 23, 2024

👋 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.

@lazyitdrone
Copy link
Author

Anyone have any ideas? Or is there any commands I could run to produce more data?

@snipe
Copy link
Owner

snipe commented Feb 5, 2024

What is the output if you run:

ls -al /var/www/snipeit/storage

And also:

php artisan tinker
\Log::error('test');

@lazyitdrone
Copy link
Author

Seems the Snipe-IT user didn't have access to the lavaral.log folder. Might have sorted it out:

snipeit@$server:$ ls -al /var/www/snipeit/storage
total 280
drwxrwxr-x 7 snipeit www-data 4096 Jan 19 20:46 .
drwxr-xr-x 19 snipeit www-data 4096 Jan 29 13:46 ..
drwxrwxr-x 4 snipeit www-data 4096 Jan 19 21:00 app
drwxrwxr-x 2 snipeit www-data 245760 Feb 5 17:48 debugbar
drwxrwxr-x 5 snipeit www-data 4096 Jan 19 17:18 framework
-rwxrwxr-x 1 snipeit www-data 2490 Feb 1 15:28 ldap_client_tls.cert
drwxrwxr-x 2 snipeit www-data 4096 Feb 1 15:11 logs
-rwxrwxr-x 1 snipeit www-data 3322 Jan 19 20:37 oauth-private.key
-rwxrwxr-x 1 snipeit www-data 812 Jan 19 20:37 oauth-public.key
drwxrwxr-x 13 snipeit www-data 4096 Jan 19 17:18 private_uploads
snipeit@$server:
$
snipeit@$server:~$ cd /var/www/snipeit/
snipeit@$server:/var/www/snipeit$ php artisan tinker
Psy Shell v0.11.7 (PHP 8.1.2-1ubuntu2.14 — cli) by Justin Hileman

\Log::error('test');
UnexpectedValueException with message 'The stream or file "/var/www/snipeit/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied
The exception occurred while attempting to log: test'

snipeit@$server:/var/www/snipeit$ cd /var/www/snipeit/storage/logs/
snipeit@$server:/var/www/snipeit/storage/logs$ ls -la
total 28
drwxrwxr-x 2 snipeit www-data 4096 Feb 1 15:11 .
drwxrwxr-x 7 snipeit www-data 4096 Jan 19 20:46 ..
-rwxrwxr-x 1 snipeit www-data 14 Jan 19 17:18 .gitignore
-rw-r--r-- 1 www-data www-data 15489 Feb 1 19:02 laravel.log
snipeit@$server:/var/www/snipeit/storage/logs$ sudo chown snipeit *
[sudo] password for snipeit:
snipeit@$server:/var/www/snipeit/storage/logs$ ls -la
total 28
drwxrwxr-x 2 snipeit www-data 4096 Feb 1 15:11 .
drwxrwxr-x 7 snipeit www-data 4096 Jan 19 20:46 ..
-rwxrwxr-x 1 snipeit www-data 14 Jan 19 17:18 .gitignore
-rw-r--r-- 1 snipeit www-data 15489 Feb 1 19:02 laravel.log
snipeit@$server:/var/www/snipeit/storage/logs$ chmod 775 laravel.log
snipeit@$server:/var/www/snipeit/storage/logs$ cd ..
snipeit@$server:/var/www/snipeit/storage$ cd ..
snipeit@$server:/var/www/snipeit$ php artisan tinker
Psy Shell v0.11.7 (PHP 8.1.2-1ubuntu2.14 — cli) by Justin Hileman

\Log::error('test');
=> null

exit
Exit: Goodbye

snipeit@$server:/var/www/snipeit$ cat /var/www/snipeit/storage/logs/laravel.log | tail
#0 {main}
"}
[2024-02-01 14:02:41] production.ERROR: Symfony\Component\ErrorHandler\Error\FatalError: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/snipeit/vendor/barryvdh/laravel-debugbar/src/LaravelDebugbar.php:877
Stack trace:
#0 {main}
[2024-02-01 14:02:41] production.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) {"userId":1301,"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) at /var/www/snipeit/vendor/barryvdh/laravel-debugbar/src/LaravelDebugbar.php:877)
[stacktrace]
#0 {main}
"}
[2024-02-05 13:22:14] production.ERROR: test

@jeffjoseph
Copy link

have any one found out the solution...

@StarlessNights
Copy link
Contributor

No log files produced in the docker container either. (Context: trying to debug SAML issues)

@senorleung
Copy link

Having same issue with Ubuntu 22.04

@lazyitdrone
Copy link
Author

I'm getting some things now, but since the logs don't induce a timestamp, I can only go off the output of "ls-la".

snipeit@cqv015x:~$ ls -la /var/www/snipeit/storage/logs/laravel.log
-rwxrwxr-x 1 snipeit www-data 3746528 Mar 22 16:14 /var/www/snipeit/storage/logs/laravel.log

Last few entires:
#90 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#91 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
#92 /var/www/snipeit/app/Http/Middleware/NoSessionStore.php(28): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#93 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\NoSessionStore->handle()
#94 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#95 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline->then()
#96 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#97 /var/www/snipeit/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle()
#98 {main}

@snipe snipe added the saml label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants