gurock / testrail-docker

Official repo for TestRail docker support.
Apache License 2.0
53 stars 35 forks source link

Docker: Could not connect to the specified Cassandra keyspace. #42

Open KeepBotting opened 1 year ago

KeepBotting commented 1 year ago

I am running Docker 20.10.12 on Ubuntu 22.04.1 LTS

Steps to reproduce:

  1. git clone https://github.com/gurock/testrail-docker
  2. cd testrail-docker && ./quickstart.sh
  3. Fill out the options. I chose: Enter, c, l, Password123, Password123
  4. Note the information read out, everything looks good
  5. Go to the web UI, agree to the license and follow the installer
  6. Fill out MySQL settings, this works fine
  7. Fill out Cassandra settings:

image

image

The installer mentions creating a new empty keyspace but it's not obvious how to do this for Docker.

Thank you!

eocern commented 1 year ago

I hit the same issue. After some investigation I found I had to do the following since the Cassandra DB did not have the needed keyspace and I also had to change the "authenticator" part in the cassandra.yml within the container.

Once the Cassandra container is up I got into it

docker exec -it cassandra /bin/bash
cd /opt/cassandra/conf 
sed -i 's/authenticator: AllowAllAuthenticator/authenticator: PasswordAuthenticator/g' cassandra.yaml

Then restart the cassandra container, get in and execute (note I created "testrail" keyspace and that's what I used in the installation wizard)

cqlsh -u cassandra -p cassandra
CREATE KEYSPACE IF NOT EXISTS testrail WITH REPLICATION={'class': 'SimpleStrategy', 'replication_factor': 1};

After that the Installation Wizard was able to do its job. What helped me debug the issue was:

dkuznetsov21 commented 1 year ago

@eocern it's not working for me ((

image
eocern commented 1 year ago

Hey @dkuznetsov21 the full path to the config file is /opt/cassandra/conf/cassandra.yaml

dkuznetsov21 commented 1 year ago

@eocern thank you now all work fine

pa23118 commented 1 year ago

Hi @eocern I am still getting same error Could you please help me on this docker exec -it container /bin/bash cd /opt/cassandra/conf sed -i 's/authenticator: AllowAllAuthenticator/authenticator: PasswordAuthenticator/g' /opt/cassandra/conf/cassandra.yaml when I run cqlsh -u cassandra -p cassandra I got error Connection error:

Griefed commented 1 year ago

I hit the same issue. After some investigation I found I had to do the following since the Cassandra DB did not have the needed keyspace and I also had to change the "authenticator" part in the cassandra.yml within the container.

Once the Cassandra container is up I got into it

docker exec -it cassandra /bin/bash
cd /opt/cassandra/conf 
sed -i 's/authenticator: AllowAllAuthenticator/authenticator: PasswordAuthenticator/g' cassandra.yaml

Then restart the cassandra container, get in and execute (note I created "testrail" keyspace and that's what I used in the installation wizard)

cqlsh -u cassandra -p cassandra
CREATE KEYSPACE IF NOT EXISTS testrail WITH REPLICATION={'class': 'SimpleStrategy', 'replication_factor': 1};

After that the Installation Wizard was able to do its job. What helped me debug the issue was:

* checking cassandra container log file.

* learning some cqlsh commands to check what exist and what not inside the Cassandra DB https://cassandra.apache.org/doc/latest/cassandra/tools/cqlsh.html
  HTH

Worked like a charm. Thank you very much.

SjamonDaal commented 1 year ago

@eocern Thanks! This helped me a lot and solved my issue!

dnesterov commented 12 months ago

Hello, Perhaps anyone knows how to solve this issue? This is the last step of the wizard, and I'm out of ideas what can be wrong as I do have cassandra-lucene-index-plugin-3.11.0.0.jar in /usr/share/cassandra/lib. I also tried jar suggested on Test Rail installation manual (cassandra-lucene-index-plugin-3.11.3.0.jar), but having the same issue.

image

Thank you in advance!