Skip to content

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

Closed

Description

@wendigo

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

Activity

  1. kiview commented on Oct 1, 2024

    @kiview
    Member

    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.

  2. wendigo commented on Oct 1, 2024

    @wendigo
    Author

    @kiview datastax/dse-server:6.8.47

  3. maximevw commented on Oct 8, 2024

    @maximevw
    Contributor

    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.

  4. kiview commented on Oct 11, 2024

    @kiview
    Member

    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.

  5. wendigo commented on Oct 11, 2024

    @wendigo
    Author

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

  6. wendigo commented on Oct 11, 2024

    @wendigo
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions