Closed cyppe closed 5 months ago
Okay this is definitely a super weird error. Did the interaction with your app only happen via the CLI? I can't think if anything that would result in this behavior
It was a CLI command, but I also had browser running a page with Livewire component with auto refresh so it also sent requests every second.
I will add logging for all queries that contains DROP TABLE and see if I can catch it if it happens again.
I figured it out.
PHPStorm triggered Pest in some situations, and even if I had not configured Pest, it defaulted to my .env db connection and wiped database. So it had nothing to do with Herd.
Closing issue.
Oh wow - that must've been quite tricky to debug! I'm glad that you figured it out!
Platform
macOS
Operating system version
14.4.1 (23E224)
System architecture
Intel (x86)
Herd Version
1.6.0
PHP Version
8.3.4
Bug description
I have a feeling this will be very hard to reproduce. But it has happened twice for me so something is going on.
Basically I am running Herd and everything is just fine. And the command I run has been run hundreds of times without debugging enabled without any issue.
And now I enabled debugging in phpstorm and started a artisan command that pushes jobs to queue.
And then there came this logs in laravel.log I have not seen before:
And then I was starting command a couple of minutes later, and now for some reason all tables in mysql is deleted and there is only a empty migrations table.
Not sure what else I can share.
I wonder if the php code that is acting as some Herd proxy somehow can put Laravel into some state where it acts like if it's in some kind of test mode and wipes the database to prepare for test?
Otherwise no idea.
At least I am sure it's not my code / migrations that has any weird drop table logic.
Again - this feels like something hard to track down so I will just hope that the explaination maybe can trigger some idea from support team if there might be some fluke condition that can make it wipe database.
Lucky enough it's just a local test database so no harm done, more than being very annoying to recover it if it will happen often as my database is 100gb+.
Steps to reproduce
Not sure.
Relevant log output