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

Trying to upgrade from Snipe IT 5.1.1 to 5.1.3 #9368

Closed karthik8223 closed 3 years ago

karthik8223 commented 3 years ago

Expected Behavior (or desired behavior if a feature request)

(what you expect to happen goes here)

I was hoping my snipeit will be upgraded to 5.1.3 by running php upgrade.php

Actual Behavior

(what actually happens goes here)

It says permission issue which Im not sure what to do.

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


Provide answers to these questions:

SnipeIT Upgrade from 5 1 1 to 5 1 3  (3) SnipeIT Upgrade from 5 1 1 to 5 1 3  (2) SnipeIT Upgrade from 5 1 1 to 5 1 3

There are no errors so far like stated below. Im just trying to upgrade my snipe it. I have attached the screenshot above this. Please help me take a look

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

welcome[bot] commented 3 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.

novastream commented 3 years ago

Does your user (administrator) have write permissions? Which user/group comes up as owner when you run ls -l when you are inside the snipe-it directory?

karthik8223 commented 3 years ago

Does your user (administrator) have write permissions? Which user/group comes up as owner when you run ls -l when you are inside the snipe-it directory?

Hi Jonathan, first of all thank you so much for your reply and helping me on this. I will check them and let you know. I remembered i gave admin rights to the snipe it directory, but i will recheck them and update you.

karthik8223 commented 3 years ago

SnipeIT Root user

Hi Jonathan, they are all in root access and we cant run php upgrade.php as root right ? I have to change the root user to administrator user ?

novastream commented 3 years ago

Correct, so you should change the owner to administrator by running: sudo chown -R $USER:$USER /var/www/your_domain

Here is a good start how to setup a LEMP stack: https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-20-04

DigitalOcean
How To Install Linux, Nginx, MySQL, PHP (LEMP stack) on Ubuntu 20.04 | DigitalOcean
The LEMP software stack is a group of software that can be used to serve dynamic web pages and web applications written in PHP. This is an acronym that describes a Linux operating system, with an Nginx (pronounced like “Engine-X”) web server. The back
karthik8223 commented 3 years ago

Correct, so you should change the owner to administrator by running: sudo chown -R $USER:$USER /var/www/your_domain

Here is a good start how to setup a LEMP stack: https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-20-04

Hi Jonathan, yes. I was able to upgrade my snipeit after changing the owner to administrator. but after complete with the upgrade, I can't access the page. Please help me on where to troubleshoot. I have changed back the permission to root but still not possible to access the snipe it page.

Thank you so much for helping.

DigitalOcean
How To Install Linux, Nginx, MySQL, PHP (LEMP stack) on Ubuntu 20.04 | DigitalOcean
The LEMP software stack is a group of software that can be used to serve dynamic web pages and web applications written in PHP. This is an acronym that describes a Linux operating system, with an Nginx (pronounced like “Engine-X”) web server. The back
novastream commented 3 years ago

When you get an error or a white page we need to take a quick look at the logs.

If you go to /var/log/ and check your apache/nginx error log and your PHP error log, do you have any errors ?

karthik8223 commented 3 years ago

When you get an error or a white page we need to take a quick look at the logs.

If you go to /var/log/ and check your apache/nginx error log and your PHP error log, do you have any errors ?

Hi jonathan, i should open the snipeit.error.log ? Error New

karthik8223 commented 3 years ago

I opened snipeIT.error.log, it came out this.

[Tue Apr 06 07:22:53.474264 2021] [php7:error] [pid 28857] [client 192.168.1.100:63900] PHP Fatal error: Uncaught ErrorException: file_put_contents(/var/www/snipeit/storage/framework/cache/cf/90/cf906e7195218453e4ff6f1bdcdc6b2d9f6cae71): failed to open stream: No such file or directory in /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:133\nStack trace:\n#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()\n#1 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(133): file_put_contents()\n#2 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php(74): Illuminate\Filesystem\Filesystem->put()\n#3 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php(152): Illuminate\Cache\FileStore->put()\n#4 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(355): Illuminate\Cache\FileStore->forever()\n#5 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(418): Illuminate\Cache\Repository->forever()\n#6 /var/www/snipeit/vendor/laravel/framewor in /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php on line 133

karthik8223 commented 3 years ago

Sorry Jonathan, i got it. it was the storage folder owner issue. I have set it to www-data. That's the reason of the error. Any idea how to change that to administrator ?

Solved

novastream commented 3 years ago

Glad to hear that you got it working. Take a look at the link below and I think you will understand how to setup a nginx + php with an "regular" user.

https://www.getpagespeed.com/server-setup/nginx-and-php-fpm-what-my-permissions-should-be

GetPageSpeed
NGINX and PHP-FPM. What my permissions should be? - GetPageSpeed
Proper file permissions and ownership model for NGINX / PHP-FPM powered websites. The secure chmod and shown setup
karthik8223 commented 3 years ago

Awesome will definitely look into it and big thanks to you for helping me on this. Have a great day and weekend ahead.