Skip to content
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

Brave crashes when trying to migrate from v3 to v5+ publisher_info_db version #3907

Closed
jasonrsadler opened this issue Mar 27, 2019 · 3 comments · Fixed by brave/brave-core#2122

Comments

@jasonrsadler
Copy link

jasonrsadler commented Mar 27, 2019

Description

Steps to Reproduce

  1. Open Brave with a v3 publisher_info_db version database
  2. Go to rewards page or open rewards panel
  3. Brave will attempt to upgrade the database

Actual result:

Fatal crash:

[2614:44291:0327/133243.040948:ERROR:database.cc(1713)] publisher_info_db sqlite error 1, errno 0: table activity_info has no column named month, sql: PRAGMA foreign_keys=off;INSERT INTO activity_info (publisher_id, duration, score, percent, weight, month, year, reconcile_stamp) SELECT publisher_id, duration, score, percent, weight, month, year, reconcile_stamp FROM activity_info_old;UPDATE activity_info SET visits=5;DROP TABLE activity_info_old;PRAGMA foreign_keys=on;
[2614:44291:0327/133243.041042:FATAL:database.cc(1726)] table activity_info has no column named month

Expected result:

The database upgrades successfully

Reproduces how often:

easily

Brave version (brave://version info)

Brave 0.64.20 Chromium: 74.0.3729.22 (Developer Build) (64-bit)
Revision d183f516540c1a0c21310ced2e2170a534bca5a5-refs/branch-heads/3729@{#254}
OS Mac OS X

Reproducible on current release:

  • Does it reproduce on brave-browser dev/beta builds?
    unknown

Website problems only:

  • Does the issue resolve itself when disabling Brave Shields?
  • Is the issue reproducible on the latest version of Chrome?

Additional Information

v3 database to test
publisher_info_db.zip

@jasonrsadler jasonrsadler self-assigned this Mar 27, 2019
@NejcZdovc NejcZdovc added the priority/P2 A bad problem. We might uplift this to the next planned release. label Mar 28, 2019
@jasonrsadler jasonrsadler changed the title Brave crashes when trying to migrate from v3 to v4 publisher_info_db version Brave crashes when trying to migrate from v3 publisher_info_db version Mar 30, 2019
@jasonrsadler
Copy link
Author

Caused by v4 upgrade after v3 has performed. v4 tries to select a month and year column that doesn't exist.

@jasonrsadler jasonrsadler changed the title Brave crashes when trying to migrate from v3 publisher_info_db version Brave crashes when trying to migrate from v3 to v5+ publisher_info_db version Mar 30, 2019
jasonrsadler pushed a commit to brave/brave-core that referenced this issue Apr 3, 2019
simplified conditional
jasonrsadler pushed a commit to brave/brave-core that referenced this issue Apr 7, 2019
simplified conditional

Updated migrations to use own version sql

lint fixes

Remove original fix.

Updated db var naming

lint
@NejcZdovc NejcZdovc added this to the 0.65.x - Nightly milestone Apr 10, 2019
@btlechowski
Copy link

btlechowski commented Apr 16, 2019

Verification passed on

Brave 0.63.42 Chromium: 74.0.3729.75 (Official Build) beta(64-bit)
Revision fdb7915642fef8cf997beac2554709d148e3c187-refs/branch-heads/3729@{#754}
OS Ubuntu 18.04 LTS

Used test plan from brave/brave-core#2122

Verification PASSED on macOS 10.14.4 x64 using the following build:

Brave 0.63.44 Chromium: 74.0.3729.75 (Official Build) beta(64-bit)
Revision fdb7915642fef8cf997beac2554709d148e3c187-refs/branch-heads/3729@{#754}
OS Mac OS X

Verification passed on

Brave 0.63.44 Chromium: 74.0.3729.75 (Official Build) beta (64-bit)
Revision fdb7915642fef8cf997beac2554709d148e3c187-refs/branch-heads/3729@{#754}
OS Windows 10 OS Build 17134.523

Used test plan from brave/brave-core#2122

pilgrim-brave pushed a commit to brave/brave-core that referenced this issue Apr 16, 2019
simplified conditional

Updated migrations to use own version sql

lint fixes

Remove original fix.

Updated db var naming

lint
@kjozwiak
Copy link
Member

kjozwiak commented Apr 17, 2019

@jasonrsadler just a quick question. When upgrading the v3 database to the v4 database, the two database schema's look the same. Is there a way to tell if the database was updated to v4?

Edited: @jasonrsadler mentioned that the version number is displayed in the meta table 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants