dfinity / dfinity/sdk

`dfx ping` fails for version `0.28.0` running inside docker

Open
#4,322 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage
Dominant language
Rust
Stars
204
Forks
98
PR merge metrics
No merged PRs in 30d

Description

There is an issue with connectivity when trying to connect to dfx running in docker container. When running on external server I have no issue. Running from dfx ping from docker, host, external server doesn't help (tested with installed dfx 0.26.1 and 0.28.0 on client).

I tried the following:

  1. Run dfx inside docker (0.26.1, 0.27.0, 0.28.0)
ENV DFX_VERSION=0.28.0
RUN DFXVM_INIT_YES=true sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
ENV PATH="$HOME/.local/share/dfx/bin:$PATH"
RUN dfxvm install ${DFX_VERSION}
ENTRYPOINT ["sh", "-c", "dfx start --host 0.0.0.0:4943"]

There are also nvm and python pocket installation scripts like in icp-dev-env container. I use also version with script and SIGTERM to gracefully stop dfx on docker stop, but both options fail only for 0.28.0

  1. Ping outside docker using:
dfx ping 172.17.0.1:4943

Ping inside container, which runs dfx works ok. Ping to localhost:4943, 127.0.0.1:4943 works.

I expected to see this happen:

{
  "replica_health_status": "healthy",
  "root_key": [...]
}

Instead, this happened:

Error: Failed while waiting for agent status.
Caused by: The replica returned an HTTP Error: Http Error: status 400 Bad Request, content type "text/plain; charset=utf-8", content: error: unknown_domain
details:
The requested domain is not served by this HTTP gateway.

Specifying --domain 172.17.0.1 on dfx start works for version 0.28.0, but doesn't work when container is on another server e.g. 192.168.0.12 and sends dfx ping http://192.168.0.12:4943.

Meta

dfx --version:

0.26.1 -> ok
0.27.0 -> ok
0.28.0 -> not ok
Further log output

Container:

Using the default configuration for the local shared network.
No local network replica found. Nothing to do.
info: dfx 0.28.0 is already installed
Running dfx start for version 0.28.0
Using the default configuration for the local shared network.
Replica API running on 0.0.0.0:4943. You must open a new terminal to continue developing. If you'd prefer to stop, quit with 'Ctrl-C'.

Client:

Error: Failed while waiting for agent status.
Caused by: The replica returned an HTTP Error: Http Error: status 400 Bad Request, content type "text/plain; charset=utf-8", content: error: unknown_domain
details:
The requested domain is not served by this HTTP gateway.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using dfx start on 0.28.0 in Docker and dfx ping from the host or another server, then inspect the dfx start and dfx ping entry points and compare them with 0.27.0. No source file or test is named; done means cross-container and remote pings return the expected healthy response without an unknown_domain error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, rust
Domain
cli, devops, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.