apache / apisix

The Cloud-Native API Gateway
https://apisix.apache.org/blog/
Apache License 2.0
14.57k stars 2.52k forks source link

bug(prometheus): "No value passed for etcd_modify_indexes" #2020

Closed membphis closed 4 years ago

membphis commented 4 years ago

[lua] prometheus.lua:732: log_error(): No value passed for etcd_modify_indexes

+ prove t/plugin/prometheus.t
t/plugin/prometheus.t .. 7/?
#   Failed test 'TEST 4: fetch the prometheus metric data - pattern "[error]" should not match any line in error.log but matches line "2020/08/07 06:19:40 [error] 27936#0: *154 [lua] prometheus.lua:732: log_error(): No value passed for etcd_modify_indexes, client: 127.0.0.1, server: localhost, request: \"GET /apisix/prometheus/metrics HTTP/1.1\", host: \"localhost\"" (req 0)
# '
#   at /usr/local/share/perl/5.30.0/Test/Nginx/Socket.pm line 1280.
t/plugin/prometheus.t .. 26/?
#   Failed test 'TEST 7: fetch the prometheus metric data - pattern "[error]" should not match any line in error.log but matches line "2020/08/07 06:19:43 [error] 28088#0: *317 [lua] prometheus.lua:732: log_error(): No value passed for etcd_modify_indexes, client: 127.0.0.1, server: localhost, request: \"GET /apisix/prometheus/metrics HTTP/1.1\", host: \"localhost\"" (req 0)
# '
#   at /usr/local/share/perl/5.30.0/Test/Nginx/Socket.pm line 1280.
membphis commented 4 years ago

it works fine if we call make init first, we can close this issue.

ETCDCTL_API=2 etcdctl rm -r /apisix
make init

prove t/plugin/prometheus.t
t/plugin/prometheus.t .. ok
All tests successful.