New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: CosmosDBEmulatorContainer 'EOFException: SSL peer shut down incorrectly' when building keystore #8324
Comments
Hi, you can override the configuration waitingFor(Wait.forHttps("/_explorer/emulator.pem").forStatusCode(200).allowInsecure());
withStartupTimeout(Duration.ofMinutes(3)); Looks like there has been some changes in the image provided and it has affected the default strategy. Those changes have not been applied because the image is pretty unstable in GHA. See Azure/azure-cosmos-db-emulator-docker#45 |
Thanks @eddumelendez. The workaround you provided indeed works. |
Since the workaround solved the immediate issue, I am going to close, given that we are still waiting for the image to stabilize in upstream. |
I'd suggest adding those details to the documentation |
@eddumelendez Hi, the workaround works for me. But I prefer a more flexible way to configure the wait strategy, because it has to wait for 3 minutes every time on CI build. I've been searching for some other signs that the Cosmos emulator has fully started, but no luck. Could you please give some advice about the wait strategy? Thanks in advance! |
I've observed that CosmosDB Emulator starting long for real (almost two minutes on my local machine). In general it looks unreal to make it responsible earlier than its web-context became available. So, no chance to make it faster. The question is to CosmosDB here rather than to testcontainers. |
@OleksandrShkurat Yeah, it's the same as my local machine. From here we can see it indeed has the strategy on testcontainers side, like get the exposed port or the log marked that the cosmos emulator has already been started. But although the container has been started, the web service is still unavailable. And I've been using the docker env variable with "AZURE_COSMOS_EMULATOR_PARTITION_COUNT" to restrict the number of partitions to be started, in order to make it faster. However, I still couldn't find an accurate signal indicating that the web service is available. |
@eddumelendez Sorry, the wait strategy here worked. The specific startup time is 106 seconds on my local, and the timeout setting has not been reached
|
Module
Azure
Testcontainers version
1.18.3
Using the latest Testcontainers version?
Yes
Host OS
Windows
Host Arch
x86
Docker version
Client: Cloud integration: v1.0.35+desktop.5 Version: 24.0.7 API version: 1.43 Go version: go1.20.10 Git commit: afdd53b Built: Thu Oct 26 09:08:44 2023 OS/Arch: windows/amd64 Context: default Server: Docker Desktop 4.26.1 (131620) Engine: Version: 24.0.7 API version: 1.43 (minimum version 1.12) Go version: go1.20.10 Git commit: 311b9ff Built: Thu Oct 26 09:08:02 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.25 GitCommit: d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f runc: Version: 1.1.10 GitCommit: v1.1.10-0-g18a0cb0 docker-init: Version: 0.19.0 GitCommit: de40ad0
What happened?
I'm trying to use the
CosmosDBEmulatorContainer
as described in https://java.testcontainers.org/modules/azure/.However when I call the
buildNewKeyStore()
method of the startedCosmosDBEmulatorContainer
, the call fails during SSL handshake:java.io.EOFException: SSL peer shut down incorrectly
Relevant log output
Additional Information
Tested with testcontainers versions
1.18.3
and1.19.5
.Tested with
mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest
andmcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:mongodb
images.Example project illustrating the issue:
testcontainers-cosmosdb-em-ssl-handshake.zip
The text was updated successfully, but these errors were encountered: