bug: event worker failed: failed to receive the header , attempt to index upvalue 'ev' (a nil value)

オープン
#12,769 コメント 9 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
lua, nginx

調査の方向性

まず worker.lua の 266 行目付近と resty/events/compat/init.lua の 47 行目付近を読み、次に event worker がどのように通信し、閉じられた接続を処理するかを追ってください。可能であれば本番環境の障害を再現または切り分けてください。報告された runtime と event-worker のエラーログが発生しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

question
Current Behavior

Seeing below error in our production apisix data-plane logs

2025/11/23 10:46:52 [error] 54#54: *643711487 stream [lua] worker.lua:266: communicate(): event worker failed: failed to receive the header bytes: closed, context: ngx.timer 2025/11/23 10:46:52 [error] 116#116: *643711540 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/resty/events/compat/init.lua:47: attempt to index upvalue 'ev' (a nil value) 2025/11/23 10:46:52 [error] 52#52: *643711538 stream [lua] worker.lua:266: communicate(): event worker failed: failed to receive the header bytes: closed, context: ngx.timer

Expected Behavior

These error logs should not be there.

Error Logs

2025/11/23 10:46:52 [error] 54#54: *643711487 stream [lua] worker.lua:266: communicate(): event worker failed: failed to receive the header bytes: closed, context: ngx.timer 2025/11/23 10:46:52 [error] 116#116: *643711540 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/resty/events/compat/init.lua:47: attempt to index upvalue 'ev' (a nil value) 2025/11/23 10:46:52 [error] 52#52: *643711538 stream [lua] worker.lua:266: communicate(): event worker failed: failed to receive the header bytes: closed, context: ngx.timer

Steps to Reproduce

Dont know. Happening in production deployment.

Environment
  • APISIX version (run apisix version):3.14.1

  • Operating system (run uname -a):Linux data-plane-7c4b955754-dp552 5.10.230-223.885.amzn2.x86_64 https://github.com/apache/apisix/pull/1 SMP Tue Dec 3 14:36:00 UTC 2024 x86_64 GNU/Linux

  • OpenResty / Nginx version (run openresty -V or nginx -V):nginx version: openresty/1.27.1.2 (x86_64-pc-linux-gnu)
    built by gcc 15.2.0 (Wolfi 15.2.0-r3)
    built with OpenSSL 3.6.0 1 Oct 2025
    TLS SNI support enabled

主要言語
Lua
スター
17.3k
フォーク
3k
平均マージ
4日 14時間
マージ済み PR(30日)
73

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/apisix のほかの issue

apache/apisix の issue をすべて見る

似ている issue

Lua の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。