hipster-labs / jhipster-daily-builds

:construction_worker: :rocket: Additional builds for generator-jhipster repository
Apache License 2.0
19 stars 25 forks source link

Windows Builds Failing for a While #59

Closed SudharakaP closed 4 years ago

SudharakaP commented 4 years ago

It caught my attention that the windows daily build is failing for ngx-mongodb-kafka-cucumber for a while with the error;

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.412 s <<< FAILURE! - in io.github.jhipster.sample.web.rest.SampleMongoKafkaKafkaResourceIT
[ERROR] io.github.jhipster.sample.web.rest.SampleMongoKafkaKafkaResourceIT  Time elapsed: 6.412 s  <<< ERROR!
org.testcontainers.containers.ContainerLaunchException: Container startup failed
    at io.github.jhipster.sample.web.rest.SampleMongoKafkaKafkaResourceIT.startTestcontainer(SampleMongoKafkaKafkaResourceIT.java:46)
    at io.github.jhipster.sample.web.rest.SampleMongoKafkaKafkaResourceIT.startServer(SampleMongoKafkaKafkaResourceIT.java:37)
Caused by: org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=confluentinc/cp-kafka:5.5.1, imagePullPolicy=DefaultPullPolicy())
    at io.github.jhipster.sample.web.rest.SampleMongoKafkaKafkaResourceIT.startTestcontainer(SampleMongoKafkaKafkaResourceIT.java:46)
    at io.github.jhipster.sample.web.rest.SampleMongoKafkaKafkaResourceIT.startServer(SampleMongoKafkaKafkaResourceIT.java:37)
Caused by: java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
    at io.github.jhipster.sample.web.rest.SampleMongoKafkaKafkaResourceIT.startTestcontainer(SampleMongoKafkaKafkaResourceIT.java:46)
    at io.github.jhipster.sample.web.rest.SampleMongoKafkaKafkaResourceIT.startServer(SampleMongoKafkaKafkaResourceIT.java:37)

[INFO] Running io.github.jhipster.sample.web.rest.UserJWTControllerIT

Sample Build Failure: https://github.com/hipster-labs/jhipster-daily-builds/runs/1111112469?check_suite_focus=true

SudharakaP commented 4 years ago

Maybe I think this is related to https://github.com/jhipster/generator-jhipster/issues/11544#issuecomment-609065206

@bsideup : I see the following stack trace. Wondering if windows isn't supported for this particular option; withNetwork(null). 🤔


2020-09-20 08:51:07.109  WARN 5200 --- [ad | producer-1] org.apache.kafka.clients.NetworkClient   : [Producer clientId=producer-1] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
2020-09-20 08:51:07.109  WARN 5200 --- [ad | producer-1] org.apache.kafka.clients.NetworkClient   : [Producer clientId=producer-1] Bootstrap broker localhost:9092 (id: -1 rack: null) disconnected
2020-09-20 08:51:07.118  WARN 5200 --- [ad | producer-2] org.apache.kafka.clients.NetworkClient   : [Producer clientId=producer-2] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
2020-09-20 08:51:07.119  WARN 5200 --- [ad | producer-2] org.apache.kafka.clients.NetworkClient   : [Producer clientId=producer-2] Bootstrap broker localhost:9092 (id: -1 rack: null) disconnected
2020-09-20 08:51:07.684  INFO 5200 --- [           main] o.t.d.NpipeSocketClientProviderStrategy  : Accessing docker with local Npipe socket (npipe:////./pipe/docker_engine)
2020-09-20 08:51:07.684  INFO 5200 --- [           main] o.t.d.DockerClientProviderStrategy       : Found Docker environment with local Npipe socket (npipe:////./pipe/docker_engine)
2020-09-20 08:51:07.967  WARN 5200 --- [           main] o.t.d.DockerClientProviderStrategy       : windows is currently not supported
2020-09-20 08:51:09.310  WARN 5200 --- [ad | producer-1] org.apache.kafka.clients.NetworkClient   : [Producer clientId=producer-1] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
2020-09-20 08:51:09.311  WARN 5200 --- [ad | producer-1] org.apache.kafka.clients.NetworkClient   : [Producer clientId=producer-1] Bootstrap broker localhost:9092 (id: -1 rack: null) disconnected
2020-09-20 08:51:09.311  WARN 5200 --- [ad | producer-2] org.apache.kafka.clients.NetworkClient   : [Producer clientId=producer-2] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
2020-09-20 08:51:09.311  WARN 5200 --- [ad | producer-2] org.apache.kafka.clients.NetworkClient   : [Producer clientId=producer-2] Bootstrap broker localhost:9092 (id: -1 rack: null) disconnected
2020-09-20 08:51:11.170  WARN 5200 --- [ad | producer-1] org.apache.kafka.clients.NetworkClient   : [Producer clientId=producer-1] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
2020-09-20 08:51:11.171  WARN 5200 --- [ad | producer-1] org.apache.kafka.clients.NetworkClient   : [Producer clientId=producer-1] Bootstrap broker localhost:9092 (id: -1 rack: null) disconnected
2020-09-20 08:51:11.221  WARN 5200 --- [ad | producer-2] org.apache.kafka.clients.NetworkClient   : [Producer clientId=producer-2] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
bsideup commented 4 years ago

No, it is not about the withNetwork option.

You're running the Docker daemon in the Windows Containers mode, hence the error. It must be running in the Linux mode.

SudharakaP commented 4 years ago

@bsideup : I've never worked with docker on windows and trying to understand how to change this option to the linux mode. But on the other hand we didn't change this file or the testcontainer version for sometime and I am trying to understand why it started failing all of a sudden. The second stack trace was present in the successful runs but somehow the exception wasn't thrown. 🤔

Here's the last successful run; https://github.com/hipster-labs/jhipster-daily-builds/runs/926771186?check_suite_focus=true

SudharakaP commented 4 years ago

I think we cannot change this to Linux mode since on GitHub options this is not supported; https://github.community/t/how-to-use-linux-docker-container-on-windows-vm/16926. Also even if we do change, it seems that windows server 2019 is not supported by testcontainers. Therefore I am unsure it will work. So I suggest we remove the Kafka test from this build for now.

Just to be doubly sure, I have opened a new thread asking specifically this scenario of changing to Linux containers (https://github.community/t/github-actions-windows-runtime-linux-container-mode-docker/135874) and after verifying I'll create a PR.

pascalgrimaud commented 4 years ago

So I suggest we remove the Kafka test from this build for now.

Yes, let's do it

SudharakaP commented 4 years ago

@pascalgrimaud : Thanks for the pull request. 👍🏼

SudharakaP commented 4 years ago

Just for the record; it's confirmed on the thread I created in the support; https://github.community/t/github-actions-windows-runtime-linux-container-mode-docker/135874

There's no way currently to run Linux container mode on windows. 😢

pascalgrimaud commented 4 years ago

I'm fine, let's focus on Linux so