experimenter icon indicating copy to clipboard operation
experimenter copied to clipboard

Cloned experiment hits constraint error based on `(branch, experimentId)`.

Open ncalexan opened this issue 2 years ago • 1 comments

I can't reproduce this -- more on that later.

I cloned https://experimenter.services.mozilla.com/nimbus/set-firefox-as-default-pdf-handler-on-windows-for-new-users-experiment/ from https://experimenter.services.mozilla.com/nimbus/set-firefox-as-default-pdf-handler-on-windows-for-new-users-rollout/. The latter is an 80% rollout with a single "branch", which I named "Treatment" since it has the feature enabled. The former is a 20% side-by-side experiment with two branches, a control and a treatment. If I name the second branch "Treatment", I saw a constraint error, something like (branch, experimentId) is not unique. There was a numerical value for experimentId: 211.

It rather looked like the experimentId of the clone was the same as the original (since the branch names were the same). That seems like a problem.

I mitigated by changing the second branch name to "Enabled". But I can't reproduce by changing the name of the second branch back to "Treatment", suggesting the experimentId has changed, or something else has changed. I don't want to create a second clone to try again, which will pollute the namespace yet further. Sorry for the vague bug report!

┆Issue is synchronized with this Jira Task ┆Attachments: branch rename.mp4

ncalexan avatar Apr 28 '22 21:04 ncalexan

➤ Maria Heres commented:

This issue is also reproducible on Stage for non-cloned experiments. The STR:

  1. Have an experiment draft open.
  2. Set up a valid branch from “Branches” (i.e. has a feature, name and description).
  3. Click “Save”.
  4. Rename the branch.
  5. Create a new valid branch and give it the initial name of the renamed branch.

The page will display the “duplicate key value violates unique constraint "experiments_nimbusbranch_slug_experiment_id_eefe3985_uniq" DETAIL: Key (slug, experiment_id)=(, ) already exists. ” error message.

Included is a recording of the issue.

!branch rename.mp4|width=1900,height=982!

data-sync-user avatar May 02 '22 13:05 data-sync-user

This should be fixed now.

jaredlockhart avatar Feb 09 '23 15:02 jaredlockhart

➤ Maria Heres commented:

I am not able to reproduce the issue using the STR from my previous comment anymore.

data-sync-user avatar Feb 10 '23 15:02 data-sync-user