---
title: "DF0055: Instance Already Owns Its WebSocket Transport"
description: "This instance already owns its WebSocket transport ({tier}), so it cannot take over the host's upgrade events."
canonical_url: "https://devfra.me/errors/df0055"
---
# DF0055: Instance Already Owns Its WebSocket Transport

> This instance already owns its WebSocket transport (\{tier}), so it cannot take over the host's upgrade events.

## Message

> This instance already owns its WebSocket transport (`{tier}`), so it cannot take over the host's upgrade events.

## Cause

`attach(server)` / `handleUpgrade(req, socket, head)` exist for the tier where the instance binds nothing and waits for the host to hand upgrade events over. When the options already name a local binding (`ws.port` or `ws.sidecar` (`tier: 'sidecar'`) or `server` (`tier: 'server'`)), that transport already serves the socket, so routing a second server's upgrades into it would give the same RPC group two conflicting bindings.

## Example

```ts
import { initHub } from '@devframes/hub/initiate'

const hub = initHub({
  base: '/__devframes/',
  ws: { sidecar: true }
})
hub.attach(myServer) // ✗ throws DF0055: the side-car already serves `__ws`
```

## Fix

Drop the `attach` / `handleUpgrade` call and let the configured transport serve the socket, or remove `server` / `ws.port` / `ws.sidecar` so the instance leaves the binding to you.

## Source

- [`packages/devframe/src/node/instance-shell.ts`](https://github.com/devframes/devframe/blob/main/packages/devframe/src/node/instance-shell.ts): the shared instance shell throws this from `attach` / `handleUpgrade` when the resolved tier is `sidecar` or `server`, for both `initDevframe` and `initHub`.


## Sitemap

See the full [sitemap](https://devfra.me/sitemap.md) for all pages.
