snipe / snipe-it

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

Upgrade fails in Step 4 "Backing up database" #15636

Open DomingoSneed opened 21 hours ago

DomingoSneed commented 21 hours ago

Debug mode

Describe the bug

Attempting to upgrade to current version of SnipeIT. Running update script crashes partway through and aborts the upgrade.

Issue occurs in Step 4, that backup of the database fails with a lengthy string of error messages.

Full print out of upgrade process is in screenshots section.

Reproduction steps

  1. Update PHP on IIS to v8.31.12
  2. Run git fetch -a on web server
  3. Run git pull on same server
  4. Run php upgrade.php
  5. Upgrade crashes in Step 4

Expected behavior

Upgrade to complete was expected result.

Screenshots

PS C:\inetpub\wwwroot\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

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

STEP 1: Checking .env file:

√ Your APP_KEY is not blank. √ Your APP_URL is not null or blank. It is set to http://snipeit.granite.com √ Your APP_URL is set to http://snipeit.granite.com and starts with the protocol (https:// or http://) √ Your APP_URL (http://snipeit.granite.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.12) is at least 8.1.0 and less than 8.4.0! Continuing... FYI: The php.ini used by this PHP is: C:\Program Files\PHP\v8.3.12\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!


STEP 3: Checking directory permissions:

√ C:\inetpub\wwwroot\snipeit/bootstrap/cache is writable √ C:\inetpub\wwwroot\snipeit/storage is writable √ C:\inetpub\wwwroot\snipeit/storage/logs is writable √ C:\inetpub\wwwroot\snipeit/storage/logs/laravel.log is writable √ C:\inetpub\wwwroot\snipeit/storage/framework is writable √ C:\inetpub\wwwroot\snipeit/storage/framework/cache is writable √ C:\inetpub\wwwroot\snipeit/storage/framework/sessions is writable √ C:\inetpub\wwwroot\snipeit/storage/framework/views is writable √ C:\inetpub\wwwroot\snipeit/storage/app is writable √ C:\inetpub\wwwroot\snipeit/storage/app/backups is writable √ C:\inetpub\wwwroot\snipeit/storage/app/backup-temp is writable √ C:\inetpub\wwwroot\snipeit/storage/private_uploads is writable √ C:\inetpub\wwwroot\snipeit/public/uploads is writable


STEP 4: Backing up database:

-- TypeError

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

at C:\inetpub\wwwroot\snipeit\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 C:\inetpub\wwwroot\snipeit\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 C:\inetpub\wwwroot\snipeit\vendor\facade\ignition\src\SolutionProviders\MergeConflictSolutionProvider.php:52 Stack trace:

0 C:\inetpub\wwwroot\snipeit\vendor\composer\ClassLoader.php(576): Whoops\Run->handleError()

1 C:\inetpub\wwwroot\snipeit\vendor\composer\ClassLoader.php(576): include()

2 C:\inetpub\wwwroot\snipeit\vendor\composer\ClassLoader.php(427): Composer\Autoload{closure}()

3 [internal function]: Composer\Autoload\ClassLoader->loadClass()

4 C:\inetpub\wwwroot\snipeit\vendor\facade\ignition\src\SolutionProviders\SolutionProviderRepository.php(50): class_implements()

5 [internal function]: Facade\Ignition\SolutionProviders\SolutionProviderRepository->Facade\Ignition\SolutionProviders{closure}()

6 C:\inetpub\wwwroot\snipeit\vendor\laravel\framework\src\Illuminate\Collections\Arr.php(717): array_filter()

7 C:\inetpub\wwwroot\snipeit\vendor\laravel\framework\src\Illuminate\Collections\Collection.php(358): Illuminate\Support\Arr::where()

8 C:\inetpub\wwwroot\snipeit\vendor\facade\ignition\src\SolutionProviders\SolutionProviderRepository.php(49): Illuminate\Support\Collection->filter()

9 C:\inetpub\wwwroot\snipeit\vendor\nunomaduro\collision\src\Adapters\Laravel\IgnitionSolutionsRepository.php(36): Facade\Ignition\SolutionProviders\SolutionProviderRepository->getSolutionsForThrowable()

10 C:\inetpub\wwwroot\snipeit\vendor\nunomaduro\collision\src\Writer.php(244): NunoMaduro\Collision\Adapters\Laravel\IgnitionSolutionsRepository->getFromThrowable()

11 C:\inetpub\wwwroot\snipeit\vendor\nunomaduro\collision\src\Writer.php(123): NunoMaduro\Collision\Writer->renderSolution()

12 C:\inetpub\wwwroot\snipeit\vendor\nunomaduro\collision\src\Handler.php(39): NunoMaduro\Collision\Writer->write()

13 C:\inetpub\wwwroot\snipeit\vendor\filp\whoops\src\Whoops\Run.php(370): NunoMaduro\Collision\Handler->handle()

14 [internal function]: Whoops\Run->handleException()

15 {main}

thrown

at C:\inetpub\wwwroot\snipeit\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 C:\inetpub\wwwroot\snipeit\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!

Snipe-IT Version

Version v6.3.3 - build 12903 (master)

Operating System

Windows Server 2019

Web Server

IIS

PHP Version

Upgrading from 7.4 to 8.3.12

Operating System

Windows

Browser

Edge

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

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