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

Nacos service registry cannot work because of ServerTags matching failure #711

Closed
jthann opened this issue Jul 22, 2022 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@jthann
Copy link
Collaborator

jthann commented Jul 22, 2022

Describe the bug
After upgrading Easegress from v1.x to v2.0.0, Nacos service registry(maybe including others service registry) cannot work. Because in following method from pkg/filters/proxy/pool.go:309.

The Tags attribute in ServiceInstanceSpec object and ServerTags in ServerPoolSpec object are always nil, this will lead to servers is always empty and proxy filter return 503 status code.

func (sp *ServerPool) useService(instances map[string]*serviceregistry.ServiceInstanceSpec) {
	servers := make([]*Server, 0)
	for _, instance := range instances {
		for _, tag := range sp.spec.ServerTags {
			if stringtool.StrInSlice(tag, instance.Tags) {
				servers = append(servers, &Server{
					URL:    instance.URL(),
					Tags:   instance.Tags,
					Weight: instance.Weight,
				})
				break
			}
		}
	}
   //......
}
@localvar localvar self-assigned this Jul 25, 2022
@localvar localvar added the bug Something isn't working label Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants