-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sqitch deploy
hangs with no output
#818
Comments
It's almost certainly waiting on your database CLI. Can you set an environment variable or mysql config file variable to enable shell logging and debugging. |
I'll try that, thanks. Might make sense to pass the --verbose flag to the CLI at one of the three sqitch verbosity levels? Assuming database clients are consistent enough at this. |
Yeah, you'd either have to hack it into the source: sqitch/lib/App/Sqitch/Engine/mysql.pm Lines 172 to 177 in 8ee14fb
Or create a shell wrapper around |
I tried running with
I'm guessing this happens after sqitch is done applying the change and tries to close the connection. |
In that case maybe it's the DBI connection. Set |
For posterity, the error I'm trying to track down appears to be in https://github.com/denodrivers/mysql, based on the fact that a rewrite in Rust doesn't have the same problem. |
Uhhhhh…where is the error coming from? Sqitch uses the |
Oh no, this is just for context, sorry. I'm using my own CLI written for Deno, and then try to run I'm still looking at the logs produced by |
All right, here's the log. I stopped after the first twelve The repeating fragment
I'm afraid this tells me nothing at all 😅 |
I'm sorry, I'm confused. Are you saying it works as expected unless it runs after your CLI? What is your CLI? What does it do? How does it relate to Sqitch? |
Yes, you got it right. My CLI connects to the database and tries to revert a single migration, the same way sqitch would do it. |
My CLI doesn't use sqitch directly though, only the database of changes. |
Is your client taking a lock on the database? That would explain why Sqitch hangs. |
Not explicitly and I don't think it locks the whole database, but it does lock rows/tables. It is weird that the locks aren't dropped when the connection drops, but I guess it's up to the driver to terminate them. Should sqitch do something in these cases? My awful attempt at reimplementing the revert command is probably not the only way the database could get locked by some random process 🤔 |
Try not taking locks and see if that fixes it. I agree Sqitch shouldn't hang, but until I understand what your CLI might be doing, I can't fix it :-) |
Haha, fair. Thank you for your interest in investigating this edge case in the first place. Here's a full list of all the database operations the CLI does:
The code if you care to look for yourself, apologies for the weekend-project quality: https://github.com/Kinrany/quitch/ |
I suggest you start commenting out some of those commands and see what happens. Selecting the schema name looks like a likely suspect. |
I ran into a problem with
sqitch deploy
hanging forever with no output, even with-VVV
. This is likely due to an unknown third party error, but it'd be nice to be able to know what exactly it is sqitch is waiting for.v1.1.0, running in a container equivalent to:
The text was updated successfully, but these errors were encountered: