-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 fails in Step 4 "Backing up database" #15636
Comments
👋 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. |
Have made some progress, but still not all the way there. Following the steps given here: https://snipe-it.readme.io/docs/upgrading This was the latest process:
This is the errors thrown when attempting to run php artisan migrate: Illuminate\Database\QueryException could not find driver (Connection: mysql, SQL: select table_name as at vendor\laravel\framework\src\Illuminate\Database\Connection.php:829 1 vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:65 2 vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:65 I ran php upgrade.php just to see what would happen, and I am presented with the pre-flight page. Pre-flight page states: D'oh! Looks like we can't connect to your database. Please update your database settings in your .env file. Your database says: could not find driver (Connection: mysql, SQL: select 2 + 2) Gonna poke around to see if I can figure out what that means.
|
I got it. The very last step appears to be uncommenting this line in the php.ini file: extension=pdo_mysql After uncommenting that line and performing a server restart, php artisan migrate succeeded. Followed that with php upgrade.php and the upgrade fully ran. Site came back up on v7.0.13. Hopefully this can help anyone else who runs into the same thing. |
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
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!
√ tokenizer is installed!
√ xml is installed!
√ zip 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$branch = "'".trim(shell_exec("cd $ {directory}; git branch | grep \* | cut -d ' ' -f2"))."'";
48▕ }
49▕
50▕ protected function getCurrentBranch(string $directory): string
51▕ {
➜ 52▕
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$branch = "'".trim(shell_exec("cd $ {directory}; git branch | grep \* | cut -d ' ' -f2"))."'";
48▕ }
49▕
50▕ protected function getCurrentBranch(string $directory): string
51▕ {
➜ 52▕
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$branch = "'".trim(shell_exec("cd $ {directory}; git branch | grep \* | cut -d ' ' -f2"))."'";
48▕ }
49▕
50▕ protected function getCurrentBranch(string $directory): string
51▕ {
➜ 52▕
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
The text was updated successfully, but these errors were encountered: