Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[BUG] KafkaConsumer - The server experienced an unexpected error when processing the request #7568

Open
Labels
bugSomething isn't working
@rodrifarias

Description

@rodrifarias
  • What problem did you encounter?
    When using the longlang/phpkafka library, we intermittently encounter the following error:
    longlang\phpkafka\Exception\KafkaErrorException: [-1] The server experienced an unexpected error when processing the request.

This happens sporadically during regular Kafka consumption, causing interruptions in our consumer application.

The problem only occurs in version 2.3.0 of kafka

  • Is the Kafka environment self-built or cloud service?
    Self-built.

  • Please execute the following command to get environment information.

php -v & php --ri swoole & composer info | grep longlang/phpkafka

PHP 8.3.14 (cli) (built: Nov 21 2024 08:44:42) (NTS)Copyright (c) The PHP GroupZend Engine v4.3.14, Copyright (c) Zend Technologies    with Zend OPcache v8.3.14, Copyright (c), by Zend TechnologiesswooleSwoole => enabledAuthor => Swoole Team <team@swoole.com>Version => 6.0.2Built => Apr 25 2025 10:17:40coroutine => enabled with boost asm contextepoll => enabledeventfd => enabledsignalfd => enabledcpu_affinity => enabledspinlock => enabledrwlock => enabledopenssl => OpenSSL 3.1.8 11 Feb 2025dtls => enabledhttp2 => enabledjson => enabledcurl-native => enabledcurl-version => 8.12.1c-ares => 1.27.0zlib => 1.3.1brotli => E16781312/D16781312mutex_timedlock => enabledpthread_barrier => enabledcoroutine_pgsql => enabledcoroutine_odbc => enabledcoroutine_sqlite => enabledDirective => Local Value => Master Valueswoole.enable_library => On => Onswoole.enable_fiber_mock => Off => Offswoole.enable_preemptive_scheduler => Off => Offswoole.display_errors => On => Onswoole.use_shortname => Off => Offswoole.unixsock_buffer_size => 8388608 => 8388608longlang/phpkafka                              1.2.5   A kafka client. Support php-fpm and Swoole.
  • Provide the smallest reproducible code:
<?phprequire_once__DIR__ .'/vendor/autoload.php';uselonglang\phpkafka\Consumer\Consumer;uselonglang\phpkafka\Consumer\ConsumerConfig;$config =newConsumerConfig();$config->setBroker('localhost:9092');$config->setTopic('topic_name');$config->setGroupId('grupo_id');$config->setGroupInstanceId('group_instance_id');$consumer =newConsumer($config);while (true) {$message =$consumer->consume();if ($message) {// Processing message logic    }}

The solution is to allow sending group_instance_id as null in the GroupManager.php class on lines 99 and 114
swoole/phpkafka#105

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp