{"record":{"id":"04395c3e627b27df","repo":"mlflow/mlflow","slug":"not-found","errorCode":"NOT_FOUND","errorMessage":"Trace with ID {trace_id} is not found.","messagePattern":"Trace with ID (.+?) is not found\\.","errorType":"error_code","errorClass":"MlflowException","httpStatus":null,"severity":"error","filePath":"mlflow/tracing/client.py","lineNumber":220,"sourceCode":"            initial_interval = max(0.0, MLFLOW_GET_TRACE_OTEL_INITIAL_RETRY_INTERVAL_SECONDS.get())\n            max_interval = max(0.0, MLFLOW_GET_TRACE_OTEL_MAX_RETRY_INTERVAL_SECONDS.get())\n            attempt = 0\n            while True:\n                if traces := self.store.batch_get_traces([trace_id], location):\n                    return traces[0]\n\n                remaining = deadline - time.monotonic()\n                if remaining <= 0:\n                    break\n\n                interval = min(initial_interval * 2**attempt, max_interval, remaining)\n                attempt += 1\n                _logger.debug(\n                    f\"Trace not found, retrying in {interval:.2f} seconds (attempt {attempt})\"\n                )\n                time.sleep(interval)\n\n            raise MlflowException(\n                message=f\"Trace with ID {trace_id} is not found.\",\n                error_code=NOT_FOUND,\n            )\n        else:\n            try:\n                trace_info = self.get_trace_info(trace_id)\n                # if the trace is stored in the tracking store or archive repo, load spans via the\n                # store/server path; otherwise, load spans from the artifact repository\n                if trace_info.tags.get(TraceTagKey.SPANS_LOCATION) in (\n                    SpansLocation.TRACKING_STORE,\n                    SpansLocation.ARCHIVE_REPO,\n                ):\n                    try:\n                        return self.store.get_trace(trace_id)\n                    except MlflowNotImplementedException:\n                        pass\n                    if traces := self.store.batch_get_traces([trace_info.trace_id]):\n                        return traces[0]","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/tracing/client.py#L202-L238","documentation":"`MlflowTracingClient.get_trace` polls for a trace whose info is not yet visible, retrying with a sleep interval. If the trace still cannot be found after retries, it raises NOT_FOUND. This is the terminal 'trace does not exist (yet)' signal for the given trace_id.","triggerScenarios":"Calling get_trace (directly or via get_trace_info/set_trace_tag/delete_trace_tag/log_assessment wrappers) with a trace_id that does not exist in the backing store, or one whose info is not visible within the retry window (e.g. async trace creation still in flight).","commonSituations":"Querying a trace immediately after an async logging call before the backend persists it; truncated/mistyped trace ID; wrong tracking server or experiment backend; trace was deleted.","solutions":["Verify the trace_id is complete and from the current tracking URI/experiment.","Wait longer or ensure the producer finished logging traces before reading (or retry with backoff in your code).","List recent traces with MlflowTracingClient().search_traces(...) to confirm the ID exists."],"exampleFix":"// before\ntrace = client.get_trace(trace_id)  # raises NOT_FOUND right after async log\n\n// after\nimport time\nfor _ in range(5):\n    try:\n        trace = client.get_trace(trace_id)\n        break\n    except MlflowException as e:\n        if e.error_code != \"NOT_FOUND\":\n            raise\n        time.sleep(2)","handlingStrategy":"retry","validationCode":"# pre-check existence\ninfos = client.search_traces(experiment_locations=[exp_id], max_results=100)\nexists = any(t.trace_id == trace_id for t in infos)","typeGuard":null,"tryCatchPattern":"import time\nfor attempt in range(5):\n    try:\n        return client.get_trace(trace_id)\n    except MlflowException as e:\n        if e.error_code != \"NOT_FOUND\":\n            raise\n        time.sleep(2 ** attempt)","preventionTips":["Ensure producers finish logging traces before consumers read them.","Validate trace_id format/source; avoid hand-truncating IDs.","Confirm the tracking URI points at the server that owns the trace."],"tags":["tracing","not-found","python"],"backgroundTag":"resource-not-found","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}