Documentation menu

Troubleshooting

Each entry starts from what you see: an error message, or a symptom when there's no message.

port 8000 is already in use (detected listener on 127.0.0.1:8000)

Something is already listening on the port. Dynoxide checks before it binds, and it checks the address you asked for and its counterparts: the wildcard address for a loopback one, loopback for the wildcard and, from 1.8.0, the other loopback family. A Docker container published on 0.0.0.0:8000 blocks dynoxide --port 8000 on 127.0.0.1. From 1.8.0, so does a server listening on [::1]:8000, because a localhost client might reach it first. The address in brackets is where it found the listener.

From 1.8.0 this exits 4, where earlier releases exit 1. A script that checks for exactly 1 needs to accept 4 as well. The npm package's start() rejects with DYNOXIDE_PORT_IN_USE and the PHP package throws PortInUseException, both naming the port.

Stop whatever holds the port, or pick another one. In a test suite, --port 0 has the operating system choose a free port, and Dynoxide prints the one it got:

dynoxide --port 0
# Dynoxide listening on http://127.0.0.1:54321

A program starting Dynoxide can add --ready-json and read the port from one JSON line on stdout instead.

On Windows, a port can be refused when nothing listens on it, because Windows reserves ranges of ports for itself. That exits 1, as a permission error, and the message says how to list the reserved ranges:

netsh interface ipv4 show excludedportrange protocol=tcp

--port and --mcp-port are both 19280

From 1.8.0, serve --mcp and import --serve --mcp refuse an --mcp-port that's the same as a fixed --port, whatever the hosts, and exit 1 before binding anything. The default --mcp-port counts (19280 for serve, 8100 for import --serve), so dynoxide serve --port 19280 --mcp hits this without naming an MCP port at all. Give the MCP server a port of its own:

dynoxide serve --port 19280 --mcp --mcp-port 19281

Earlier releases allowed it, and on macOS an MCP listener on 127.0.0.1 could bind beside DynamoDB on 0.0.0.0 and take requests meant for DynamoDB.

A client gets UnknownOperationException

There are three ways to get it.

  • A DynamoDB operation that only makes sense in the cloud, such as CreateBackup, CreateGlobalTable, ExportTableToPointInTime or PutResourcePolicy. Dynoxide answers 400 with {"__type":"com.amazon.coral.service#UnknownOperationException"}. Compatibility covers what isn't implemented. If code you're testing calls one, stub that call.
  • A request without an X-Amz-Target header, or with one Dynoxide doesn't know. Same answer. A hand-written HTTP call is the usual cause; the AWS SDKs always set it.
  • A request to a path other than /. Dynoxide answers 404 with the body <UnknownOperationException/>. Check the endpoint you configured has no path on the end: http://localhost:8000, not http://localhost:8000/dynamodb.

A client gets MissingAuthenticationTokenException

The client sent no credentials. Dynoxide never checks a signature, but it does need the Authorization header to be there. Give the client any non-empty access key and secret.

error: Internal error: unable to open database file: <path>

Dynoxide couldn't create or open the file given to --db-path. Either the directory doesn't exist (Dynoxide won't create it) or the user running Dynoxide can't write to it.

In Docker this usually means running as a non-root user against the image's own /data, which belongs to root. Mount a directory your user owns:

docker run --rm -p 8000:8000 \
  --user "$(id -u):$(id -g)" \
  -v "$(pwd)/data:/data" \
  ghcr.io/nubo-db/dynoxide \
  serve --host 0.0.0.0 --port 8000 --db-path /data/dynoxide.sqlite

The connection is refused or reset when Dynoxide runs in a container

Dynoxide binds to 127.0.0.1 unless told otherwise, and inside a container that address can only be reached from inside the same container. The published image's default command already passes --host 0.0.0.0, so this only happens when you override the command, or run the binary in an image of your own. Add --host 0.0.0.0:

docker run --rm -p 8000:8000 ghcr.io/nubo-db/dynoxide \
  serve --host 0.0.0.0 --port 8000 --log quiet

Tables are gone after a restart

Without --db-path, Dynoxide keeps everything in memory, and the Docker image does the same unless you give it a path. That suits test suites, which want a clean start, but nothing survives the process. Pass --db-path to keep data in a file, and in Docker put that file on a volume, as in the Docker Compose example.

A test passes against AWS and fails against Dynoxide, or the other way round

Check Compatibility and the engine's differences from DynamoDB first. If a test broke after an upgrade, the "Changes to test assertions" sections on the compatibility page list what each release moved. If the difference isn't listed, it's a bug worth reporting: include the request, what AWS answered, and what Dynoxide answered.