Closed Bug 1502182 Opened Last year Closed Last year

AddonStudies.jsm; InvalidStateError: A mutation operation was attempted on a database that did not allow mutations.

Categories

(Firefox :: Normandy Client, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 65
Tracking Status
firefox63 --- wontfix
firefox64 --- wontfix
firefox65 --- fixed

People

(Reporter: cpearce, Assigned: mythmon)

References

Details

Attachments

(2 files)

Attached file nnb4hrwj.wr5.zip
When Firefox is run with the attached profile, I see the following error logged to the browser console:

1540500348118   app.normandy.action.AddonStudyAction    DEBUG   Could not run postExecution hook for AddonStudyAction
InvalidStateError: A mutation operation was attempted on a database that did not allow mutations.
transaction
resource://gre/modules/IndexedDB.jsm:349:39
objectStore
resource://gre/modules/IndexedDB.jsm:377:23
getStore
resource://normandy/lib/AddonStudies.jsm:82:10
getAll
resource://normandy/lib/AddonStudies.jsm:204:12
InterpretGeneratorResume self-hosted:1255:8 next self-hosted:1210:9
1540500348118   app.normandy.action.AddonStudyAction    DEBUG   Could not run postExecution hook for AddonStudyAction
InvalidStateError: A mutation operation was attempted on a database that did not allow mutations.
transaction
resource://gre/modules/IndexedDB.jsm:349:39
objectStore
resource://gre/modules/IndexedDB.jsm:377:23
getStore
resource://normandy/lib/AddonStudies.jsm:82:10
getAll
resource://normandy/lib/AddonStudies.jsm:204:12
InterpretGeneratorResume self-hosted:1255:8 next self-hosted:1210:9 

See also bug 1458179 and bug 1485569 for similar issues.
I had the same error with ``./mach run --temp-profile`` 

changeset:   443382:f7a97b344fa5 (Mon Oct 29 11:25:37 2018 +0200)
This error can be reproduced with clean profile on central (65.0a1 20181031100345) and release as well (63.0 20181018182531).  

Although it might not be related, debug mode shows an additional :

1540994492522	app.normandy.action.AddonStudyAction	DEBUG	Could not run postExecution hook for AddonStudyAction
InvalidStateError: A mutation operation was attempted on a database that did not allow mutations.
I suspect that the root cause of bug 1502182 is that we try to create multiple
readwrite stores on a given database at the same time, and that we don't wait
for databases to fully close before reopening them. I don't think any of the
benefits of closing IndexedDB databases apply to Normandy, and I don't think it
is a significant cost to simply keep them open.
Assignee: nobody → mcooper
Status: NEW → ASSIGNED
Pushed by mcooper@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cdc6d97f0b14
In Normandy, never close IndexedDB databases, and be explicit about objectStore modes r=Gijs,asuth
Backed out changeset cdc6d97f0b14 (bug 1502182) for ESLint failures in builds/worker/checkouts/gecko/toolkit/components/normandy/lib/RecipeRunner

Backout:
https://hg.mozilla.org/integration/autoland/rev/d0c95da09301d4f1259c68d3c67be0cde2c02f51

Push with failures:
https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&revision=cdc6d97f0b14d429f4c861e7e3a77a54e12ca35d
Flags: needinfo?(mcooper)
Pushed by mcooper@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dbc2bc8f8747
In Normandy, never close IndexedDB databases, and be explicit about objectStore modes r=Gijs,asuth
Flags: needinfo?(mcooper)
https://hg.mozilla.org/mozilla-central/rev/dbc2bc8f8747
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → Firefox 65
Is there a user impact which justifies backport consideration for Beta or can this ride the trains?
Flags: needinfo?(mcooper)
Comment on attachment 9021964 [details]
Bug 1502182 - In Normandy, never close IndexedDB databases, and be explicit about objectStore modes r=Gijs,asuth

[Beta/Release Uplift Approval Request]

Feature/Bug causing the regression: Unknown

User impact if declined: Add-on experiments sometimes don't unenroll at the end of the experiment. Normandy will attempt to unenroll the user from the experiment every time it runs (at most once every 6 hours) until successful. The probability of this is currently unknown.

Is this code covered by automated tests?: No

Has the fix been verified in Nightly?: Yes

Needs manual test from QE?: No

If yes, steps to reproduce: 

List of other uplifts needed: None

Risk to taking this patch: Medium

Why is the change risky/not risky? (and alternatives if risky): It isn't clear what the underlying problem is here, only that the patch helps the situation.

String changes made/needed:
Flags: needinfo?(mcooper)
Attachment #9021964 - Flags: approval-mozilla-beta?
We'll also want the fix from bug 1506816 if we uplift this.

I had Josh Gaunt look into the telemetry related to this issue. It seems that this problem tends to make people stay enrolled for a few days longer. This time is detectable in telemetry. I think it will be useful to uplift this to beta, but not critical. I'm ambivalent about uplifting it to release.
I think I'd rather punt on this for 64, too many unknowns.
Attachment #9021964 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
You need to log in before you can comment on or make changes to this bug.