apache / apisix

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

request help: config_etcd.lua:262: sync_data(): failed to check item data of [/apisix/routes] err:additional properties forbidden, found status #4464

Closed Qizhd closed 3 years ago

Qizhd commented 3 years ago

Issue description

021/06/22 15:46:00 [warn] 18588#18588: *5 [lua] plugin.lua:158: load(): new plugins: {"http-logger":true,"limit-conn":true,"echo":true,"fault-injection":true,"request-id":true,"proxy-mirror":true,"sls-logger":true,"ip-restriction":true,"limit-count":true,"cors":true,"zipkin":true,"basic-auth":true,"request-validation":true,"proxy-rewrite":true,"syslog":true,"limit-req":true,"redirect":true,"jwt-auth":true,"tcp-logger":true,"batch-requests":true,"node-status":true,"kafka-logger":true,"serverless-pre-function":true,"udp-logger":true,"api-breaker":true,"response-rewrite":true,"referer-restriction":true,"hmac-auth":true,"uri-blocker":true,"openid-connect":true,"wolf-rbac":true,"key-auth":true,"consumer-restriction":true,"grpc-transcode":true,"authz-keycloak":true,"prometheus":true,"proxy-cache":true,"serverless-post-function":true}, context: init_worker_by_lua*
2021/06/22 15:46:00 [warn] 18588#18588: *5 [lua] plugin.lua:206: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2021/06/22 15:46:01 [error] 18588#18588: *7 [lua] config_etcd.lua:262: sync_data(): failed to check item data of [/apisix/routes] err:additional properties forbidden, found status ,val: {"uri":"\/get","status":1,"name":"a","id":"1","priority":0,"create_time":1623841480,"upstream_id":"1","host":"httpbin.org","update_time":1623898712}, context: ngx.timer
2021/06/22 15:46:01 [error] 18588#18588: *11 [lua] config_etcd.lua:262: sync_data(): failed to check item data of [/apisix/global_rules] err:additional properties forbidden, found create_time ,val: {"create_time":1623831677,"id":"1","plugins":{"error-log-logger":{"disable":false}},"update_time":1623831677}, context: ngx.timer
2021/06/22 15:46:01 [error] 18588#18588: *21 [lua] config_etcd.lua:262: sync_data(): failed to check item data of [/apisix/upstreams] err:additional properties forbidden, found scheme ,val: {"type":"roundrobin","id":"1","pass_host":"pass","hash_on":"vars","create_time":1623835774,"nodes":{"httpbin.org:80":1},"scheme":"http","update_time":1623835774}, context: ngx.timer
2021/06/22 15:46:03 [error] 18583#18583: *55 lua entry thread aborted: runtime error: /c4_working/apisix-2.1/apisix/init.lua:796: attempt to index upvalue 'router' (a nil value)
stack traceback:
coroutine 0:
        /c4_working/apisix-2.1/apisix/init.lua: in function 'http_admin'
        content_by_lua(nginx.conf:158):2: in main chunk, client: 127.0.0.1, server: , request: "PUT /apisix/admin/upstreams/1 HTTP/1.1", host: "127.0.0.1:9080"
2021/06/22 15:50:38 [error] 18583#18583: *3696 lua entry thread aborted: runtime error: /c4_working/apisix-2.1/apisix/init.lua:796: attempt to index upvalue 'router' (a nil value)
stack traceback:
coroutine 0:
        /c4_working/apisix-2.1/apisix/init.lua: in function 'http_admin'
        content_by_lua(nginx.conf:158):2: in main chunk, client: 127.0.0.1, server: , request: "GET /apisix/admin/upstreams/1 HTTP/1.1", host: "127.0.0.1:9080"
2021/06/22 15:51:36 [error] 18584#18584: *4452 lua entry thread aborted: runtime error: /c4_working/apisix-2.1/apisix/init.lua:796: attempt to index upvalue 'router' (a nil value)
stack traceback:
coroutine 0:
        /c4_working/apisix-2.1/apisix/init.lua: in function 'http_admin'
        content_by_lua(nginx.conf:158):2: in main chunk, client: 127.0.0.1, server: , request: "GET /apisix/admin/upstreams/1 HTTP/1.1", host: "127.0.0.1:9080"
2021/06/22 15:56:59 [error] 18585#18585: *8731 lua entry thread aborted: runtime error: /c4_working/apisix-2.1/apisix/init.lua:796: attempt to index upvalue 'router' (a nil value)
stack traceback:
coroutine 0:
        /c4_working/apisix-2.1/apisix/init.lua: in function 'http_admin'
        content_by_lua(nginx.conf:158):2: in main chunk, client: 127.0.0.1, server: , request: "GET /apisix/admin/upstreams HTTP/1.1", host: "127.0.0.1:9080"

Environment

Request help without environment information will be ignored or closed.

Qizhd commented 3 years ago

All apisix requests return Server internal error 500

Qizhd commented 3 years ago
[root@qizhendong-dev1 apisix-2.1]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:2379          0.0.0.0:*               LISTEN      29639/etcd
tcp        0      0 127.0.0.1:2380          0.0.0.0:*               LISTEN      29639/etcd
tcp        0      0 127.0.0.1:46581         0.0.0.0:*               LISTEN      8517/node
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2156/sshd
tcp        0      0 0.0.0.0:9080            0.0.0.0:*               LISTEN      5510/nginx: master
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1935/master
tcp6       0      0 :::22                   :::*                    LISTEN      2156/sshd
tcp6       0      0 :::9080                 :::*                    LISTEN      5510/nginx: master
tcp6       0      0 ::1:25                  :::*                    LISTEN      1935/master
[root@qizhendong-dev1 apisix-2.1]# etcdctl version
etcdctl version: 3.4.13
API version: 3.4
spacewander commented 3 years ago

The status field is added in v2.2. BTW, I see you are using OpenResty 1.19, note that only APISIX >= 2.2 supports OpenResty 1.19.

Qizhd commented 3 years ago

The status field is added in v2.2. BTW, I see you are using OpenResty 1.19, note that only APISIX >= 2.2 supports OpenResty 1.19.

So, in v2.1 which openresty version was suggested ?

spacewander commented 3 years ago

My suggestion is to upgrade APISIX version to 2.2 at least.