Skip to content

Uninitialized string offset 0[41] in /data/wwwroot/guanwang/vendor/longlang/phpkafka/src/Protocol/Type/UVarInt.php #93

@crazyfd

Description

@crazyfd
  • 你遇到了什么问题?
image

队列投递会出现 Uninitialized string offset 0[41] in /data/wwwroot/guanwang/vendor/longlang/phpkafka/src/Protocol/Type/UVarInt.php 错误

  • Kafka 环境是自建还是云服务?

自建kafka

  • 请执行下面的命令获取环境信息。

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

root@hua13:/data/wwwroot/guanwang$ php -v & php --ri swoole & composer info | grep longlang/phpkafka
[1] 3534078
[2] 3534079
PHP 8.2.6 (cli) (built: Aug 25 2023 22:00:13) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.6, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.6, Copyright (c), by Zend Technologies

swoole

Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 5.0.3
Built => Sep  3 2023 14:35:44
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 3.0.2 15 Mar 2022
dtls => enabled
http2 => enabled
json => enabled
curl-native => enabled
pcre => enabled
zlib => 1.2.11
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => enabled
async_redis => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608
longlang/phpkafka                 v1.2.3   A kafka client. Support php-fpm and Swoole.
[1]-  Done                    php -v
[2]+  Done                    php --ri swoole

  • 提供最小可复现代码:
$this->producer->push($topic,serialize(new Job([
      'request' => $request,
      'platform_code' => $platformCode,
])), $key);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions