You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/09/07 06:49:15 UTC
[GitHub] [apisix] zhikaichen123 opened a new issue #5002: 启动服务报 /opt/apisix/apigw/apisix/core/etcd.lua:107: attempt to index field 'header' (a nil value)
zhikaichen123 opened a new issue #5002:
URL: https://github.com/apache/apisix/issues/5002
### Issue description
**之前运行一直好好的**,什么也没有修改,今天启动服务突然报以下异常:
nginx: [error] init_by_lua error: /opt/apisix/apigw/apisix/core/etcd.lua:107: attempt to index field 'header' (a nil value)
stack traceback:
/opt/apisix/apigw/apisix/core/etcd.lua:107: in function 'get_format'
/opt/apisix/apigw/apisix/core/config_etcd.lua:105: in function 'readdir'
/opt/apisix/apigw/apisix/core/config_etcd.lua:768: in function 'init'
/opt/apisix/apigw/apisix/init.lua:780: in function 'stream_init'
### Environment
- apisix version 2.6
- centos 7
- etcd version,etcd-v3.4.14
http://xxx.225:2379 is healthy: successfully committed proposal: took = 1.48177ms
http://xxx.224:2379 is healthy: successfully committed proposal: took = 1.948448ms
http://xxx.223:2379 is healthy: successfully committed proposal: took = 1.443258ms
http://xxx.223:2379, 9f202aef652eaf4c, 3.4.14, 1.3 GB, false, false, 68, 588962, 588962,
http://xxx.224:2379, 7c4b76c13f57bf3e, 3.4.14, 1.3 GB, true, false, 68, 588962, 588962,
http://xxx.225:2379, 36a2ef6803b09f04, 3.4.14, 1.3 GB, false, false, 68, 588962, 588962,
### Steps to reproduce
./bin/apisix start
### Actual result
nginx: [error] init_by_lua error: /opt/apisix/apigw/apisix/core/etcd.lua:107: attempt to index field 'header' (a nil value)
stack traceback:
/opt/apisix/apigw/apisix/core/etcd.lua:107: in function 'get_format'
/opt/apisix/apigw/apisix/core/config_etcd.lua:105: in function 'readdir'
/opt/apisix/apigw/apisix/core/config_etcd.lua:768: in function 'init'
/opt/apisix/apigw/apisix/init.lua:780: in function 'stream_init'
### Error log
观察etcd日记
Sep 7 14:35:02 iZwz9gg2vum4c5deysz802Z etcd: read-only range request "key:\"\\000\" range_end:\"\\000\" " with result "range_response_count:2364 size:4200281" took too long (101.489916ms) to execute
Sep 7 14:35:02 iZwz9gg2vum4c5deysz802Z etcd: read-only range request "key:\"\\000\" range_end:\"\\000\" " with result "range_response_count:2364 size:4200281" took too long (103.760414ms) to execute
Sep 7 14:35:02 iZwz9gg2vum4c5deysz802Z etcd: read-only range request "key:\"\\000\" range_end:\"\\000\" " with result "range_response_count:2364 size:4200281" took too long (109.593528ms) to execute
Sep 7 14:35:02 iZwz9gg2vum4c5deysz802Z etcd: read-only range request "key:\"\\000\" range_end:\"\\000\" " with result "range_response_count:2364 size:4200281" took too long (115.305857ms) to execute
Sep 7 14:35:02 iZwz9gg2vum4c5deysz802Z etcd: read-only range request "key:\"\\000\" range_end:\"\\000\" " with result "range_response_count:2364 size:4200281" took too long (118.196808ms) to execute
### Expected result
正常启动服务
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] zhikaichen123 commented on issue #5002: 启动服务报 /opt/apisix/apigw/apisix/core/etcd.lua:107: attempt to index field 'header' (a nil value)
Posted by GitBox <gi...@apache.org>.
zhikaichen123 commented on issue #5002:
URL: https://github.com/apache/apisix/issues/5002#issuecomment-914077902
补充说明:
我在报错的地方打印ectd的响应体,报如下异常:
etcd.lua:110: get_format(): ectd config: {"message":"grpc: received message larger than max (4199998 vs. 4194304)","code":8,"error":"grpc: received message larger than max (4199998 vs. 4194304)"}
关键词:grpc: received message larger than max (4199998 vs. 4194304)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] zhikaichen123 commented on issue #5002: 启动服务报 /opt/apisix/apigw/apisix/core/etcd.lua:107: attempt to index field 'header' (a nil value)
Posted by GitBox <gi...@apache.org>.
zhikaichen123 commented on issue #5002:
URL: https://github.com/apache/apisix/issues/5002#issuecomment-914046664
补充说明:
此时java程序使用ectd服务是正常的,不会有以上问题
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] zhikaichen123 commented on issue #5002: 启动服务报 /opt/apisix/apigw/apisix/core/etcd.lua:107: attempt to index field 'header' (a nil value)
Posted by GitBox <gi...@apache.org>.
zhikaichen123 commented on issue #5002:
URL: https://github.com/apache/apisix/issues/5002#issuecomment-914097418
找到对应的帖子
https://github.com/apache/apisix/issues/3073
https://github.com/etcd-io/etcd/issues/9043
https://www.cnblogs.com/davygeek/p/8951999.html
具体的解决方案:
--max-request-bytes
etcd Raft消息最大字节数,ETCD默认该值为4M; 但是很多业务场景发现同步数据的时候4M完全没法满足要求,
所以提前确定初始值很重要; 由于4M导致我们线上的业务无法写入元数据的问题,
我们紧急升级之后把该值修改为默认40M,但是官方推荐的是40M,大家可以根据业务情况自己调整
#启动命令
/usr/bin/etcd --max-request-bytes '41999980'
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] zhikaichen123 closed issue #5002: 启动服务报 /opt/apisix/apigw/apisix/core/etcd.lua:107: attempt to index field 'header' (a nil value)
Posted by GitBox <gi...@apache.org>.
zhikaichen123 closed issue #5002:
URL: https://github.com/apache/apisix/issues/5002
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org