snipe / snipe-it

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

Upgrading to RC error #10839

Closed Mikmokster closed 2 years ago

Mikmokster commented 2 years ago

Debug mode

Describe the bug

I get this error after upgrading from master to develop (RC)

In Request.php line 334:

Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() mus t be of the type string, null given, called in C:\xampp\htdocs\AMS\vendor\l aravel\framework\src\Illuminate\Foundation\Bootstrap\SetRequestForConsole.p hp on line 32

Reproduction steps

1. 2. 3. ...

Expected behavior

Upgrade

Screenshots

No response

Snipe-IT Version

v6.0.0-RC-5

Operating System

Windows

Web Server

XAMPP

PHP Version

7.4

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

In Request.php line 334:

  Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() mus
  t be of the type string, null given, called in C:\xampp\htdocs\AMS\vendor\l
  aravel\framework\src\Illuminate\Foundation\Bootstrap\SetRequestForConsole.p
  hp on line 32

Additional context

Upgrade

welcome[bot] commented 2 years 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.

snipe commented 2 years ago

I haven't been able to reproduce this anywhere :( Is there any other info you can provide? Where exactly are you seeing this? Command line or in the browser? Is it possible your cli and your web server are running different versions of PHP? (It does happen sometimes, tho less common in XAMPP I think)

hphit commented 2 years ago

In Request.php line 334:

Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() must be of the type string, null given, called in /var/www/snipe-it/vendor/laravel/framework/src/Illu minate/Foundation/Bootstrap/SetRequestForConsole.php on line 32

snipe commented 2 years ago

Are you able to upgrade to the latest release?

uberbrady commented 2 years ago

Hrm, are you 100% sure you're using PHP 7.4 ? I don't remember when exactly errors about null instead of string came around, but I think that's in much later versions of PHP, like 8.2 or 8.1 or so?

Can you run composer install and do you get anything better when you do that?

hphit commented 2 years ago

Are you able to upgrade to the latest release?

not yet, i'm having this issues:

WELCOME TO THE SNIPE-IT UPGRADER!

This script will attempt to:


STEP 1: Checking PHP requirements:

Current PHP version: (7.4.29) is at least 7.4.0 - continuing... FYI: The php.ini used by this PHP is: /etc/php/7.4/cli/php.ini

Checking Required PHP extensions...

√ bcmath is installed! √ curl 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 2: Backing up database:

-- In Request.php line 334:

Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() must be of the type string, null given, called in /var/www/snipe-it/vendor/laravel/framework/src/Il luminate/Foundation/Bootstrap/SetRequestForConsole.php on line 32


STEP 3: Putting application into maintenance mode:

-- In Request.php line 334:

Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() must be of the type string, null given, called in /var/www/snipe-it/vendor/laravel/framework/src/Il luminate/Foundation/Bootstrap/SetRequestForConsole.php on line 32


STEP 4: Pulling latest from Git (master branch):

Git is installed. remote: Enumerating objects: 17, done. remote: Counting objects: 100% (17/17), done. remote: Compressing objects: 100% (13/13), done. remote: Total 17 (delta 5), reused 13 (delta 4), pack-reused 0 Unpacking objects: 100% (17/17), done. From https://github.com/snipe/snipe-it a050be873..1c32dcae9 master -> origin/master a050be873..1c32dcae9 develop -> origin/develop


Step 5: Cleaning up old cached files:

√ No bootstrap/cache/compiled.php, so nothing to delete. √ No bootstrap/cache/services.php, so nothing to delete. √ No bootstrap/cache/config.php, so nothing to delete.

-- In Request.php line 334:

Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() must be of the type string, null given, called in /var/www/snipe-it/vendor/laravel/framework/src/Il luminate/Foundation/Bootstrap/SetRequestForConsole.php on line 32

-- In Request.php line 334:

Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() must be of the type string, null given, called in /var/www/snipe-it/vendor/laravel/framework/src/Il luminate/Foundation/Bootstrap/SetRequestForConsole.php on line 32

-- In Request.php line 334:

Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() must be of the type string, null given, called in /var/www/snipe-it/vendor/laravel/framework/src/Il luminate/Foundation/Bootstrap/SetRequestForConsole.php on line 32

-- In Request.php line 334:

Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() must be of the type string, null given, called in /var/www/snipe-it/vendor/laravel/framework/src/Il luminate/Foundation/Bootstrap/SetRequestForConsole.php on line 32


Step 6: Updating composer dependencies: (This may take a moment.)

-- We couldn't find a local composer.phar. No worries, trying globally.

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 Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1 Installing dependencies from lock file Verifying lock file contents can be installed on current platform. Nothing to install, update or remove Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead. Package patchwork/utf8 is abandoned, you should avoid using it. Use symfony/polyfill-mbstring or symfony/string instead. Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead. Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested. 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 Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1 Generating optimized autoload files

In Request.php line 334:

Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() mus t be of the type string, null given, called in /var/www/snipe-it/vendor/lar avel/framework/src/Illuminate/Foundation/Bootstrap/SetRequestForConsole.php on line 32

In Request.php line 334:

Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() mus t be of the type string, null given, called in /var/www/snipe-it/vendor/lar avel/framework/src/Illuminate/Foundation/Bootstrap/SetRequestForConsole.php on line 32


Step 7: Migrating database:

In Request.php line 334:

Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() must be of the type string, null given, called in /var/www/snipe-it/vendor/laravel/framework/src/Il luminate/Foundation/Bootstrap/SetRequestForConsole.php on line 32


Step 8: Checking for OAuth keys:

√ OAuth keys detected. Skipping passport install.


Step 9: Taking application out of maintenance mode:

-- In Request.php line 334:

Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() must be of the type string, null given, called in /var/www/snipe-it/vendor/laravel/framework/src/Il luminate/Foundation/Bootstrap/SetRequestForConsole.php on line 32

---------------------- FINISHED! ----------------------- All done! Clear your browser cookies and re-login to use your upgraded Snipe-IT!

GitHub
GitHub - snipe/snipe-it: A free open source IT asset/license management system
A free open source IT asset/license management system - GitHub - snipe/snipe-it: A free open source IT asset/license management system
hphit commented 2 years ago

when i do it, i have this: composer install Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Package operations: 32 installs, 0 updates, 0 removals As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension. This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost. Installing 'unzip' or '7z' (21.01+) may remediate them.

In Request.php line 334:

Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() must be of the type string, null given, called in /var/www/snipe-it/vendor/laravel/framework/src/Il luminate/Foundation/Bootstrap/SetRequestForConsole.php on line 32

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

snipe commented 2 years ago

What do you have in your .env for APP_URL?

hphit commented 2 years ago

What do you have in your .env for APP_URL?

if you mean from the file app.php is from config 'url' => env('APP_URL', 'http://localhost'),

snipe commented 2 years ago

No, in your .env file

hphit commented 2 years ago

No, in your .env file

where is it?

snipe commented 2 years ago

In your snipe-it directory.

snipe commented 2 years ago

/var/www/snipe-it/.env

hphit commented 2 years ago

APP_URL=null

hphit commented 2 years ago

/var/www/snipe-it/.env

i put APP_URL=localhost and no more issues, thanks a lot. image

snipe commented 2 years ago

Per the docs, you want to use the domain and protocol, so http://localhost or https://localhost if you are running over SSL

AiFxApp commented 2 years ago

APP_URL=http://localhost:8000 Solved the issue

jcnengel commented 1 year ago

Then it might make sense to adjust the .env.example accordingly as it currently specifies APP_URL=null by default.

snipe commented 1 year ago

@jcnengal - it’s set to null on purpose, so that you know to update it. local host will not work for every setup, and there’s no way for us to know what your URL is. The upgrade.php script tries to check your URL for you to make sure that it’s not null, but at the end of the day it’s your job to read the config docs. APP_URL has always been required.