geomesa / accumulo-uno

A containerized Accumulo instance for unit tests, based on fluo-uno
Apache License 2.0
0 stars 0 forks source link

java.net.UnknownHostException during basic test execution #1

Open Florian9M opened 1 month ago

Florian9M commented 1 month ago

Environment

Issue

An exception occurs when launching a basic test with the following message: java.net.UnknownHostException: fae11ce07818

Description

I'm encountering this hostname resolution error, which seems to block the test execution. Does anyone have any insights on the possible cause or suggestions for resolving this issue?

Below you can find the related code and stack trace: Code and Stacktrace

elahrvivaz commented 4 weeks ago

It seems like your local machine is not able to resolve the hostname of the docker container. When I pause the test and exec into the running container, hostname -f matches my local machine, so it tries to connect to my local machine, which then through the exposed port connects to the Accumulo instance. This seems to be the same behavior on github actions, FWIW. If that isn't the case on your setup, then you will probably need to configure your system so that accumulo.local resolves to localhost/127.0.0.1, then add to the container in your test code: .withEnv("UNO_HOST", "accumulo.local")

You might also try upgrading to version 1.4.1, and adding slf4j-simple as a dependency so that logging works, which might provide more details.

Florian9M commented 4 weeks ago

Thanks for the reply, I'll look into it

elahrvivaz commented 4 weeks ago

Actually instead of using accumulo.local, you might be able to do .withEnv("UNO_HOST", System.getenv("HOSTNAME")) - I'm not entirely sure that won't cause weird conflicts though. It also might depend on if your docker daemon is running as root or was installed rootless.