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

[Bug] SkyWalking agent failed to start if using kafka protocol with sasl_mechanism=PLAIN. #12131

Open
3 tasks done
tsonglew opened this issue Apr 18, 2024 · 1 comment
Open
3 tasks done
Assignees
Labels
bug Something isn't working and you are sure it's a bug! python Python agent related

Comments

@tsonglew
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

Apache SkyWalking Component

Python Agent (apache/skywalking-python)

What happened

SkyWalking agent failed to start if using kafka protocol with sasl_mechanism=PLAIN.

What you expected to happen

SkyWalking agent starts successfully when using kafka protocol with sasl_mechanism=PLAIN.

How to reproduce

run a gunicorn app with a command like

SW_AGENT_PROTOCOL=kafka \
SW_KAFKA_BOOTSTRAP_SERVERS=localhost:9092 \
SW_KAFKA_REPORTER_CONFIG_security_protocol=SASL_PLAINTEXT  \
SW_KAFKA_REPORTER_CONFIG_sasl_mechanism=PLAIN  \
SW_KAFKA_REPORTER_CONFIG_sasl_plain_username=************ \
SW_KAFKA_REPORTER_CONFIG_sasl_plain_password=************  \
SW_AGENT_NAME=demo::gunicorn \
sw-python -d run -p gunicorn main:app

Anything else

The agent failed to start with AttributeError: 'SkyWalkingAgent' object has no attribute '_SkyWalkingAgent__log_queue'

Using kafka protocol with sasl_mechanism=PLAIN leads to "log.warning('%s: Sending username and password in the clear', self)".
https://github.com/dpkp/kafka-python/blob/a6d0579d3cadd3826dd364b01bc12a2173139abc/kafka/conn.py#L624

the logging module was replaced by sw_logging, but __log_queue was not initialized yet

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@tsonglew tsonglew added the bug Something isn't working and you are sure it's a bug! label Apr 18, 2024
@tsonglew tsonglew changed the title [Bug] [Bug] SkyWalking agent failed to start if using kafka protocol with sasl_mechanism=PLAIN. Apr 18, 2024
@wu-sheng wu-sheng added the python Python agent related label Apr 18, 2024
@wu-sheng
Copy link
Member

Please send a pull request when you are ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working and you are sure it's a bug! python Python agent related
Projects
None yet
Development

No branches or pull requests

2 participants