Learning Record learning from practice

· visualization / wandb

Diagnose a W&B Local Server Port Mismatch

When a local Weights & Biases (W&B) server is started on one port but the login flow displays another, treat the two values as separate configuration facts. The Docker port mapping controls how the service is exposed. The W&B client configuration controls which address the CLI uses.

This article uses placeholder host names only. Replace <server-host> with the machine that runs the container.

Start the Local Service

The following command publishes container port 8080 on host port 8080:

docker run -d --rm -v wandb:/vol -p 8080:8080 --name wandb-local wandb/local

In -p 8080:8080, the value on the left is the host port and the value on the right is the container port. A client connecting directly to this container should therefore use http://<server-host>:8080.

The --rm option removes the container when it stops. The named volume wandb is mounted at /vol, so the service data is not tied to the container’s writable layer.

Inspect the Client Target

Run the following command on the machine where the W&B CLI is used:

wandb status

Check the displayed base URL or host setting. If it contains a port other than 8080, the CLI has been configured to use a different endpoint than the direct Docker mapping.

Then inspect the local settings file:

cat ~/.config/wandb/settings

Look for a value such as base_url, host, or entity that was saved by an earlier login or configuration command. A stored base URL can persist after the container is restarted, because restarting a container does not automatically rewrite the client settings on another machine.

Align the Login Endpoint

For a direct connection to the Docker-published service, log in against the same host and port:

wandb login --relogin --host=http://<server-host>:8080

Confirm the result with:

wandb status
cat ~/.config/wandb/settings

Both outputs should now identify the expected endpoint. If the login page still uses another port, do not assume the container changed its mapping. Check whether a reverse proxy, an SSH tunnel, or an environment variable routes the public address through a different port.

Check the Published Port

Inspect the running container before changing client configuration again:

docker ps --format 'table \t'

For the command above, the wandb-local row should show a mapping equivalent to host 8080 forwarding to container 8080. If it does not, recreate the container with the intended -p option.

Practical Rule

Use the address advertised by the access layer that users actually reach:

  • Use http://<server-host>:8080 for a direct Docker port mapping.
  • Use the proxy’s external host and port when a reverse proxy forwards requests to the container.
  • Use the locally forwarded host and port when connecting through an SSH tunnel.

The crucial check is consistency: the address in wandb status, the persisted W&B settings, and the endpoint used for login should describe the same access path.