snipe / snipe-it

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

Multiples Errors during upgrade.php #12945

Open 2crak opened 1 year ago

2crak commented 1 year ago

Debug mode

Describe the bug

During upgrade.php

error log

STEP 1: Checking .env file:

PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 √ Your APP_KEY is not blank. √ Your APP_URL is not null or blank. It is set to http://snipeit √ Your APP_URL is set to http://snipeit and starts with the protocol (https:// or http://) √ Your APP_URL (http://snipeit) does not have a trailing slash.

don't know why this appear, since the .env file last modified timestamp is 17/11/2020 2023-04-28_12h55_15

Other issue

STEP 4: Backing up database:

-- Starting backup... Dumping database snipeit... Backup failed because The dump process failed with exitcode 1 : General error : The system cannot find the path specified. .

0 E:\wwwroot\snipe-IT\vendor\spatie\db-dumper\src\DbDumper.php(263): Spatie\DbDumper\Exceptions\DumpFailed::processDidNotEndSuccessfully()

1 E:\wwwroot\snipe-IT\vendor\spatie\db-dumper\src\Databases\MySql.php(203): Spatie\DbDumper\DbDumper->checkIfDumpWasSuccessFul()

2 E:\wwwroot\snipe-IT\vendor\spatie\laravel-backup\src\Tasks\Backup\BackupJob.php(260): Spatie\DbDumper\Databases\MySql->dumpToFile()

3 [internal function]: Spatie\Backup\Tasks\Backup\BackupJob->Spatie\Backup\Tasks\Backup{closure}()

4 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Collections\Collection.php(695): array_map()

5 E:\wwwroot\snipe-IT\vendor\spatie\laravel-backup\src\Tasks\Backup\BackupJob.php(263): Illuminate\Support\Collection->map()

6 E:\wwwroot\snipe-IT\vendor\spatie\laravel-backup\src\Tasks\Backup\BackupJob.php(171): Spatie\Backup\Tasks\Backup\BackupJob->dumpDatabases()

7 E:\wwwroot\snipe-IT\vendor\spatie\laravel-backup\src\Tasks\Backup\BackupJob.php(147): Spatie\Backup\Tasks\Backup\BackupJob->createBackupManifest()

8 E:\wwwroot\snipe-IT\vendor\spatie\laravel-backup\src\Commands\BackupCommand.php(56): Spatie\Backup\Tasks\Backup\BackupJob->run()

9 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(36): Spatie\Backup\Commands\BackupCommand->handle()

10 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Container\Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()

11 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()

12 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()

13 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Container\Container.php(653): Illuminate\Container\BoundMethod::call()

14 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Console\Command.php(136): Illuminate\Container\Container->call()

15 E:\wwwroot\snipe-IT\vendor\symfony\console\Command\Command.php(298): Illuminate\Console\Command->execute()

16 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Console\Command.php(121): Symfony\Component\Console\Command\Command->run()

17 E:\wwwroot\snipe-IT\vendor\spatie\laravel-backup\src\Commands\BaseCommand.php(16): Illuminate\Console\Command->run()

18 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Console\Concerns\CallsCommands.php(68): Spatie\Backup\Commands\BaseCommand->run()

19 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Console\Concerns\CallsCommands.php(28): Illuminate\Console\Command->runCommand()

20 E:\wwwroot\snipe-IT\app\Console\Commands\SystemBackup.php(41): Illuminate\Console\Command->call()

21 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(36): App\Console\Commands\SystemBackup->handle()

22 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Container\Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()

23 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()

24 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()

25 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Container\Container.php(653): Illuminate\Container\BoundMethod::call()

26 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Console\Command.php(136): Illuminate\Container\Container->call()

27 E:\wwwroot\snipe-IT\vendor\symfony\console\Command\Command.php(298): Illuminate\Console\Command->execute()

28 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Console\Command.php(121): Symfony\Component\Console\Command\Command->run()

29 E:\wwwroot\snipe-IT\vendor\symfony\console\Application.php(1024): Illuminate\Console\Command->run()

30 E:\wwwroot\snipe-IT\vendor\symfony\console\Application.php(299): Symfony\Component\Console\Application->doRunCommand()

31 E:\wwwroot\snipe-IT\vendor\symfony\console\Application.php(171): Symfony\Component\Console\Application->doRun()

32 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Console\Application.php(94): Symfony\Component\Console\Application->run()

33 E:\wwwroot\snipe-IT\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(129): Illuminate\Console\Application->run()

34 E:\wwwroot\snipe-IT\artisan(35): Illuminate\Foundation\Console\Kernel->handle()

35 {main}

Backup failed because: The dump process failed with exitcode 1 : General error : The system cannot find the path specified. .

running php artisan snipeit:backup give the same output

same issue after upgrading to 6.1.0

Reproduction steps

  1. run php upgrade.php

  2. run php artisan snipeit:backup

Expected behavior

No error in the log for upgrade.php

Screenshots

No response

Snipe-IT Version

6.0.14

Operating System

windows

Web Server

IIS

PHP Version

8.1.14

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

2crak commented 1 year ago

Answer to myself, for the DB path failure it is fixed. MariaDB upgrade (10.5 to 10.6) change the path from "C:\Program Files\MariaDB 10.5" to "C:\Program Files\MariaDB 10.6" i had to run the command mentionned here https://snipe-it.readme.io/docs/windowsiis#backup--windows-environments to get the right path for the env cmd /c for %A in ("C:\Program Files\MariaDB 10.6\bin") do @echo %~sA

after changing in the .env, backup works again.

Still can't find any clue for the issue at STEP 1

Snipe-IT Documentation
Windows/IIS
Setting Up an IIS Website📘NOTE:For the purposes of this walkthrough, we are assuming you're using assets.portal.local as your Snipe-IT local domain name. This should be changed for your own installation. Extract Snipe-IT to C:\inetpub\wwwroot\snipe-it (folder name can be changed but we will referen...
snipe commented 1 year ago

If I had to hazard a guess, there's something funny in your .env - maybe some stray spaces on a blank line. Before trying to check for a key, it checks that the .env line contents is greater than 1 (meaning there's something on that line, it's not completely blank) and also that it doesn't start with # (meaning it's a comment.)

2crak commented 1 year ago

Hi Snipe,

thanks for the input, but i have the same issue using the .env.example file

`PS E:\wwwroot\snipe-IT> ren ..env.example .env PS E:\wwwroot\snipe-IT> php .\upgrade.php 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:

PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54 PHP Warning: Undefined array key 1 in E:\wwwroot\snipe-IT\upgrade.php on line 54`