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

[bitnami/cassandra] Installing Cassandra to Kubernetes via Helm chart seems not authenticating #29607

Closed
grecinto opened this issue Sep 26, 2024 · 7 comments
Assignees
Labels
cassandra solved stale 15 days without activity tech-issues The user has a technical issue about an application

Comments

@grecinto
Copy link

grecinto commented Sep 26, 2024

Name and Version

Bitnami/cassandra

What architecture are you using?

amd64

What steps will reproduce the bug?

Running this cmd: helm install my-release oci://registry-1.docker.io/bitnamicharts/cassandra --set dbUser.password=password
will install cassandra in Kubernetes with 1 node and another one(dependency).
Following instructions to login(using cqlsh) via the generated notes of helm chart, I am unable to login.
The password "password" and using the default username "cassandra" is not being taken in, I'm getting authentication failure due to wrong username and/or password as the msg.

I tried to connect using cqlsh using three different possible ways to get thru the running cassandra node in K8. Again, following the instructions generated in Helm as how I can get in. Plus, logging in to the K8 node running Cassandra, using its local cqlsh.

All fails with same authentication bad credential err msg.

Are you using any custom parameters or values?

yep, the --set dbUser.password= is done so I can give it some experimental pwd.

What is the expected behavior?

Be able to login using cqlsh providing the username(-u) and password(-p).

What do you see instead?

Authentication failed due to bad credentials(wrong username and/or password).

Additional information

No response

@grecinto grecinto added the tech-issues The user has a technical issue about an application label Sep 26, 2024
@github-actions github-actions bot added the triage Triage is needed label Sep 26, 2024
@grecinto grecinto changed the title Installing to Kubernetes via Helm chart seems not authenticating Installing Cassandra to Kubernetes via Helm chart seems not authenticating Sep 26, 2024
@javsalgar javsalgar changed the title Installing Cassandra to Kubernetes via Helm chart seems not authenticating [bitnami/cassandra] Installing Cassandra to Kubernetes via Helm chart seems not authenticating Sep 26, 2024
@javsalgar
Copy link
Contributor

Hi!

Could you confirm that you do not have leftover PVCs from previous installations?
Just to ensure the issue happens in a fresh installation

@grecinto
Copy link
Author

Yes, this is in a fresh installation.

@github-actions github-actions bot removed the triage Triage is needed label Sep 27, 2024
@github-actions github-actions bot assigned migruiz4 and unassigned javsalgar Sep 27, 2024
@migruiz4
Copy link
Member

migruiz4 commented Oct 1, 2024

Hi @grecinto,

I'm sorry but I haven't been able to reproduce this error. Here are the exact steps I used and the output I got:

$ helm install my-release oci://registry-1.docker.io/bitnamicharts/cassandra --set dbUser.password=password
...

# Wait until pod is in Ready status
$ k get pods                           
NAME                     READY   STATUS    RESTARTS   AGE
my-release-cassandra-0   1/1     Running   0          46m

# Export password env var (this command returns 'password')
$ export CASSANDRA_PASSWORD=$(kubectl get secret --namespace "default" my-release-cassandra -o jsonpath="{.data.cassandra-password}" | base64 -d)

# Start CLI pod as described in chart notes
$ kubectl run --namespace default my-release-cassandra-client --rm --tty -i --restart='Never' \
   --env CASSANDRA_PASSWORD=$CASSANDRA_PASSWORD \
    \
   --image docker.io/bitnami/cassandra:5.0.1-debian-12-r0 -- bash

# Inside the CLI pod, start cqlsh
I have no name!@my-release-cassandra-client:/$ cqlsh -u cassandra -p $CASSANDRA_PASSWORD my-release-cassandra

Warning: Using a password on the command line interface can be insecure.
Recommendation: use the credentials file to securely provide the password.

Connected to cassandra at my-release-cassandra:9042
[cqlsh 6.2.0 | Cassandra 5.0.1 | CQL spec 3.4.7 | Native protocol v5]
Use HELP for help.
cassandra@cqlsh> 
...

# Tested a bad password on purpose
I have no name!@my-release-cassandra-client:/$ cqlsh -u cassandra -p wrong-pass my-release-cassandra

Warning: Using a password on the command line interface can be insecure.
Recommendation: use the credentials file to securely provide the password.

Connection error: ('Unable to connect to any servers', {'10.96.72.165:9042': AuthenticationFailed('Failed to authenticate to 10.96.72.165:9042: Error from server: code=0100 [Bad credentials] message="Provided username cassandra and/or password are incorrect"')})
...

Could you please share both the logs the Cassandra pod and the error obtained when executing cqlsh?

@grecinto
Copy link
Author

grecinto commented Oct 2, 2024

Hi @migruiz4,

Thanks for looking at it! :)
I am using latest Kubernetes running in latest (updated 2 weeks ago) Docker Desktop in my MacOS. So, the cmdline tools and the env are running in MacOS.

** I followed your instructions to install to K8s the C* bitnami via Helm chart, step by step. Below is from the point the CLI pod is created. (I made sure the env has CASSANDRA_PASSWORD variable set to "password")

I got the same bad credentials error, here is the cmdline where I got the error:

grecinto$ kubectl run --namespace default my-cassandra-release-client --rm --tty -i --restart='Never'    --env CASSANDRA_PASSWORD=$CASSANDRA_PASSWORD        --image docker.io/bitnami/cassandra:5.0.1-debian-12-r0 -- bash
If you don't see a command prompt, try pressing enter.
I have no name!@my-cassandra-release-client:/$ cqlsh -u cassandra -p $CASSANDRA_PASSWORD my-cassandra-release

Warning: Using a password on the command line interface can be insecure.
Recommendation: use the credentials file to securely provide the password.

Connection error: ('Unable to connect to any servers', {'10.97.238.228:9042': AuthenticationFailed('Failed to authenticate to 10.97.238.228:9042: Error from server: code=0100 [Bad credentials] message="Provided username cassandra and/or password are incorrect"')})

Here is logs from the K8s Cassandra Container:

2024-10-02 16:22:54 cassandra 23:22:54.61 INFO  ==> Welcome to the Bitnami cassandra container
2024-10-02 16:22:54 cassandra 23:22:54.61 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
2024-10-02 16:22:54 cassandra 23:22:54.61 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
2024-10-02 16:22:54 cassandra 23:22:54.62 INFO  ==> Upgrade to Tanzu Application Catalog for production environments to access custom-configured and pre-packaged software components. Gain enhanced features, including Software Bill of Materials (SBOM), CVE scan result reports, and VEX documents. To learn more, visit https://bitnami.com/enterprise
2024-10-02 16:22:54 cassandra 23:22:54.62 INFO  ==> 
2024-10-02 16:22:54 cassandra 23:22:54.62 INFO  ==> ** Delaying Cassandra start by 10 seconds **
2024-10-02 16:23:04 I have no name!@my-cassandra-release-client:/$ 
I have no name!@my-cassandra-release-client:/$ cqlsh -u cassandra -p $CASSANDRA_PASSWORD my-cassandra-release
2024-10-02 16:23:47 
2024-10-02 16:23:47 Warning: Using a password on the command line interface can be insecure.
2024-10-02 16:23:47 Recommendation: use the credentials file to securely provide the password.
2024-10-02 16:23:47 
2024-10-02 16:23:47 Connection error: ('Unable to connect to any servers', {'10.97.238.228:9042': AuthenticationFailed('Failed to authenticate to 10.97.238.228:9042: Error from server: code=0100 [Bad credentials] message="Provided username cassandra and/or password are incorrect"')})
2024-10-02 16:23:51 I have no name!@my-cassandra-release-client:/$ 

@migruiz4
Copy link
Member

migruiz4 commented Oct 9, 2024

Hi @grecinto,

I'm sorry but since I can not reproduce the issue there is not much I can do to help. I still suspect that the issue may be related to previously existing data, which could cause the password not to match what is set in the values.

I would appreciate it if you could share the full sequence of commands for your fresh installation, where we can troubleshoot the following:

  • Output of helm list to see what is installed in the namespace.
  • Output of kubectl get pvc in the namespace before installing the chart.
  • If the chart release name is reused, make sure to run helm uninstall and kubectl delete pvc <affected_pvc_name>
  • The exact helm install command used.
  • Check all pods are in 'Ready' status
  • When running the cqlsh inside the client pod, also share an attempt using the inline password instead of the env variable.

Copy link

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label Oct 25, 2024
Copy link

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

@bitnami-bot bitnami-bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cassandra solved stale 15 days without activity tech-issues The user has a technical issue about an application
Projects
None yet
Development

No branches or pull requests

4 participants