{"record":{"id":"91422a30bcb46056","repo":"mlflow/mlflow","slug":"unable-to-derive-uc-location-string-for-json-str","errorCode":null,"errorMessage":"Unable to derive UC location string for ${JSON.stringify(this._location)}; skipping trace registration.","messagePattern":"Unable to derive UC location string for (.+?); skipping trace registration\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"libs/typescript/core/src/exporters/uc_table.ts","lineNumber":62,"sourceCode":"  private _location: UnityCatalogLocation;\n\n  constructor(exporter: SpanExporter, location: UnityCatalogLocation) {\n    this._exporter = exporter;\n    this._location = location;\n  }\n\n  onStart(span: OTelSpan, _parentContext: Context): void {\n    const otelTraceId = span.spanContext().traceId;\n\n    if (!span.parentSpanContext?.spanId) {\n      // Root span: build the V4 trace ID and TraceInfo for this trace.\n      const traceLocation: TraceLocation = {\n        type: TraceLocationType.UC_TABLE_PREFIX,\n        ucTablePrefix: { ...this._location },\n      };\n      const locationString = getUcLocationString(traceLocation);\n      if (!locationString) {\n        console.warn(\n          `Unable to derive UC location string for ${JSON.stringify(this._location)}; skipping trace registration.`,\n        );\n        return;\n      }\n\n      const traceId = constructTraceIdV4(locationString, otelTraceId);\n\n      const traceMetadata: Record<string, string> = {\n        [TraceMetadataKey.SCHEMA_VERSION]: '4',\n      };\n      const ctxMetadata = getConfiguredTraceMetadata();\n      if (ctxMetadata) {\n        Object.assign(traceMetadata, ctxMetadata);\n      }\n\n      const tags: Record<string, string> = {};\n      const ctxTags = getConfiguredTraceTags();\n      if (ctxTags) {","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/libs/typescript/core/src/exporters/uc_table.ts#L44-L80","documentation":"The UC table trace exporter registers traces against a Unity Catalog location. getUcLocationString() failed to derive a location string from this._location, so trace registration is skipped and this warning is logged. Without a valid location string the exporter cannot construct the v4 trace ID or the destination UC table, so exporting traces from this span processor is impossible.","triggerScenarios":"onStart is called with a TraceLocation whose ucTablePrefix (catalog/schema/table parts) is empty, malformed, or of an unsupported shape, causing getUcLocationString() to return undefined/null.","commonSituations":"Configuring MlflowUcTableSpanExporter with an incomplete { catalog, schema, table } object (missing fields or empty strings); constructing the exporter before config/env that supplies the UC table name is loaded; passing a location object with wrong property names.","solutions":["Pass a complete UC location to the exporter, e.g. new MlflowUcTableSpanExporter({ catalog: 'main', schema: 'ml', table: 'otel_spans' }).","Log/inspect this._location at construction time and confirm all required UC parts are non-empty strings.","Resolve the configuration before constructing the exporter (await env/config loading) rather than passing a placeholder object.","Validate the location string renders correctly by calling getUcLocationString() yourself in a startup check."],"exampleFix":"// before\nconst exporter = new MlflowUcTableSpanExporter({} as any);\n// after\nconst exporter = new MlflowUcTableSpanExporter({ catalog: 'main', schema: 'monitoring', table: 'traces' });","handlingStrategy":"validation","validationCode":"function assertUcLocation(loc: unknown): asserts loc is { catalog: string; schema: string; table: string } {\n  if (!loc || typeof loc !== 'object') throw new Error('UC location must be an object');\n  const l = loc as Record<string, unknown>;\n  for (const k of ['catalog', 'schema', 'table']) {\n    if (typeof l[k] !== 'string' || !(l[k] as string).length) throw new Error(`UC location missing '${k}'`);\n  }\n}\nassertUcLocation(location); // call before constructing the exporter","typeGuard":"function isValidUcLocation(l: unknown): l is { catalog: string; schema: string; table: string } {\n  return !!l && typeof l === 'object' &&\n    ['catalog', 'schema', 'table'].every(k => typeof (l as any)[k] === 'string' && (l as any)[k].length > 0);\n}","tryCatchPattern":null,"preventionTips":["Validate the { catalog, schema, table } object before constructing MlflowUcTableSpanExporter.","Load UC config (env/secret) fully before exporter construction.","Add a startup smoke test calling getUcLocationString() with your location.","Never pass `as any`/empty placeholder location objects."],"tags":["unity-catalog","databricks","configuration","tracing"],"backgroundTag":"invalid-uc-location","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}