[Bug] `backpack:install` command hangs in production
See original GitHub issueBug report
What I did
When Laravel is in production and I run the command php artisan backpack:install
“hangs” at the stage: 40% Creating users table (using Laravel's default migration)
.
What I expected to happen
I would expect one of the following:
- The command fails instead of “hang” with a senseable error message
- The command exits after the default timeout
What happened
In the install command I see that no arguments are passed to the migrate command. When Laravel is in production and I run the migrate command it prompts the following:
$ php artisan migrate
**************************************
* Application In Production! *
**************************************
Do you really wish to run this command? (yes/no) [no]:
>
My assumption is that the backpack:install
waits here. Since no arguments are passed to the migrate command, the command doesn’t fail due to adding the --no-interaction
flag and I can’t force the migrations with --force
.
What I’ve already tried to fix it
$ yes | php artisan backpack:install
seems to work.
Is it a bug in the latest version of Backpack?
Seems like it: https://github.com/Laravel-Backpack/CRUD/blob/master/src/app/Console/Commands/Install.php#L53
Backpack, Laravel, PHP, DB version
When I run php artisan backpack:version
the output is:
php artisan backpack:version
### PHP VERSION:
PHP 7.4.3 (cli) (built: Jul 5 2021 15:13:35) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
### LARAVEL VERSION:
v7.30.4@9dd38140dc2924daa1a020a3d7a45f9ceff03df3
### BACKPACK VERSION:
4.1.27@bd1bab5dde08df20eebd730ca3a2992e1bf334f7
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top GitHub Comments
Oh I get it now. Thanks for the PR, let’s move the conversation to the PR then, it looks good to me as-is.
Thank you 🙏
Looking at your screenshot I think we mean different things, this is where the command hangs for me:
I don’t see an option to pass the
--no-interaction
flag to themigrate
command viaphp artisan backpack:install
. See: https://github.com/Laravel-Backpack/CRUD/blob/master/src/app/Console/Commands/Install.php#L53 ($this->executeArtisanProcess('migrate');
)I made a PR for what works for me: https://github.com/Laravel-Backpack/CRUD/pull/3907
Thanks for sending me the link to that article. Giving it a brief look we might be able to get rid of it indeed. Gonna need to check on that with the developer who orginally added it to our deploy script. We recently moved away from Docker, so it might be some legacy having to do with that infrastructure change. But not sure on that one 😃
Cheers!