Skip to content
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]: New Cassandra container fails to start DSE 6.8.47 #9337

Closed
wendigo opened this issue Oct 1, 2024 · 6 comments
Closed

[Bug]: New Cassandra container fails to start DSE 6.8.47 #9337

wendigo opened this issue Oct 1, 2024 · 6 comments

Comments

@wendigo
Copy link

wendigo commented Oct 1, 2024

Module

Core

Testcontainers version

1.20.2

Using the latest Testcontainers version?

Yes

Host OS

MacOS

Host Arch

ARM

Docker version

latest

What happened?

In the previous, non-deprecated Cassandra container, CassandraDatabaseDelegate was using Cassandra Session to execute statement that determines whether the server is up. New logic is using csqlsh which doesn't work with the DSE distribution anymore. Since the old Cassandra container is deprecated, this is a breaking change.

Relevant log output

2024-10-01T04:54:50.667-0600	ERROR	ducttape-0	org.testcontainers.cassandra.delegate.CassandraDatabaseDelegate	CQL script execution failed with error: 
Connection error: ('Unable to connect to any servers', {'127.0.0.1:9042': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})

Additional Information

No response

@kiview
Copy link
Member

kiview commented Oct 1, 2024

Thanks for raising the issue @wendigo.
Are the publicly available DSE images we can use for testing?

To unblock you, I would recommend to continue using the deprecated CassandraContainer for now.

@wendigo
Copy link
Author

wendigo commented Oct 1, 2024

@kiview datastax/dse-server:6.8.47

@maximevw
Copy link
Contributor

maximevw commented Oct 8, 2024

Hello @wendigo

On my side, I successfully tested it with the dse-server 6.9.2. I didn't test with the version you mentioned, but DSE images normally include cqlsh.

Do you have some specific settings (like env variables) when you start your container?

If you have an init script, you must also specify withWorkingDirectory("/") (because the DSE container starts in the /opt/dse directory and the init script is copied at the root of the container).

Note the error could appear several times in the logs before the server is finally up (it could take until 10 seconds in my tests before the query is finally executed with success). Also, the logs could be improved in the new implementation in order to not log such "expected" errors because it is just checking the server is up.

@kiview kiview added the resolution/waiting-for-info Waiting for more information of the issue author or another 3rd party. label Oct 11, 2024
@kiview
Copy link
Member

kiview commented Oct 11, 2024

I can confirm, the following works for me:

CassandraContainer cassandraContainer = new CassandraContainer(DockerImageName.parse("datastax/dse-server:6.8.47")
                .asCompatibleSubstituteFor("cassandra"))
                .withEnv("DS_LICENSE", "accept")

However, since I am running an x86 image here in my AppleSilicon through emulation, it is slow and you will indeed see the error logged multiple times:

15:03:25.399 ERROR org.testcontainers.cassandra.delegate.CassandraDatabaseDelegate - CQL script execution failed with error: 
Connection error: ('Unable to connect to any servers', {'127.0.0.1:9042': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})

@maximevw I guess changing the log level for these interim logs would help with the experience.

For now, I will close this issue, since I can't reproduce it, but please consider to follow up with more information @wendigo.

@kiview kiview closed this as completed Oct 11, 2024
@kiview kiview added resolution/invalid and removed resolution/waiting-for-info Waiting for more information of the issue author or another 3rd party. labels Oct 11, 2024
@wendigo
Copy link
Author

wendigo commented Oct 11, 2024

That's not what I observe while running in the CI (x86 based).

@wendigo
Copy link
Author

wendigo commented Oct 11, 2024

I'll send you a link to the run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants