Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade from 6.4.2 to 7.0.3 #14907

Closed
2 tasks done
aj-bi opened this issue Jun 19, 2024 · 6 comments
Closed
2 tasks done

Upgrade from 6.4.2 to 7.0.3 #14907

aj-bi opened this issue Jun 19, 2024 · 6 comments

Comments

@aj-bi
Copy link

aj-bi commented Jun 19, 2024

Debug mode

Describe the bug

Update from 6.4.2 to 7.0.3 with upgrade.php will fail

PHP-Version (CLI) is on 8.3.8
PHP in Apache is still on 7.4.33 (because SnipeIT 6.4.2 will not work with 8.3.8)

I ran the update with (output below):
sudo -u www-data php upgrade.php

Any Idea what to do/check?

Reproduction steps

--------------------------------------------------------
WELCOME TO THE SNIPE-IT UPGRADER!
--------------------------------------------------------

This script will attempt to:

- validate some very basic .env file settings
- check your PHP version and extension requirements
- check directory permissions
- do a git pull to bring you to the latest version
- run composer install to get your vendors up to date
- run migrations to get your schema up to date
- clear out old cache settings

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 .env is located at /var/www/snipeit/.env
--------------------------------------------------------

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

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

√ Current PHP version: (8.3.8) is at least 8.1.0 and less than 8.4.0! Continuing...
FYI: The php.ini used by this PHP is: /etc/php/8.3/cli/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/snipeit/bootstrap/cache is writable
√ /var/www/snipeit/storage is writable
√ /var/www/snipeit/storage/logs is writable
√ /var/www/snipeit/storage/logs/laravel.log is writable
√ /var/www/snipeit/storage/framework is writable
√ /var/www/snipeit/storage/framework/cache is writable
√ /var/www/snipeit/storage/framework/sessions is writable
√ /var/www/snipeit/storage/framework/views is writable
√ /var/www/snipeit/storage/app is writable
√ /var/www/snipeit/storage/app/backups is writable
√ /var/www/snipeit/storage/app/backup-temp is writable
√ /var/www/snipeit/storage/private_uploads is writable
√ /var/www/snipeit/public/uploads is writable

--------------------------------------------------------
STEP 4: Backing up database:
--------------------------------------------------------

PHP Fatal error:  Uncaught Whoops\Exception\ErrorException: Using ${var} in strings is deprecated, use {$var} instead in /var/www/snipeit/vendor/facade/ignition/src/SolutionProviders/MergeConflictSolutionProvider.php:52
Stack trace:
#0 /var/www/snipeit/vendor/composer/ClassLoader.php(576): Whoops\Run->handleError()
#1 /var/www/snipeit/vendor/composer/ClassLoader.php(576): include()
#2 /var/www/snipeit/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}()
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/snipeit/vendor/facade/ignition/src/SolutionProviders/SolutionProviderRepository.php(50): class_implements()
#5 [internal function]: Facade\Ignition\SolutionProviders\SolutionProviderRepository->Facade\Ignition\SolutionProviders\{closure}()
#6 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(717): array_filter()
#7 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(358): Illuminate\Support\Arr::where()
#8 /var/www/snipeit/vendor/facade/ignition/src/SolutionProviders/SolutionProviderRepository.php(49): Illuminate\Support\Collection->filter()
#9 /var/www/snipeit/vendor/nunomaduro/collision/src/Adapters/Laravel/IgnitionSolutionsRepository.php(36): Facade\Ignition\SolutionProviders\SolutionProviderRepository->getSolutionsForThrowable()
#10 /var/www/snipeit/vendor/nunomaduro/collision/src/Writer.php(244): NunoMaduro\Collision\Adapters\Laravel\IgnitionSolutionsRepository->getFromThrowable()
#11 /var/www/snipeit/vendor/nunomaduro/collision/src/Writer.php(123): NunoMaduro\Collision\Writer->renderSolution()
#12 /var/www/snipeit/vendor/nunomaduro/collision/src/Handler.php(39): NunoMaduro\Collision\Writer->write()
#13 /var/www/snipeit/vendor/filp/whoops/src/Whoops/Run.php(370): NunoMaduro\Collision\Handler->handle()
#14 [internal function]: Whoops\Run->handleException()
#15 {main}
  thrown in /var/www/snipeit/vendor/facade/ignition/src/SolutionProviders/MergeConflictSolutionProvider.php on line 52
PHP Fatal error:  Uncaught Whoops\Exception\ErrorException: Using ${var} in strings is deprecated, use {$var} instead in /var/www/snipeit/vendor/facade/ignition/src/SolutionProviders/MergeConflictSolutionProvider.php:52
Stack trace:
#0 /var/www/snipeit/vendor/composer/ClassLoader.php(576): Whoops\Run->handleError()
#1 /var/www/snipeit/vendor/composer/ClassLoader.php(576): include()
#2 /var/www/snipeit/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}()
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/snipeit/vendor/facade/ignition/src/SolutionProviders/SolutionProviderRepository.php(50): class_implements()
#5 [internal function]: Facade\Ignition\SolutionProviders\SolutionProviderRepository->Facade\Ignition\SolutionProviders\{closure}()
#6 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(717): array_filter()
#7 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(358): Illuminate\Support\Arr::where()
#8 /var/www/snipeit/vendor/facade/ignition/src/SolutionProviders/SolutionProviderRepository.php(49): Illuminate\Support\Collection->filter()
#9 /var/www/snipeit/vendor/nunomaduro/collision/src/Adapters/Laravel/IgnitionSolutionsRepository.php(36): Facade\Ignition\SolutionProviders\SolutionProviderRepository->getSolutionsForThrowable()
#10 /var/www/snipeit/vendor/nunomaduro/collision/src/Writer.php(244): NunoMaduro\Collision\Adapters\Laravel\IgnitionSolutionsRepository->getFromThrowable()
#11 /var/www/snipeit/vendor/nunomaduro/collision/src/Writer.php(123): NunoMaduro\Collision\Writer->renderSolution()
#12 /var/www/snipeit/vendor/nunomaduro/collision/src/Handler.php(39): NunoMaduro\Collision\Writer->write()
#13 /var/www/snipeit/vendor/filp/whoops/src/Whoops/Run.php(370): NunoMaduro\Collision\Handler->handle()
#14 [internal function]: Whoops\Run->handleException()
#15 {main}
  thrown in /var/www/snipeit/vendor/facade/ignition/src/SolutionProviders/MergeConflictSolutionProvider.php on line 52
--
   TypeError

  Carbon\Carbon::setLastErrors(): Argument #1 ($lastErrors) must be of type array, false given, called in /var/www/snipeit/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php on line 98

  at vendor/nesbot/carbon/src/Carbon/Traits/Creator.php:928
    924▕      * @param array $lastErrors
    925▕      *
    926▕      * @return void
    927▕      */
  ➜ 928▕     private static function setLastErrors(array $lastErrors)
    929▕     {
    930▕         static::$lastErrors = $lastErrors;
    931▕     }
    932▕

   Whoops\Exception\ErrorException

  Using ${var} in strings is deprecated, use {$var} instead

  at vendor/facade/ignition/src/SolutionProviders/MergeConflictSolutionProvider.php:52
     48▕     }
     49▕
     50▕     protected function getCurrentBranch(string $directory): string
     51▕     {
  ➜  52▕         $branch = "'".trim(shell_exec("cd ${directory}; git branch | grep \\* | cut -d ' ' -f2"))."'";
     53▕
     54▕         if ($branch === "''") {
     55▕             $branch = 'current branch';
     56▕         }

   Symfony\Component\ErrorHandler\Error\FatalError

  Uncaught Whoops\Exception\ErrorException: Using ${var} in strings is deprecated, use {$var} instead in /var/www/snipeit/vendor/facade/ignition/src/SolutionProviders/MergeConflictSolutionProvider.php:52
Stack trace:
#0 /var/www/snipeit/vendor/composer/ClassLoader.php(576): Whoops\Run->handleError()
#1 /var/www/snipeit/vendor/composer/ClassLoader.php(576): include()
#2 /var/www/snipeit/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}()
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/snipeit/vendor/facade/ignition/src/SolutionProviders/SolutionProviderRepository.php(50): class_implements()
#5 [internal function]: Facade\Ignition\SolutionProviders\SolutionProviderRepository->Facade\Ignition\SolutionProviders\{closure}()
#6 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(717): array_filter()
#7 /var/www/snipeit/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(358): Illuminate\Support\Arr::where()
#8 /var/www/snipeit/vendor/facade/ignition/src/SolutionProviders/SolutionProviderRepository.php(49): Illuminate\Support\Collection->filter()
#9 /var/www/snipeit/vendor/nunomaduro/collision/src/Adapters/Laravel/IgnitionSolutionsRepository.php(36): Facade\Ignition\SolutionProviders\SolutionProviderRepository->getSolutionsForThrowable()
#10 /var/www/snipeit/vendor/nunomaduro/collision/src/Writer.php(244): NunoMaduro\Collision\Adapters\Laravel\IgnitionSolutionsRepository->getFromThrowable()
#11 /var/www/snipeit/vendor/nunomaduro/collision/src/Writer.php(123): NunoMaduro\Collision\Writer->renderSolution()
#12 /var/www/snipeit/vendor/nunomaduro/collision/src/Handler.php(39): NunoMaduro\Collision\Writer->write()
#13 /var/www/snipeit/vendor/filp/whoops/src/Whoops/Run.php(370): NunoMaduro\Collision\Handler->handle()
#14 [internal function]: Whoops\Run->handleException()
#15 {main}
  thrown

  at vendor/facade/ignition/src/SolutionProviders/MergeConflictSolutionProvider.php:52
     48▕     }
     49▕
     50▕     protected function getCurrentBranch(string $directory): string
     51▕     {
  ➜  52▕         $branch = "'".trim(shell_exec("cd ${directory}; git branch | grep \\* | cut -d ' ' -f2"))."'";
     53▕
     54▕         if ($branch === "''") {
     55▕             $branch = 'current branch';
     56▕         }

   Whoops\Exception\ErrorException

  Using ${var} in strings is deprecated, use {$var} instead

  at vendor/facade/ignition/src/SolutionProviders/MergeConflictSolutionProvider.php:52
     48▕     }
     49▕
     50▕     protected function getCurrentBranch(string $directory): string
     51▕     {
  ➜  52▕         $branch = "'".trim(shell_exec("cd ${directory}; git branch | grep \\* | cut -d ' ' -f2"))."'";
     53▕
     54▕         if ($branch === "''") {
     55▕             $branch = 'current branch';
     56▕         }

Something went wrong with your backup. Aborting!

Expected behavior

Upgrade will work as usual.. :)

Screenshots

No response

Snipe-IT Version

6.4.2

Operating System

Debian

Web Server

Apache

PHP Version

8.3.8 and 7.4.x

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

Copy link

welcome bot commented Jun 19, 2024

👋 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
Copy link
Owner

snipe commented Jun 19, 2024

What version of composer are you running? Can you possibly update it?

@aj-bi
Copy link
Author

aj-bi commented Jun 19, 2024

Update from 2.7.6 to 2.7.7

root@hostname:/var/www/snipeit# sudo -u www-data php composer.phar about
Composer - Dependency Manager for PHP - version 2.7.6
Composer is a dependency manager tracking local dependencies of your projects and libraries.
See https://getcomposer.org/ for more information.
root@hostname:/var/www/snipeit# sudo -u www-data php composer.phar self-update
Upgrading to version 2.7.7 (stable channel).

Use composer self-update --rollback to return to version 2.7.6

But same issue.. if I try to update with

sudo -u www-data php upgrade.php

@snipe
Copy link
Owner

snipe commented Jun 19, 2024

If you try the upgrade manually, what do you see?

git pull
php composer.phar install --no-dev --prefer-source
php composer.phar dump-autoload
php artisan migrate
php artisan config:clear
php artisan config:cache

@aj-bi
Copy link
Author

aj-bi commented Jun 19, 2024

@snipe The manual update worked without any problems. thank you very much

do you still need an output? i haven't seen anything special.

@snipe
Copy link
Owner

snipe commented Jun 20, 2024

@aj-bi if you didn't see anything special, I don't need output, as it won't really help us much.

Thanks for the update, glad you're sorted!

@snipe snipe closed this as completed Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants