apache / skywalking

APM, Application Performance Monitoring System
https://skywalking.apache.org/
Apache License 2.0
23.86k stars 6.52k forks source link

[Bug] php skywalking_agent No provider for SASL mechanism SCRAM-SHA-256: #12409

Closed zhangwangfly closed 4 months ago

zhangwangfly commented 4 months ago

Search before asking

Apache SkyWalking Component

PHP (apache/skywalking-php)

What happened

When configuring your PHP project to use the skywalking_agent with php.ini to send data to Kafka, and especially when setting up SASL authentication, you've encountered an issue related to the SASL mechanism. Here's a breakdown of your situation in English:

1.SASL Mechanism Set to PLAIN: When the sasl.mechanism is set to PLAIN, the overall process works without any issues.

2.SASL Mechanism Set to SCRAM-SHA-256: When changing the sasl.mechanism to SCRAM-SHA-256, an error is reported: ERROR skywalking_agent::worker: worker exit unexpectedly err=Client creation error: No provider for SASL mechanism SCRAM-SHA-256: recompile librdkafka with libsasl2 or openssl support. Current build options: PLAIN

Despite recompiling librdkafka and confirming the presence of sasl_scram support through the example tool, the skywalking_agent in your PHP project continues to throw an error indicating that there's no provider for the SCRAM-SHA-256 SASL mechanism.

Reference address: https://skywalking.apache.org/docs/skywalking-php/next/en/reporter/kafka-reporter/

What you expected to happen

Whether the existing php skywalking_agent plugin supports the SCRAM-SHA-256 authentication method is a questio

How to reproduce

1.dockerfile fix php skywalking_agent

FROM 192.168.183.222:8001/library/nginx-php-supervisor:v3 ADD c7-devtoolset-7-x86_64.repo /etc/yum.repos.d ADD hosts /tmp RUN rm -rf /opt/remi/php74/root/usr/include/php/Zend/zend_operators.h ADD zend_operators.h /opt/remi/php74/root/usr/include/php/Zend RUN yum install gcc make cargo clang protobuf-compiler -y \ && yum install llvm-toolset-7 -y ENV PATH=/opt/rh/llvm-toolset-7/root/usr/bin:$PATH ENV LD_LIBRARY_PATH=/opt/rh/llvm-toolset-7/root/usr/lib64:$LD_LIBRARY_PATH COPY librdkafka-1.8.2.zip /root RUN unzip /root/librdkafka-1.8.2.zip -d /root WORKDIR /root/librdkafka-1.8.2 RUN ./configure --enable-sasl --enable-ssl \ && make && make install \ && echo "/usr/local/lib" >> /etc/ld.so.conf \ && ldconfig ADD protobuf-all-3.6.1.tar.gz /root WORKDIR /root/protobuf-3.6.1 RUN source /etc/profile \ && ./autogen.sh \ && ./configure --prefix=/usr/local/protobuf \ && make && make install \ && mv /usr/bin/protoc /usr/bin/protoc.bk \ && cp /usr/local/protobuf/bin/protoc /usr/bin \ && cat /tmp/hosts >> /etc/hosts \ && yes | /opt/remi/php74/root/usr/bin/pecl install skywalking_agent

2.php.ini

[skywalking] extension=skywalking_agent.so skywalking_agent.enable=On skywalking_agent.log_file=/tmp/skywalking_agent.log skywalking_agent.log_level=DEBUG skywalking_agent.reporter_type=kafka skywalking_agent.kafka_bootstrap_servers=192.168.183.141:9091 skywalking_agent.kafka_producer_config='{"client.id": "skywalking-dmt-admin","security.protocol":"SASL_PLAINTEXT","sasl.mechanism":"SCRAM-SHA-256","sasl.username":"admin","sasl.password":"admin"}'

Anything else

No response

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

Code of Conduct

wu-sheng commented 4 months ago

@jmjoy Is this supported scenario?

jmjoy commented 4 months ago

We will add sasl support for kafka later.

zhangwangfly commented 4 months ago

We will add sasl support for kafka later.

@jmjoy Excuse me, when will the next version come out?

jmjoy commented 4 months ago

@jmjoy Excuse me, when will the next version come out?

If necessary, a new version can be released with this feature.

wu-sheng commented 4 months ago

Feature is added.