I was updating the system from Laravel 6 to Laravel 9. When transferring everything to the test server, the server builds the application in Docker, but the deployment process in GitLab does not happen due to an error caused in the “gitlab-ci” file, where the command php artisan passport:install is called in the script for installation. Eventually, I found it in the GitLab file and commented it out. Like, if you comment it out, everything runs and deployment is successful, but the server naturally cannot process requests because an error occurs: “error”: “Invalid key supplied”, “trace”: “#0 /var/www/vendor/laravel/passport/src/PassportServiceProvider.php(325): LeagueOAuth2ServerCryptKey->__construct(‘file:///var/www…’, NULL, false)n#1 /var/www/vendor/laravel/passport/src/PassportServiceProvider.php(306): LaravelPassport If you try to run php artisan passport:install directly on the server, an error occurs: Undefined property: LaravelPassportConsoleKeysCommand::$components at vendor/laravel/passport/src/Console/KeysCommand.php:42. If you do not comment out the command, the server will respond and process requests, but the deployment will fail. Can someone please help?
Erors:
php artisan passport:install
ErrorException
Undefined property: LaravelPassportConsoleKeysCommand::$components
at vendor/laravel/passport/src/Console/KeysCommand.php:42
38▕ Passport::keyPath('oauth-private.key'),
39▕ ];
40▕
41▕ if ((file_exists($publicKey) || file_exists($privateKey)) && ! $this->option('force')) {
➜ 42▕ $this->components->error('Encryption keys already exist. Use the --force option to overwrite them.');
43▕
composer require laravel/passport
composer update
Ahuet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.