deepseek-ai/deepseek-harness · error

transport failure for ${channel}/${endpoint}: HTTP ${respons

Error message

transport failure for ${channel}/${endpoint}: HTTP ${response.status}

What it means

The browser RPC caller (createWebConnectionRpc.call) posts a JSON client-request envelope to ${origin}${channel}/${endpoint} and throws this error whenever the HTTP response is not ok, embedding the status. The status separates the trust fence (403: the request Host is neither loopback nor declared in trustedHosts), unregistered targets (404), bodies over maxRequestBodyBytes (413), and handler faults (5xx).

Source

Thrown at packages/client/connection/src/client/rpc.ts:45

      assertTarget(channel, endpoint)
      const rpcId = RpcId(randomUuid())
      const message: ClientRequest = {
        type: 'client-request',
        rpcId,
        method: endpoint,
        payload,
      }
      const response = await send(
        new URL(`${channel}/${endpoint}`, resolveBase()),
        {
          method: 'POST',
          headers: { 'content-type': 'application/json' },
          body: JSON.stringify(message),
          ...signal === undefined ? {} : { signal },
        },
      )
      if (!response.ok) {
        throw new Error(`transport failure for ${channel}/${endpoint}: HTTP ${response.status}`)
      }
      const full = serverResponseSchema.parse(await response.json())
      if (full.rpcId !== rpcId) {
        throw new Error(`rpcId mismatch for ${endpoint}: sent ${rpcId}, got ${full.rpcId}`)
      }
      return full.result
    },
  }
}

function resolveBase(): string {
  const location = (globalThis as { location?: { origin?: string } }).location
  return location?.origin !== undefined && location.origin !== 'null' ? location.origin : INTERNAL_BASE
}

function assertTarget(channel: string, endpoint: string): void {
  const segments = endpoint.split('/')
  if (!CHANNEL_PATTERN.test(channel)

View on GitHub (pinned to b150a551b8)

Solutions

  1. 403: open the GUI via loopback, or declare the serving authority in trustedHosts so the Host fence accepts it
  2. 404: check the channel and endpoint strings against the registered RPC handlers
  3. 413: raise client-connection maxRequestBodyBytes (staying above the image-limit floor) or shrink the payload
  4. 5xx: read the dsh server logs for the handler stack trace

Example fix

// before
const result = await rpc.call('/connection', 'session.create', payload)

// after — branch on the embedded status
try {
  const result = await rpc.call('/connection', 'session.create', payload)
} catch (error) {
  const status = Number(/HTTP (\d+)$/.exec(String(error))?.[1] ?? 0)
  if (status === 403) throw new Error('authority not trusted; use the loopback URL or declare trustedHosts')
  if (status === 413) throw new Error('payload exceeds maxRequestBodyBytes')
  throw error
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const result = await rpc.call(channel, endpoint, payload)
} catch (error) {
  const status = Number(/HTTP (\d+)$/.exec(String(error))?.[1] ?? 0)
  if (status === 403) redirectToListedUrl()   // trust fence
  else if (status === 413) shrinkPayload()
  else if (status >= 500) reportServerFault(error)
  else throw error
}

Prevention

When it happens

Trigger: A browser-side rpc.call(channel, endpoint, payload) answered 403 when the GUI is reached through an undeclared authority, 404 for an unregistered channel/endpoint, 413 when the body exceeds maxRequestBodyBytes, or 5xx when the handler throws server-side.

Common situations: Accessing the GUI via an undeclared hostname or reverse proxy after binding 0.0.0.0; a service worker or proxy intercepting /api; typo'd channel or endpoint strings; image-heavy payloads crossing the body cap.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/27e1a396dfe500b8. Report an issue: GitHub.