snipe / snipe-it

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

Snipe-IT permissions | php upgrade.php #11874

Closed samotelf closed 1 year ago

samotelf commented 1 year ago

Debug mode

Describe the bug

Hello. I did a Snipe-IT migration to another server and I have some questions that I will separate with different issues:

So, I have followed the steps here and Snipe-IT is up and running, however and I hope this is a problem with the upgrade.php script, everytime I do a php upgrade.php I get the following:

Skipping user check as it is not supported on Windows or Posix is not installed on this server.

WELCOME TO THE SNIPE-IT UPGRADER!

This script will attempt to:


STEP 1: Checking .env file:

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


STEP 2: Checking PHP requirements:

Current PHP version: (8.0.23) is at least 7.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! √ 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/app/backup-temp is writable √ /var/www/html/snipeit/storage/private_uploads is writable √ /var/www/html/snipeit/public/uploads is writable


STEP 4: Backing up database:

-- Starting backup... Dumping database snipeit... Determining files to backup... Zipping 16403 files and directories... Created zip containing 16403 files and directories. Size is 73.08 MB Copying zip to disk named backup... Successfully copied zip to disk named backup. Backup completed!


STEP 5: Putting application into maintenance mode:

-- Application is now in maintenance mode.


STEP 6: Pulling latest from Git (master branch):

Git is installed. Already on 'master' -- Saved working directory and index state WIP on master: b4518677b Merge pull request #11762 from geo-chen/master -- M resources/views/auth/login.blade.php Your branch is up to date with 'origin/master'. -- Already up to date.


STEP 7: Cleaning up old cached files:

√ No bootstrap/cache/compiled.php, so nothing to delete. √ Deleting bootstrap/cache/services.php. It is no longer used. √ Deleting bootstrap/cache/config.php. It is no longer used. √ No vendor/symfony/translation/TranslatorInterface.php, so nothing to delete.

-- Configuration cache cleared! -- Application cache cleared! -- Route cache cleared! -- Compiled views cleared!


STEP 8: Updating composer dependencies: (This may take a moment.)

-- Running the app in production mode. -- We couldn't find a local composer.phar. No worries, trying globally. Since you are running composer globally, we won't try to update it for you. If you run into issues with this step, try running composer self-update before running this updater again

Installing dependencies from lock file Verifying lock file contents can be installed on current platform. Nothing to install, update or remove Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead. Package patchwork/utf8 is abandoned, you should avoid using it. Use symfony/polyfill-mbstring or symfony/string instead. Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead. Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested. Generating optimized autoload files Class ParsedownTest located in ./vendor/erusev/parsedown/test/ParsedownTest.php does not comply with psr-0 autoloading standard. Skipping.

Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi @php artisan vendor:publish --force --tag=livewire:assets --ansi 85 packages you are using are looking for funding. Use the composer fund command to find out more! Class ParsedownTest located in ./vendor/erusev/parsedown/test/ParsedownTest.php does not comply with psr-0 autoloading standard. Skipping. Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi @php artisan vendor:publish --force --tag=livewire:assets --ansi** Generating optimized autoload files Discovered Package: arietimmerman/laravel-scim-server Discovered Package: barryvdh/laravel-debugbar Discovered Package: barryvdh/laravel-dompdf Discovered Package: eduardokum/laravel-mail-auto-embed Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: intervention/image Discovered Package: laravel/passport Discovered Package: laravel/slack-notification-channel Discovered Package: laravel/tinker Discovered Package: laravel/ui Discovered Package: laravelcollective/html Discovered Package: livewire/livewire Discovered Package: maatwebsite/excel Discovered Package: mediconesystems/livewire-datatables Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Discovered Package: pragmarx/google2fa-laravel Discovered Package: spatie/laravel-backup Discovered Package: unicodeveloper/laravel-password Package manifest generated successfully. Copied Directory [/vendor/livewire/livewire/dist] To [/public/vendor/livewire] Publishing complete. Generated optimized autoload files containing 8571 classes

Discovered Package: arietimmerman/laravel-scim-server Discovered Package: barryvdh/laravel-debugbar Discovered Package: barryvdh/laravel-dompdf Discovered Package: eduardokum/laravel-mail-auto-embed Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: intervention/image Discovered Package: laravel/passport Discovered Package: laravel/slack-notification-channel Discovered Package: laravel/tinker Discovered Package: laravel/ui Discovered Package: laravelcollective/html Discovered Package: livewire/livewire Discovered Package: maatwebsite/excel Discovered Package: mediconesystems/livewire-datatables Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Discovered Package: pragmarx/google2fa-laravel Discovered Package: spatie/laravel-backup Discovered Package: unicodeveloper/laravel-password Package manifest generated successfully. Copied Directory [/vendor/livewire/livewire/dist] To [/public/vendor/livewire] Publishing complete.

STEP 9: Migrating database:

Nothing to migrate.


STEP 10: Checking for OAuth keys:

√ OAuth keys detected. Skipping passport install.


STEP 11: Taking application out of maintenance mode:

-- Application is now live.

---------------------- FINISHED! ----------------------- All done! Clear your browser cookies and re-login to use your upgraded Snipe-IT!

Please take a look at the bold and advise if this is fine, namely:

  1. Skipping user check as it is not supported on Windows or Posix is not installed on this server.

  2. **Class ParsedownTest located in ./vendor/erusev/parsedown/test/ParsedownTest.php does not comply with psr-0 autoloading standard. Skipping.

  3. Illuminate\Foundation\ComposerScripts::postAutoloadDump

  4. @php artisan package:discover --ansi

  5. @php artisan vendor:publish --force --tag=livewire:assets --ansi

  6. 85 packages you are using are looking for funding.

  7. Use the composer fund command to find out more!

  8. Class ParsedownTest located in ./vendor/erusev/parsedown/test/ParsedownTest.php does not comply with psr-0 autoloading standard. Skipping.

  9. Illuminate\Foundation\ComposerScripts::postAutoloadDump

  10. @php artisan package:discover --ansi

  11. @php artisan vendor:publish --force --tag=livewire:assets --ansi**

This is when I ran the upgrade.php as root and per documentation we don't want that, so I'll run now as snipeit user who is a member of apache: apache:x:48:snipeit

So the result is the same except:


STEP 7: Cleaning up old cached files:

√ No bootstrap/cache/compiled.php, so nothing to delete. √ Deleting bootstrap/cache/services.php. It is no longer used. √ No bootstrap/cache/config.php, so nothing to delete. √ No vendor/symfony/translation/TranslatorInterface.php, so nothing to delete.

-- Configuration cache cleared! -- Failed to clear cache. Make sure you have the appropriate permissions. -- Route cache cleared! -- Compiled views cleared!

So, I'll check permissions per documentation here: chmod -R 775 storage chmod -R 775 public/uploads chmod -R 775 bootstrap/cache

Which is correct: image

I did also this per documentation here sudo chown -R snipeit:apache /var/www/snipeit sudo usermod -a -G apache 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

I'm sorry for the long post, it's just that this things kind of make me itch :)

Hope for your feedback.

Reproduction steps

1. 2. 3. ...

Expected behavior

No errors when running php upgrade.php:

  1. Skipping user check as it is not supported on Windows or Posix is not installed on this server.

  2. -- Failed to clear cache. Make sure you have the appropriate permissions.

  3. **Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead. Package patchwork/utf8 is abandoned, you should avoid using it. Use symfony/polyfill-mbstring or symfony/string instead. Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead. Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested. Generating optimized autoload files Class ParsedownTest located in ./vendor/erusev/parsedown/test/ParsedownTest.php does not comply with psr-0 autoloading standard. Skipping.

    Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi @php artisan vendor:publish --force --tag=livewire:assets --ansi**

Screenshots

No response

Snipe-IT Version

6.0.10

Operating System

Alma Linux 9.0 Emerald Puma

Web Server

Apache

PHP Version

PHP 8.0.23

Operating System

Windows

Browser

Chrome

Version

101.0.4951.64

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

snipe commented 1 year ago

Yep, those are all just warnings and/or informative text - that upgrade seems like it went fine.