confluentinc / confluent-kubernetes-examples

Example scenario workflows for Confluent for Kubernetes
Apache License 2.0
42 stars 175 forks source link

Exception while loading Zookeeper JAAS #65

Closed rajeshbala01 closed 2 years ago

rajeshbala01 commented 3 years ago

While following the step mentioned in production-secure-deploy to enable authentication to zookeeper via digest i am getting below error.

creds-zookeeper-sasl-digest-users.json

{ "kafka": "kafka-secret" }

creds-kafka-zookeeper-credentials.txt

username="kafka" password="kafka-secret"

[ERROR] 2021-08-30 07:48:56,286 [main] kafka.server.KafkaServer error - Fatal error during KafkaServer startup. Prepare to shutdown org.apache.kafka.common.KafkaException: Exception while loading Zookeeper JAAS login context [java.security.auth.login.config=/mnt/secrets/digest-jaas.conf, zookeeper.sasl.client=default:true, zookeeper.sasl.clientconfig=default:Client]

ptyagii commented 3 years ago

Did you create the secrets as mentioned in the link: https://github.com/confluentinc/confluent-kubernetes-examples/tree/master/security/production-secure-deploy#provide-authentication-credentials Please also check if there is any line break in the creds-kafka-zookeeper-credentials.txt and creds-zookeeper-sasl-digest-users.json files.

MosheBlumbergX commented 2 years ago

stale issue , closing.

cma224 commented 1 year ago

@MosheBlumbergX @ptyagii @rajeshbala01 I happened across this same problem today. It seems to be because the example files shown above are using the CRLF line ending. Switching them to LF line ending fixed it for me.

MosheBlumbergX commented 1 year ago
    If file reports "CRLF line terminators", the file is DOS-style
    If file reports "CR line terminators", the file is Mac-style
    If file doesn't mention line terminators, the file is Unix-style
./connect-mds-client.txt: ASCII text
./ca-key.pem: PEM RSA private key
- , ASCII text
./ksqldb-mds-client.txt: ASCII text
./creds-client-kafka-sasl-user.txt: ASCII text
./confluent-platform-production.yaml: ASCII text
./creds-control-center-users.txt: CSV text
- , ASCII text
./c3-mds-client.txt: ASCII text
./bearer.txt: ASCII text
./kafkaRestClass.yaml: ASCII text
./topic.yaml: ASCII text
./krp-mds-client.txt: ASCII text
./controlcenter-testadmin-rolebindings.yaml: ASCII text
./confluent-platform-production-mtls.yaml: ASCII text
./ca.pem: PEM certificate
- , ASCII text
./sr-mds-client.txt: ASCII text
./creds-kafka-sasl-users.json: JSON data
- , ASCII text
./ldap.txt: ASCII text
./creds-zookeeper-sasl-digest-users.json: JSON data
- , ASCII text
./README.rst: ASCII text
./creds-kafka-zookeeper-credentials.txt: ASCII text
./confluent-platform-production-autogeneratedcerts.yaml: ASCII text

I think it depends on the editor you use.