Brewtarget / brewtarget

Main brewtarget source code repository.
GNU General Public License v3.0
312 stars 134 forks source link

Crash when removing hops #710

Closed mathewcallaghan closed 1 year ago

mathewcallaghan commented 1 year ago

Ubuntu 22.04.1 LTS and Brewtarget 3.05 installed using brewtarget_3.0.5-2_amd64.deb. Crashes when removing selected hop. Opening again the hops is removed.

Information from command line.

[14:33:33.310] (1dhz8xd2kg) ERROR : std::shared_ptr ObjectStore::defaultHardDelete(int) Error executing database query "DELETE FROM hop WHERE id = :id;" : "FOREIGN KEY constraint failed Unable to fetch row" [database/ObjectStore.cpp:1457]

[14:33:33.310] (1dhz8xd2kg) ERROR : ASSERT: "whatToAddOrRemove->key() > 0" in file /home/runner/work/brewtarget/brewtarget/src/UndoableAddOrRemove.h, line 82 [UndoableAddOrRemove.h:82] Aborted (core dumped)

matty0ung commented 1 year ago

Hello, Sorry you're hitting this problem. I had a quick go at trying to reproduce it on my local build, but I couldn't get the same thing to happen. I'm guessing from the error message that something is amiss in your database file. Would you be able to upload it here? It might help us diagnose whatever the root bug. Normally on Linux the file is in the folder ~/.local/share/brewtarget/ and it's called database.sqlite. Also, do you get the problem with every hop you add/remove to/from a recipe or only with some hops (or some recipes)?

mathewcallaghan commented 1 year ago

Thanks @matty0ung now you mentioned it I double checked and the newly added hops can be removed without error. The recipes were created in an older version of brewtarget. I can upload the database but I think now the entries causing the issue might be gone.

matty0ung commented 1 year ago

OK, cool, that's good to hear. I'll close this issue, but if you hit more problems please don't hesitate either to reopen it or to raise a new one. We're hoping to do a 3.0.6 release with some more bug-fixes this month.