microscopic-mechanic-13766
07/22/2022, 9:00 AMKAFKA_BOOTSTRAP_SERVER=broker1:9092
KAFKA_SCHEMAREGISTRY_URL=<http://schema-registry:8081>
KAFKA_PROPERTIES_SASL_KERBEROS_SERVICE_NAME=kafka
SPRING_KAFKA_PROPERTIES_SECURITY_PROTOCOL=SASL_PLAINTEXT
KAFKA_PROPERTIES_SASL_JAAS_CONFIG=com.sun.security.auth.module.Krb5LoginModule required principal='datahub/<realm>@<realm>' useKeyTab=true storeKey=true keyTab='/keytab/datahub.keytab'
and they are succesfully wrote as env variables (because when I execute the command env
they appear), the actions service keeps printing the following error:
FAIL|rdkafka#consumer-1| [thrd:broker1:9092/bootstrap]: broker1:9092/bootstrap: Disconnected: verify that security.protocol is correctly configured, broker might require SASL authentication (after 340ms in state UP, 3 identical error(s) suppressed)
Why is this error printed?? It might be related to the fact that the variables are not read correctly, but I don't understand why it happens only on that specific variable.
I am using v0.8.41 for both the gms and front, for the actions the release 0.0.4 for the acryldata/datahub-actions
image and 0.8.41 version for the CLI.incalculable-ocean-74010
07/23/2022, 7:17 AMmicroscopic-mechanic-13766
07/25/2022, 7:24 AMincalculable-ocean-74010
07/25/2022, 7:55 AMmicroscopic-mechanic-13766
07/25/2022, 7:57 AMacryldata/datahub-actions:v0.0.4
orange-night-91387
07/27/2022, 3:39 PMconnection:
consumer_config:
security.protocol: ${KAFKA_PROPERTIES_SECURITY_PROTOCOL:-PLAINTEXT}
sasl.mechanism: ${KAFKA_PROPERTIES_SASL_MECHANISM:-PLAIN}
sasl.username: ${KAFKA_PROPERTIES_SASL_USERNAME}
sasl.password: ${KAFKA_PROPERTIES_SASL_PASSWORD}
JAAS config is specific to Java and won't work with the Actions pod so you need to set it as sasl.username & sasl.password instead. You should be able to create a yaml file based on the base one with these properties.microscopic-mechanic-13766
07/28/2022, 11:22 AMorange-night-91387
07/28/2022, 3:41 PM# Broker service name
sasl.kerberos.service.name=$SERVICENAME
# Client keytab location
sasl.kerberos.keytab=/etc/security/keytabs/${CLIENT_NAME}.keytab
# sasl.kerberos.principal
sasl.kerberos.principal=${CLIENT_NAME}/${CLIENT_HOST}
Reference: https://github.com/edenhill/librdkafka/wiki/Using-SASL-with-librdkafka#5-configure-kafka-client-on-client-hostmicroscopic-mechanic-13766
07/29/2022, 8:55 AMsasl.username
and sasl.password
from the executor.yaml
but left the other two properties (as if they are not set an error is printed saying that the attribute security.protocol
is not configured).
The thing is that if I set the default value of such attribute to -PLAINTEXT
this error is printed:
Configuration property `sasl.mechanism` set to `PLAIN` but `security.protocol` is not configured for SASL: recommend setting `security.protocol` to SASL_SSL or SASL_PLAINTEXT
But if its value is set to either SASL_SSL
or SASL_PLAINTEXT
I get the following error:
Exception: Failed to instantiate Actions Pipeline using config {'name': 'ingestion_executor', 'source': {'type': 'kafka', 'config': {'connection': {'bootstrap': 'broker1:9092', 'schema_registry_url': '<http://localhost:8081>', 'consumer_config': {'security.protocol': 'SASL_SSL', 'sasl.mechanism': 'PLAIN'}}, 'topic_routes': {'mcl': 'MetadataChangeLog_Versioned_v1', 'pe': 'PlatformEvent_v1'}}}, 'filter': {'event_type': 'MetadataChangeLogEvent_v1', 'event': {'entityType': 'dataHubExecutionRequest', 'changeType': 'UPSERT', 'aspectName': ['dataHubExecutionRequestInput', 'dataHubExecutionRequestSignal'], 'aspect': {'value': {'executorId': 'default'}}}}, 'action': {'type': 'executor', 'config': {'executor_id': 'default'}}, 'datahub': {'server': '<http://datahub-gms:8080>', 'extra_headers': {'Authorization': 'Basic __datahub_system:JohnSnowKnowsNothing'}}}
incalculable-ocean-74010
08/01/2022, 10:55 AMSASL_SSL
?microscopic-mechanic-13766
08/01/2022, 11:08 AMexecutor.yaml
I am using is the following.
# Copyright 2021 Acryl Data, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# <http://www.apache.org/licenses/LICENSE-2.0>
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: "ingestion_executor"
source:
type: "kafka"
config:
connection:
bootstrap: ${KAFKA_BOOTSTRAP_SERVER:-localhost:9092}
schema_registry_url: ${SCHEMA_REGISTRY_URL:-<http://localhost:8081>}
consumer_config:
security.protocol: ${KAFKA_PROPERTIES_SECURTIY_PROTOCOL:-SASL_PLAINTEXT}
sasl.mechanisms: ${KAFKA_PROPERTIES_SASL_MECHANISM:-PLAIN}
topic_routes:
mcl: ${METADATA_CHANGE_LOG_VERSIONED_TOPIC_NAME:-MetadataChangeLog_Versioned_v1}
pe: ${PLATFORM_EVENT_TOPIC_NAME:-PlatformEvent_v1}
filter:
event_type: "MetadataChangeLogEvent_v1"
event:
entityType: "dataHubExecutionRequest"
changeType: "UPSERT"
aspectName:
- "dataHubExecutionRequestInput"
- "dataHubExecutionRequestSignal"
aspect:
value:
executorId: "${EXECUTOR_ID:-default}"
action:
type: "executor"
config:
executor_id: "${EXECUTOR_ID:-default}"
datahub:
server: "http://${DATAHUB_GMS_HOST:-localhost}:${DATAHUB_GMS_PORT:-8080}"
extra_headers:
Authorization: "Basic ${DATAHUB_SYSTEM_CLIENT_ID:-__datahub_system}:${DATAHUB_SYSTEM_CLIENT_SECRET:-JohnSnowKnowsNothing}"
incalculable-ocean-74010
08/01/2022, 11:11 AMKafkaException: KafkaError{code=_INVALID_ARG,val=-186,str="Failed to create consumer: sasl.username and sasl.password must be set"}
microscopic-mechanic-13766
08/01/2022, 11:17 AMKAFKA_PROPERTIES_SASL_KERBEROS_SERVICE_NAME=kafka
KAFKA_PROPERTIES_SASL_KERBEROS_KEYTAB=/etc/security/keytabs/datahubfront.keytab
KAFKA_PROPERTIES_SASL_KERBEROS_PRINCIPAL='datahubfront/<realm>'
incalculable-ocean-74010
08/01/2022, 11:35 AMI tried indicating GSSAPI as the mechanism for SASL
You mean you set this?
sasl.mechanism=GSSAPI
microscopic-mechanic-13766
08/01/2022, 12:02 PMYou just need to use the Python semantics for the properties instead of JAAS. For Kerberos keytabs I think it's:
# Broker service name
sasl.kerberos.service.name=$SERVICENAME
# Client keytab location
sasl.kerberos.keytab=/etc/security/keytabs/${CLIENT_NAME}.keytab
# sasl.kerberos.principal
sasl.kerberos.principal=${CLIENT_NAME}/${CLIENT_HOST}
I used those properties as it can be seen in the previous messageincalculable-ocean-74010
08/01/2022, 1:45 PMsasl.kerberos.service.name=$SERVICENAME
be sasl.kerberos.service.name=${SERVICENAME}
?
Are all these environment variables set in your deployment?orange-night-91387
08/01/2022, 2:30 PMThe last thing I did was to put these variables in the datahub-actions docker-compose but didn't suceeded:These also need to be in the executor yaml
sudo apt-get install libsasl2-modules-gssapi-mit
to our container set up to get this workingmicroscopic-mechanic-13766
08/01/2022, 3:54 PMKafkaException: KafkaError{code=_INVALID_ARG,val=-186,str="Failed to create consumer: sasl.username and sasl.password must be set"}
arisesorange-night-91387
08/01/2022, 4:10 PMmicroscopic-mechanic-13766
08/04/2022, 12:58 PMsasl_<plaintext://broker1:9092/bootstrap>: SASL authentication error: Authentication failed: Invalid username or password (after 148ms in state AUTH_REQ, 1 identical error(s) suppressed)
I don't understand why I get this error. This might be related to obtaining the following error in the Kafka container
WARN unable to return groups for user datahub (org.apache.hadoop.security.ShellBasedUnixGroupsMapping)
PartialGroupNameException The user name 'datahub' is not found. id: 'datahub': no such user
But the user datahub is created in the mentioned container and I still get it.
Any previous experience with this errors?orange-night-91387
08/04/2022, 3:44 PMmicroscopic-mechanic-13766
08/05/2022, 7:27 AMusername="datahub"
password="datahub"
But this definition is for connections between brokers. The real way to define them is like this:
use_datahub="datahub";