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

bug: discovery not effect because of additional properties rewrite to etcd #79

Closed
Monstergogo opened this issue Nov 7, 2023 · 5 comments

Comments

@Monstergogo
Copy link

  1. add a new upstream in apisix dashboard as follow before start apisix-seed, config preview like this:
    { "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "grpc", "discovery_type": "nacos", "pass_host": "pass", "name": "apisix-seed", "service_name": "share.ShareService", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } }
  2. start apisix-seed with nacos as discovery, apisix-seed will rewrite nodes to etcd, and i get upstream config like this:
    { "_discovery_type": "nacos", "_service_name": "share.ShareService", "create_time": 1699364548, "id": "486262354254758591", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 }, "name": "apisix-seed", "nodes": [ { "host": "10.66.36.202", "port": 5018, "weight": 10 } ], "pass_host": "pass", "scheme": "grpc", "timeout": { "connect": 6, "read": 6, "send": 6 }, "type": "roundrobin", "update_time": 1699364548 }

it added field “_discovery_type” and "_service_name" which caused apisix err:
[error] 51#51: *251621 [lua] config_etcd.lua:843: failed to fetch data from etcd: failed to check item data of [/apisix/upstreams] err:additional properties forbidden, found _discovery_type, etcd key: /apisix/upstreams, context: ngx.timer

apisix version: 3.6.0

@Monstergogo
Copy link
Author

i read the code and find delete filed DiscoveryType and ServiceName directly can fix it. just delete one line code in internal/core/message/a6conf.go: line 106

image

@monkeyDluffy6017
Copy link
Contributor

Would you like to fix this?

@Monstergogo
Copy link
Author

Would you like to fix this?

pull request created

@Monstergogo
Copy link
Author

Would you like to fix this?

lol, I encountered other issues when fixing this issue. it's fine when work with apisix version: 3.5.0 and below, upstream in apisix 3.6.0 not allowed additional properties like _discovery_type, but it's necessary to save properties like _discovery_type: need to know discovery type when apisix-seed restart.

@monkeyDluffy6017
Copy link
Contributor

@Monstergogo If you think the _discovery_type is necessary, you could post a pr to add it in apisix

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