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

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

Open
crazyfd opened this issue Sep 19, 2023 · 1 comment

Comments

@crazyfd
Copy link

crazyfd commented Sep 19, 2023

  • 你遇到了什么问题?
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 <[email protected]>
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);
@crazyfd crazyfd changed the title Uninitialized string offset 0[41] in /data/wwwroot/guanwangvendor/longlang/phpkafka/src/Protocol/Type/UVarInt.php Uninitialized string offset 0[41] in /data/wwwroot/guanwang/vendor/longlang/phpkafka/src/Protocol/Type/UVarInt.php Sep 19, 2023
@crayxn
Copy link

crayxn commented Oct 31, 2023

这个问题有人解决了,升级下 longlang/phpkafka 版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants