Jeremy Davis's picture

This is a repost of Fernando Rapa's Snipe-IT update question (comment on another thread).


Hello Turnkey community.

I love the work you all do here, making easy to get apps, that otherwise could take hours or days for us to vetted and installed, I am currently exploring the application Snipe-it as IT asset manager, and it looks very good so far.

However when I start checking the bugs in the system I noticed a huge version gap between Snipe-it and the Turnkey iso.

I am trying to update it following Snipe-it instructions but I am getting a lot of troubles

Are you planning to get a newest version? or at least a easy way to get the latest version in that VM?

Thanks in advance.

Forum: 
Jeremy Davis's picture

Hi Fernando, thanks for your question and reporting your issues updating Snipe-IT.

We do try to keep track of the upstream versions and release updated apps when we can. Although unfortunately we have limited resources, so the installed versions of some upstream software does age a bit between our releases. So I'll add Snipe-IT to the list, but I'm not 100% sure when a new release will happen.

In the meantime, here are instructions to update the current v18.0 Snipe-IT appliance to the latest Snipe-IT version (i.e. v6.x -> v7.1.15).

I have tested the update steps below in a fresh v18.0 Snipe-IT install and it appears to have worked fine. However, if you have any data in your Snipe-IT server be sure to make a backup first! It should work fine, but you should always create a backup before doing anything that is potentially destructive!

To update Snipe-IT, log into your v18.x Snipe-IT server as root and in a terminal run the following commands:

cd /var/www/snipe-it
git pull
chown -R www-data:www-data ./
turnkey-composer install --no-dev --prefer-source
turnkey-composer dump-autoload
turnkey-artisan migrate
turnkey-artisan config:clear
turnkey-artisan route:clear
turnkey-artisan cache:clear
turnkey-artisan view:clear
MP's picture

Hi Jeremy,
Im getting the following errors, when i try to Update my Snipe IT 18.0.1
Snipe-IT version:v6.4.1 build 13386 (g4642f50d6b)
PHP Version:8.1.32
___________
turnkey-composer install --no-dev --prefer-source
fails, there are a lot of errors with the php version:
requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement
________
when I install php 8.2 i get this error:

root@snipeit .../www/snipe-it# turnkey-composer dump-autoload
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

In ProviderRepository.php line 208:
Class "Facade\Ignition\IgnitionServiceProvider" not found

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Thanks in advance!

Jeremy Davis's picture

I'm not sure where you are up to with this issue? Regardless I'll share some ideas.

I've done a quick bit of research and it appears that the error you're hitting may be related to composer. Unfortunately I haven't had a chance to test, but hopefully updating composer will solve the issue.

As per always, be sure to take a backup before doing anything like this. Ideally your backups should be tested too -- at least from time to time.

By default we install composer from the Debian repos, so you'll need to remove that first:

apt remove -y composer

Then until I write a helper script, just copy/paste the 4 lines near the top of the composer download instructions page. That should leave you with a 'composer.phar' file in the directory where you ran the commands. Rename and move the downloaded file to the "proper" location and make sure it's executable:

mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer

Regardless of the updated composer, the turnkey-composer command should still work as it did before. So try running through the commands again. Hopefully that gets you going.

If not, please post back again with updated info/error warning and I'll have a closer look.

MP's picture

Hi Jeremy, im still getting the same error. Maybe I will try a fresh install and just migrate my data.
root@snipeit .../www/snipe-it# turnkey-composer install --no-dev --prefer-source
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - Root composer.json requires php ^8.2 but your php version (8.1.32) does not satisfy that requirement.
  Problem 2
    - laravel/framework is locked to version v11.44.1 and an update of this package was not requested.
    - laravel/framework v11.44.1 requires php ^8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 3
    - lcobucci/jwt is locked to version 5.4.2 and an update of this package was not requested.
    - lcobucci/jwt 5.4.2 requires php ~8.2.0 || ~8.3.0 || ~8.4.0 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 4
    - nunomaduro/collision is locked to version v8.5.0 and an update of this package was not requested.
    - nunomaduro/collision v8.5.0 requires php ^8.2.0 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 5
    - nunomaduro/termwind is locked to version v2.3.0 and an update of this package was not requested.
    - nunomaduro/termwind v2.3.0 requires php ^8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 6
    - spatie/laravel-signal-aware-command is locked to version 2.0.0 and an update of this package was not requested.
    - spatie/laravel-signal-aware-command 2.0.0 requires php ^8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 7
    - symfony/clock is locked to version v7.2.0 and an update of this package was not requested.
    - symfony/clock v7.2.0 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 8
    - symfony/console is locked to version v7.2.1 and an update of this package was not requested.
    - symfony/console v7.2.1 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 9
    - symfony/error-handler is locked to version v7.2.1 and an update of this package was not requested.
    - symfony/error-handler v7.2.1 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 10
    - symfony/event-dispatcher is locked to version v7.2.0 and an update of this package was not requested.
    - symfony/event-dispatcher v7.2.0 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 11
    - symfony/finder is locked to version v7.2.2 and an update of this package was not requested.
    - symfony/finder v7.2.2 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 12
    - symfony/http-foundation is locked to version v7.2.2 and an update of this package was not requested.
    - symfony/http-foundation v7.2.2 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 13
    - symfony/http-kernel is locked to version v7.2.2 and an update of this package was not requested.
    - symfony/http-kernel v7.2.2 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 14
    - symfony/mailer is locked to version v7.2.0 and an update of this package was not requested.
    - symfony/mailer v7.2.0 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 15
    - symfony/mime is locked to version v7.2.1 and an update of this package was not requested.
    - symfony/mime v7.2.1 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 16
    - symfony/process is locked to version v7.2.0 and an update of this package was not requested.
    - symfony/process v7.2.0 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 17
    - symfony/psr-http-message-bridge is locked to version v7.2.0 and an update of this package was not requested.
    - symfony/psr-http-message-bridge v7.2.0 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 18
    - symfony/routing is locked to version v7.2.0 and an update of this package was not requested.
    - symfony/routing v7.2.0 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 19
    - symfony/string is locked to version v7.2.0 and an update of this package was not requested.
    - symfony/string v7.2.0 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 20
    - symfony/uid is locked to version v7.2.0 and an update of this package was not requested.
    - symfony/uid v7.2.0 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 21
    - symfony/var-dumper is locked to version v7.2.0 and an update of this package was not requested.
    - symfony/var-dumper v7.2.0 requires php >=8.2 -> your php version (8.1.32) does not satisfy that requirement.
  Problem 22
    - watson/validating is locked to version 8.2.0 and an update of this package was not requested.
    - laravel/framework v11.44.1 requires php ^8.2 -> your php version (8.1.32) does not satisfy that requirement.
    - watson/validating 8.2.0 requires illuminate/contracts ~9.0|~10.0|~11.0 -> satisfiable by laravel/framework[v11.44.1].

Jeremy Davis's picture

You said earlier that you had updated PHP but what you've posted there looks like a PHP version issue?!

How did you update PHP? And what did/does 'php -v' show?

FWIW the only reason our Snipe-IT appliance includes PHP 8.1 is because it wasn't compatible with PHP 8.2 at the time of release. FWIW PHP 8.2 is the default in the TKL v18.x appliance library - installed from Debian apr repos.

I'll try to get an updated Snipe-IT appliance released soon; with both a newer version of Snipe-IT and PHP - although that isn't much help to you ATM.

FWIW we have a TurnKey "helper script" to updated PHP versions. I don't think that it was included in the original TurnKey v18.0 Snipe-IT release you have, but it's easy to download. I'd recommend updating PHP first and double check that it's what your system is using before going any further with the Snipe-IT upgrade.

MP's picture

Hi Jeremy, thank you for your support! I had some time today and solve the Problem.
apt install install php8.2 php8.2-cli php8.2-{bz2,curl,mbstring,intl}
apt remove -y composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'.PHP_EOL; } else { echo 'Installer corrupt'.PHP_EOL; unlink('composer-setup.php'); exit(1); }"

php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer
cd /var/www/snipe-it
git pull
git config --global --add safe.directory /var/www/snipe-it
git pull
chown -R www-data:www-data ./
turnkey-composer install --no-dev --prefer-source
# Command Fails- I solve the Problems listed
apt install php8.2-fpm
a2enconf php8.2-fpm
a2disconf php8.1-fpm
apt purge php8.1*
apt-get install -y  php8.2-xml
apt-get install php8.2-zip
apt-get install php8.2-bcmath
apt-get install php8.2-gd
apt-get install php8.2-intl
apt-get install php8.2-xsl
turnkey-composer install --no-dev --prefer-source
turnkey-composer dump-autoload
turnkey-artisan migrate
# MySQL Error
apt-get install php8.2-mysql
service apache2 restart
turnkey-artisan migrate
turnkey-artisan config:clear
turnkey-artisan route:clear
turnkey-artisan cache:clear
turnkey-artisan view:clear
# Error in Browser: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.2.0".
a2dismod php8.1
a2enmod php8.2
systemctl restart apache2
# working :-)
Jeremy Davis's picture

I'm so glad to hear that you got it going. Although it looks like it was a bit of a PITA. Regardless, thanks very much for posting back.

Add new comment