snipe / snipe-it

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

Upgrading issues with install.sh install #15049

Open Tobii212 opened 2 weeks ago

Tobii212 commented 2 weeks ago

Debug mode

Describe the bug

I have two installs of Snipe-It production and a new server built with install.sh when i try to run the php upgrade.php command i get permission errors. Not writeable i would change the permissions for Users group and owner to make all writeable this would work until i reach here

[snipeusr@po-snipeit-svr snipeit]$ php upgrade.php

WELCOME TO THE SNIPE-IT UPGRADER!

This script will attempt to:

Launching using branch: master Found PHP requirements, will check for PHP > 8.1.0 and < 8.4.0 Proceed with upgrade? [y/N]: y


STEP 1: Checking .env file:

√ Your APP_KEY is not blank. √ Your APP_URL is not null or blank. It is set to http://po-snipeit-svr √ Your APP_URL is set to http://po-snipeit-svr and starts with the protocol (https:// or http://) √ Your APP_URL (http://po-snipeit-svr) does not have a trailing slash.


STEP 2: Checking PHP requirements: (Required PHP >=8.1.0 - <8.4.0)

√ Current PHP version: (8.2.20) is at least 8.1.0 and less than 8.4.0! Continuing... FYI: The php.ini used by this PHP is: /etc/php.ini

Checking Required PHP extensions...

√ bcmath is installed! √ curl is installed! √ exif is installed! √ fileinfo is installed! √ gd is installed! √ json is installed! √ ldap is installed! √ mbstring is installed! √ mysqli is installed! √ openssl is installed! √ PDO is installed! √ sodium is installed! √ tokenizer is installed! √ xml is installed! √ zip is installed!


STEP 3: Checking directory permissions:

√ /var/www/html/snipeit/bootstrap/cache is writable √ /var/www/html/snipeit/storage is writable √ /var/www/html/snipeit/storage/logs is writable √ /var/www/html/snipeit/storage/logs/laravel.log is writable √ /var/www/html/snipeit/storage/framework is writable √ /var/www/html/snipeit/storage/framework/cache is writable √ /var/www/html/snipeit/storage/framework/sessions is writable √ /var/www/html/snipeit/storage/framework/views is writable √ /var/www/html/snipeit/storage/app is writable √ /var/www/html/snipeit/storage/app/backups is writable √ /var/www/html/snipeit/storage/private_uploads is writable √ /var/www/html/snipeit/public/uploads is writable


The following directories/files do not seem writable:

✘ PERMISSIONS ERROR: /var/www/html/snipeit/storage/app/backup-temp is NOT writable --------------------- !! ERROR !! ---------------------- Please check the permissions on the directories above and re-run this script. ------------------------- :( ---------------------------

[snipeusr@po-snipeit-svr snipeit]$ cd /var/www/html/snipeit/storage/app/ [snipeusr@po-snipeit-svr app]$ ls -l total 0 drwxrwxrwx. 3 snipeitapp apache 43 Jun 28 05:19 backups [snipeusr@po-snipeit-svr app]$ sudo -u snipeitapp upgrade.php [sudo] password for snipeusr: sudo: upgrade.php: command not found [snipeusr@po-snipeit-svr app]$ sudo -u snipeitapp php upgrade.php Could not open input file: upgrade.php [snipeusr@po-snipeit-svr app]$ cd /var/www/html/snipeit/ [snipeusr@po-snipeit-svr snipeit]$ sudo -u snipeitapp php upgrade.php

WELCOME TO THE SNIPE-IT UPGRADER!

This script will attempt to:

Launching using branch: master Found PHP requirements, will check for PHP > 8.1.0 and < 8.4.0 Proceed with upgrade? [y/N]: y


STEP 1: Checking .env file:

√ Your APP_KEY is not blank. √ Your APP_URL is not null or blank. It is set to http://po-snipeit-svr √ Your APP_URL is set to http://po-snipeit-svr and starts with the protocol (https:// or http://) √ Your APP_URL (http://po-snipeit-svr) does not have a trailing slash.


STEP 2: Checking PHP requirements: (Required PHP >=8.1.0 - <8.4.0)

√ Current PHP version: (8.2.20) is at least 8.1.0 and less than 8.4.0! Continuing... FYI: The php.ini used by this PHP is: /etc/php.ini

Checking Required PHP extensions...

√ bcmath is installed! √ curl is installed! √ exif is installed! √ fileinfo is installed! √ gd is installed! √ json is installed! √ ldap is installed! √ mbstring is installed! √ mysqli is installed! √ openssl is installed! √ PDO is installed! √ sodium is installed! √ tokenizer is installed! √ xml is installed! √ zip is installed!


STEP 3: Checking directory permissions:

√ /var/www/html/snipeit/bootstrap/cache is writable √ /var/www/html/snipeit/storage is writable √ /var/www/html/snipeit/storage/logs is writable √ /var/www/html/snipeit/storage/logs/laravel.log is writable √ /var/www/html/snipeit/storage/framework is writable √ /var/www/html/snipeit/storage/framework/cache is writable √ /var/www/html/snipeit/storage/framework/sessions is writable √ /var/www/html/snipeit/storage/framework/views is writable √ /var/www/html/snipeit/storage/app is writable √ /var/www/html/snipeit/storage/app/backups is writable √ /var/www/html/snipeit/storage/private_uploads is writable √ /var/www/html/snipeit/public/uploads is writable


The following directories/files do not seem writable:

✘ PERMISSIONS ERROR: /var/www/html/snipeit/storage/app/backup-temp is NOT writable --------------------- !! ERROR !! ---------------------- Please check the permissions on the directories above and re-run this script. ------------------------- :( ---------------------------

[snipeusr@po-snipeit-svr snipeit]$

i'm now stuck on another permission issue and this is for the new server not the old one i would rather upgrade as it has my entire database.

also this new v7 does not let me import anything with error 500

The /var/www/html/snipeit/bootstrap/cache directory must be present and writable

Reproduction steps

  1. change the permissions chmod -R ugr+w snipeit 2php upgrade.php 3.sudo -u snipeitapp php upgrade.php ...

Expected behavior

upgrade to latest v7.0.7 able to upload from a fresh install without error 500 or permissions issues.

Screenshots

No response

Snipe-IT Version

7.0.6

Operating System

almalinux

Web Server

apache

PHP Version

8.2.20

Operating System

Windows 11 Enterprise

Browser

opera

Version

111.0.5168.55

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

its a fresh install twice on a VM tried upgrading and importing content since the main server also has issues upgrading.

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

snipe commented 2 weeks ago

You'll need to create those directories and make them writable by the web server

Tobii212 commented 2 weeks ago

hmmn ok so after a fresh install it wont have those permissions? update So the upgrade was successful on my new install the old v6 is an issue. i will try to do a backup and restore or move the manual way but thank you so much even if it was a simple fix.

snipe commented 2 weeks ago

I mean, the install.sh should create those dirs, but it's possible on v6 we at some point didn't account for new dirs? It's possible, but if I'm not sure we'd go back and fix it at this point. Sounds like you're sorted tho?