mlflow/mlflow · error · MlflowException

RESOURCE_DOES_NOT_EXIST

RESOURCE_DOES_NOT_EXIST

Error message

Could not find experiment with name {experiment_name}

What it means

Raised by _get_permission_from_experiment_name when the tracking store has no experiment matching the supplied experiment_name. The auth middleware must resolve the experiment to evaluate permissions, so a missing name yields RESOURCE_DOES_NOT_EXIST.

Source

Thrown at mlflow/server/auth/__init__.py:911

    if MLFLOW_ENABLE_WORKSPACES.get():
        if workspace_name := workspace_context.get_request_workspace():
            user = store.get_user(username)
            perm = store.get_role_permission_for_resource(user.id, "workspace", "*", workspace_name)
            if perm is not None:
                return perm
            # Honor the default-workspace auto-grant when configured.
            if _user_inherits_default_workspace_grant(workspace_name):
                return get_permission(auth_config.default_permission)
        return NO_PERMISSIONS

    return get_permission(auth_config.default_permission)


def _get_permission_from_experiment_name() -> Permission:
    experiment_name = _get_request_param("experiment_name")
    store_exp = _get_tracking_store().get_experiment_by_name(experiment_name)
    if store_exp is None:
        raise MlflowException(
            f"Could not find experiment with name {experiment_name}",
            error_code=RESOURCE_DOES_NOT_EXIST,
        )
    username = authenticate_request().username

    return _get_role_permission_or_default(
        _role_permission_for(
            username=username,
            resource_type="experiment",
            resource_key=store_exp.experiment_id,
            workspace_lookup_id=store_exp.experiment_id,
            workspace_fetcher=_get_tracking_store().get_experiment,
            workspace_label="experiment",
        ),
    )


def _get_permission_from_run_id() -> Permission:

View on GitHub (pinned to 6a27f2decc)

Solutions

  1. Call client.get_experiment_by_name(name) first and handle None before hitting the guarded endpoint
  2. Use the experiment_id instead of the name if you have it
  3. Verify the tracking URI points at the store containing the experiment
  4. Check the exact name via the UI or search_experiments; names are matched literally

Example fix

// before
exp = client.get_experiment_by_name('My-Experiment')  # auth resolves name
// after
exp = client.get_experiment_by_name('My Experiment')
if exp is None: raise SystemExit(f'no such experiment: My Experiment')
Defensive patterns

Strategy: try-catch

Validate before calling

exp = client.get_experiment_by_name(experiment_name)
if exp is None:
    raise SystemExit(f'Experiment {experiment_name!r} not found in {client.tracking_uri}')

Try / catch

try:
    do_authenticated_call(experiment_name=name)
except MlflowException as e:
    if e.error_code == 'RESOURCE_DOES_NOT_EXIST' and 'experiment' in str(e):
        exps = client.search_experiments(filter_string=f"name = '{name}'")
        if not exps:
            raise SystemExit(f'no experiment named {name}')
    else:
        raise

Prevention

When it happens

Trigger: Requesting an experiment permission check (validate_can_read_experiment_by_name path) with an experiment_name that was never created, was deleted, or is named differently in the configured tracking store (e.g. different backend or workspace).

Common situations: Typos in experiment names in notebooks/scripts; pointing a client at a different tracking store (staging vs prod) where the name doesn't exist; deleted experiments (soft-deleted ones no longer resolve); case-sensitivity mismatches.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of mlflow/mlflow@6a27f2decc (2026-08-29). Data as JSON: /api/errors/62e1bdb797989141. Report an issue: GitHub.