snipe / snipe-it

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

Freash install from Installer gives permission error. #9724

Closed thumperest closed 1 year ago

thumperest commented 3 years ago

Expected Behavior (or desired behavior if a feature request)

Dear All, I freshly installed Ubuntu 20.04.02. after update and upgrade, I tried the Installer of Snipe-IT: wget https://raw.githubusercontent.com/snipe/snipe-it/master/install.sh chmod 744 install.sh ./install.sh

Everything goes smoothly and when I tried to open the setup from browser, I encountered with error:

ErrorException (E_WARNING) file_put_contents(/var/www/html/snipeit/storage/framework/cache/cf/90/cf906e7195218453e4ff6f1bdcdc6b2d9f6cae71): failed to open stream: Permission denied

I didin't do anything. Only fresh install update and installing Snipe-IT. I think there is a problem with the installer.

How can I give permission to who ?


Actual Behavior

has to enter to setup screen


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


Provide answers to these questions:

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.

https://snipe-it.readme.io/docs/getting-help

sjwk commented 3 years ago

I'm seeing the same error on a clean docker container with blank volume and database, pulling from snipe/snipe-it:latest [Tue Jun 22 08:00:26.798695 2021] [php7:error] [pid 68] [client 172.19.0.2:33794] PHP Fatal error: Uncaught ErrorException: file_put_contents(/var/www/html/storage/framework/cache/cf/90/cf906e7195218453e4ff6f1bdcdc6b2d9f6cae71): failed to open stream: Permission denied in /var/www/html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:133

I've noticed that if I start the container with empty database, it creates a load of database content as it runs the initial migrations, but the web content errors as above when you try to go to the page to run the initial setup wizard. If I stop and start the container again with that initial database content present, it works.

Not sure whether that helps your problem with a native install (try restarting apache after reaching that point?). Or if it helps someone with diagnosing the issue - or if the issues are different with native and docker installs, just resulting in the same error?

nbrew commented 3 years ago

Also using the latest image from docker hub I was seeing permissions-related errors in my apache2 log and could not get the setup web page to load. Running the chain of commands from the Quick Tip: Handy Commands made it so I could load and complete my setup.

Those commands were:

composer dump-autoload; php artisan cache:clear; php artisan config:clear; php artisan route:clear; php artisan dugbar:clear; php artisan event:clear; php artisan view:clear; php artisan optimize:clear; php artisan clear-compiled