Database Update Error on Startup

Bug #1451314 reported by ReverendJ1
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Brewtarget
New
Undecided
Unassigned

Bug Description

Since upgrading from Brewtrget 2.02 I believe (the current one in Ubuntu 14.04 repos) to version 2.10 (on a different machine, using Ubuntu Mate 15.04), I get a "Failed to Update the Database" error on startup. Below is the output when run from a terminal:
$ brewtarget
Got bus address: "unix:abstract=/tmp/dbus-neFZ9uwfvG,guid=a5eabc20dc0919b9cb7cc260554646e2"
Connected to accessibility bus at: "unix:abstract=/tmp/dbus-neFZ9uwfvG,guid=a5eabc20dc0919b9cb7cc260554646e2"
Registered DEC: true
ERROR: Rolling back
ERROR: Database migration 3->4 failed

What is the proper way to update the database here?

Revision history for this message
Philip (rocketman768) wrote :

Do you mind attaching ~/.config/brewtarget/database.sqlite?

Also, did you install any pre-release versions from our PPA at any point?

Revision history for this message
ReverendJ1 (john-wesorick) wrote :

But then someone might see my super secret beer recipes! Just kidding. Here you go. Since using Ubuntu 14.04, I've only used the version in the official Ubuntu repos. I had tried installing from the PPA about 6 months ago, ran into this same issue, rolled back and forgot about it. I think that was stable though. I don't recall ever using a pre-release before v 2 either. Thanks!

Revision history for this message
Philip (rocketman768) wrote :

Overwrite ~/.config/brewtarget/database.sqlite with this one and see if it upgrades.

Revision history for this message
ReverendJ1 (john-wesorick) wrote :

That worked! Thanks! What was wrong with my DB?

Revision history for this message
Philip (rocketman768) wrote :

It was missing a settings field. I made sure our 2.1.0 official release had the expected field in the database, so I'm not sure if maybe Ubuntu picked up a pre-release package without that field or what. It's kind of scary if everyone else is missing that field though.

Revision history for this message
jtratcliff (jtratcliff) wrote :

I just got hit with this today when I built a new Ubuntu 14.04 in virtualbox and installed brewtarget from the PPA (2.2.0-0~2015).

I have my ~/.conf/brewtarget on Dropbox and access from my laptop and from a desktop machine. I just edited a recipe via the laptop a couple days ago... running 2.0.2-1.

Is there a way for me to fix this myself by injecting something into the sqlite db or are we sending all our databases to you for repair?

Clever way to get free recipes ;) All our base are belong to you?

Revision history for this message
jtratcliff (jtratcliff) wrote :

 I found the missing field in settings by comparing the fixed DB in comment #3 above to my broken one..
I was able to use "DB Browser for SQLite" to copy the "settings" fields.

Got past the "Failed to Update Database" but am having other issues now.. of he form
(brewtarget:3972): GLib-GObject-WARNING **: cannot register existing type 'GstObject'

and get stuck at the "Loading..." splash with the BT logo.

I think maybe I'll roll back to 2.1 using the release PPA and see what happens

Revision history for this message
jtratcliff (jtratcliff) wrote :

OK... release PPA version (2.1.0) worked...

Revision history for this message
Mik Firestone (mikfire) wrote :

Guys, you may want to open this over here https://github.com/Brewtarget/brewtarget/issues

I suspect somehow you got development database -- see https://github.com/Brewtarget/brewtarget/issues/36 for a little more.

If yall can open this on github, I will try to poke rocketman to fix this properly.

Revision history for this message
Mik Firestone (mikfire) wrote : Re: [Bug 1451314] Re: Database Update Error on Startup

And the bug you are seeing now is not the result of the database. There is
something weird in how Qt5 is built on Ubuntu, involving phonon and Qt5
that breaks the build. Somebody did the analysis earlier, but I don't
really remember the upshot.

Open up src/MainWindow.cpp and search for the word Timer. Comment out lines
180 and 393 and rebuild. It should work.

Please open this as a new bug on github and mark it as a show stopping bug.

Mik

On Mon, Jun 22, 2015 at 11:35 PM Mik Firestone <email address hidden>
wrote:

> Guys, you may want to open this over here
> https://github.com/Brewtarget/brewtarget/issues
>
> I suspect somehow you got development database -- see
> https://github.com/Brewtarget/brewtarget/issues/36 for a little more.
>
> If yall can open this on github, I will try to poke rocketman to fix
> this properly.
>
> --
> You received this bug notification because you are subscribed to
> Brewtarget.
> Matching subscriptions: brewtarget-bug
> https://bugs.launchpad.net/bugs/1451314
>
> Title:
> Database Update Error on Startup
>
> Status in Brewtarget:
> New
>
> Bug description:
> Since upgrading from Brewtrget 2.02 I believe (the current one in Ubuntu
> 14.04 repos) to version 2.10 (on a different machine, using Ubuntu Mate
> 15.04), I get a "Failed to Update the Database" error on startup. Below is
> the output when run from a terminal:
> $ brewtarget
> Got bus address:
> "unix:abstract=/tmp/dbus-neFZ9uwfvG,guid=a5eabc20dc0919b9cb7cc260554646e2"
> Connected to accessibility bus at:
> "unix:abstract=/tmp/dbus-neFZ9uwfvG,guid=a5eabc20dc0919b9cb7cc260554646e2"
> Registered DEC: true
> ERROR: Rolling back
> ERROR: Database migration 3->4 failed
>
> What is the proper way to update the database here?
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/brewtarget/+bug/1451314/+subscriptions
>

Revision history for this message
jtratcliff (jtratcliff) wrote :

Thanks Mik...

I was able to fix my sqlite db by editing the settings fields to match the one Philip posted above. And I found this

https://bugs.launchpad.net/brewtarget/+bug/1407480

Which I think is the same Qt issue I'm have with 2.2.

The release PPA 2.1 version is working fine for me, though so I'm good. Just can't be bleeding edge :)

Are the github bug reports looked a more closely than these? I can file them there, too, if you think it'll help,

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.