question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] `backpack:install` command hangs in production

See original GitHub issue

Bug 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:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
tabacitucommented, Oct 28, 2021

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 🙏

0reactions
koenwoortmancommented, Oct 28, 2021

Looking at your screenshot I think we mean different things, this is where the command hangs for me: Screenshot from 2021-10-28 09-11-17

I don’t see an option to pass the --no-interaction flag to the migrate command via php 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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

'mount' command hangs if you try to mount an extended partition
This bug reports a regression in behavior. libguestfs locks up when presented with an unknown partition type during mounting. It appears that guestfs...
Read more >
[BUG] npm install will randomly hang forever and cannot be ...
When running npm install it will sometimes hang at a random point. When it does this, it is stuck forever. CTRL+C will do...
Read more >
CSCvo09511 - CLI hangs for several minutes ... - Cisco Bug
Symptom: When applying certain interface-level CLI commands, it takes few minutes (~3-4) for the command to apply (before the CLI will ...
Read more >
90034 – gcc hangs on wait4 after vfork after opening tmp file
Created attachment 46123 [details] causes the hang Here is the command: > dd if=bug_input.c bs=1 count=3051 2>/dev/null | gcc -xc - # hangs...
Read more >
20866 – cgi script just hangs at end, then apr_bucket_read error
So I made just TWO changes to my entire perl script, I removed the $|++ command which turned off auto-flushed output thus enabling...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found