Hi, I'm following the instructions in the <DataHub...
# getting-started
l
Hi, I'm following the instructions in the DataHub Developer's Guide. But when running
.gradlew build
command, it fails on running
metadata-io:test
with
Copy code
java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
ENV:
Copy code
OS: macos
arch: aarch64(M1)
java: 
openjdk version "1.8.0_345"
OpenJDK Runtime Environment (Zulu 8.64.0.19-CA-macos-aarch64) (build 1.8.0_345-b01)
OpenJDK 64-Bit Server VM (Zulu 8.64.0.19-CA-macos-aarch64) (build 25.345-b01, mixed mode)
docker:
Docker version 20.10.17, build 100c701
The full log looks like:
Copy code
> Task :metadata-io:test

Gradle Test Executor 35 STANDARD_ERROR
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See <http://www.slf4j.org/codes.html#StaticLoggerBinder> for further details.

Gradle suite > Gradle test > com.linkedin.metadata.graph.dgraph.DgraphGraphServiceTest > setup FAILED
    java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
        at org.testcontainers.dockerclient.DockerClientProviderStrategy.lambda$getFirstValidStrategy$7(DockerClientProviderStrategy.java:215)
        at java.util.Optional.orElseThrow(Optional.java:290)
        at org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrategy.java:207)
        at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:136)
        at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:178)
        at org.testcontainers.LazyDockerClient.getDockerClient(LazyDockerClient.java:14)
        at org.testcontainers.LazyDockerClient.infoCmd(LazyDockerClient.java:12)
        at com.linkedin.metadata.DockerTestUtils.checkContainerEngine(DockerTestUtils.java:10)
        at com.linkedin.metadata.graph.dgraph.DgraphGraphServiceTest.setup(DgraphGraphServiceTest.java:62)

Gradle suite > Gradle test > com.linkedin.metadata.systemmetadata.ElasticSearchSystemMetadataServiceTest > setup FAILED
    org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=<http://docker.elastic.co/elasticsearch/elasticsearch:7.9.3|docker.elastic.co/elasticsearch/elasticsearch:7.9.3>, imagePullPolicy=DefaultPullPolicy())
        at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1286)
        at org.testcontainers.containers.GenericContainer.logger(GenericContainer.java:615)
        at org.testcontainers.elasticsearch.ElasticsearchContainer.<init>(ElasticsearchContainer.java:73)
        at com.linkedin.metadata.ElasticTestUtils.getNewElasticsearchContainer(ElasticTestUtils.java:31)
        at com.linkedin.metadata.systemmetadata.ElasticSearchSystemMetadataServiceTest.setup(ElasticSearchSystemMetadataServiceTest.java:37)

        Caused by:
        java.lang.IllegalStateException: Previous attempts to find a Docker environment failed. Will not retry. Please see logs and check configuration
            at org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrategy.java:109)
            at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:136)
            at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:178)
            at org.testcontainers.LazyDockerClient.getDockerClient(LazyDockerClient.java:14)
        Caused by:

            at org.testcontainers.LazyDockerClient.listImagesCmd(LazyDockerClient.java:12)
            at org.testcontainers.images.LocalImagesCache.maybeInitCache(LocalImagesCache.java:68)
            at org.testcontainers.images.LocalImagesCache.get(LocalImagesCache.java:32)
            at org.testcontainers.images.AbstractImagePullPolicy.shouldPull(AbstractImagePullPolicy.java:18)
            at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:66)
            at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:27)
            at org.testcontainers.utility.LazyFuture.getResolvedValue(LazyFuture.java:17)
            at org.testcontainers.utility.LazyFuture.get(LazyFuture.java:39)
            at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1284)
            ... 4 more
I think this is related to the test container is not compatible with M1 chip after some googling, but I could not find a solution. Could someone help me with this issue? Much appreciated!
d
on m1 I recommend to run without tests ->
./gradlew build -x test -x yarnTest
e
Hi there! See if one of the recommendations below helps you answer your question.
l
Hi @lemon-cat-72045! Gentle reminder to please keep our Slack Guidelines in mind and post large blocks of code/stack trace in threads; it’s a MASSIVE help for us to keep track of which questions are still unaddressed across our various support channels! teamwork
l
@little-megabyte-1074 got it, I will add codes and stack trace into the thread next time, thanks for the reminder.