{"record":{"id":"76c576830c3f7e80","repo":"deepseek-ai/deepseek-harness","slug":"lookup-failed","errorCode":"lookup-failed","errorMessage":"lookup provider ${JSON.stringify(key)} failed","messagePattern":"lookup provider (.+?) failed","errorType":"exception","errorClass":"TypertGatewayError","httpStatus":null,"severity":"error","filePath":"packages/api/gateway/src/index.ts","lineNumber":452,"sourceCode":"        `lookup provider ${JSON.stringify(key)} is unavailable`,\n        { field: parameter.wire },\n      )\n    }\n    if (provider.wire !== parameter.wire\n      || (parameter.codec.mode === 'strict' && provider.wireTypeSymbol !== parameter.codec.typeSymbol)) {\n      throw new TypertGatewayError(\n        'provider-mismatch',\n        endpoint,\n        `lookup provider ${JSON.stringify(key)} does not match its strict definition`,\n        { field: parameter.wire },\n      )\n    }\n    let resolved: unknown\n    try {\n      resolved = await provider.resolve(value)\n    } catch (cause) {\n      if (cause instanceof TypertLookupFailure) throw cause\n      throw new TypertGatewayError(\n        'lookup-failed',\n        endpoint,\n        `lookup provider ${JSON.stringify(key)} failed`,\n        { cause, field: parameter.wire },\n      )\n    }\n    if (resolved === undefined) {\n      throw new TypertGatewayError(\n        'lookup-not-found',\n        endpoint,\n        `lookup provider ${JSON.stringify(key)} did not resolve the requested identity`,\n        { field: parameter.wire },\n      )\n    }\n    return resolved\n  }\n}\n","sourceCodeStart":434,"sourceCodeEnd":470,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/api/gateway/src/index.ts#L434-L470","documentation":"The lookup provider's resolve(value) rejected with an exception other than TypertLookupFailure (which passes through with its own failure identity). The Gateway wraps it as lookup-failed with the original error as cause and the parameter's wire field as field: an infrastructure failure while turning the wire id into the Host object, not an invalid request.","triggerScenarios":"A lookup resolver hitting its backing store and rejecting (database down, file system error, network timeout to an external service), or resolver code throwing on unexpected state, while resolveParameter resolves a source 'lookup' argument.","commonSituations":"Backing-store outage behind the lookup; a resolver throwing TypeError on a value that passed wire validation but breaks internal assumptions; transient failures in an external dependency.","solutions":["Read error.cause and fix the underlying provider failure (restore the store, correct the bug).","Return undefined from the resolver for ids that simply do not exist, so they map to lookup-not-found instead of lookup-failed.","Once the backing service is healthy again, retry the original invoke."],"exampleFix":"// before — resolver throws on unknown ids, surfacing infrastructure failures for normal misses\nasync resolve(id: string) {\n  return await docs.get(id) // docs.get throws NotFoundError\n}\n// after — misses return undefined (→ lookup-not-found); only real failures throw\nasync resolve(id: string) {\n  const doc = await docs.get(id).catch(cause => {\n    if (cause instanceof NotFoundError) return null\n    throw cause\n  })\n  return doc ?? undefined\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"import { TypertGatewayError } from '@deepseek-ai/dsh-api-gateway'\n\nfunction isLookupFailed(error: unknown): error is TypertGatewayError {\n  return error instanceof TypertGatewayError && error.code === 'lookup-failed'\n}","tryCatchPattern":"try {\n  await gateway.invoke(request)\n} catch (error) {\n  if (error instanceof TypertGatewayError && error.code === 'lookup-failed') {\n    // classify as a 5xx-side dependency failure with the cause chain; never a client 4xx\n    logger.error('lookup provider failure', { field: error.field, cause: error.cause })\n    throw error\n  }\n  throw error\n}","preventionTips":["Make resolvers total: catch known miss conditions and return undefined so misses become lookup-not-found.","Health-check the lookup backing store so outages page before RPCs start failing.","Keep lookup-failed and lookup-not-found on separate metrics and alert paths."],"tags":["typert","gateway","lookup-provider","error-cause","infrastructure"],"backgroundTag":"upstream-dependency-error","analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}