Affected: Experimentation
Symptoms
When attempting to create a new experiment on a feature flag, receive the following error:
Experiment already configured.
- Unable to start multiple experiments on a single feature flag, even across different environments.
Cause
LaunchDarkly currently supports only one active experiment per feature flag, regardless of the environment. This limitation exists to ensure consistent data collection and minimize conflicts in experimentation results. If an experiment is already running on a flag in one environment, you will encounter the error when trying to start another.
Solution
To resolve this issue, follow these steps to remove the legacy experiment targeting rule and allow the creation of a new experiment:
-
Copy targeting rules again:
Navigate to the environment where the issue is occurring. Copy the flag's targeting rules from this environment to a different environment where an experiment is not active. This will overwrite the legacy experiment rule in the destination environment. -
Delete the legacy rule via the REST API (if needed):
If copying targeting rules does not resolve the issue, use the LaunchDarkly REST API to manually delete the legacy experiment rule. You can identify the rule by querying the flag's configuration in the affected environment and locating the experiment rule. -
Verify the fix:
After performing the above steps, attempt to create a new experiment on the flag in the destination environment. The "experiment already configured" error should no longer appear.