shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

Gateway local deployment usage problem(2.4.0)

Open zhentaowang opened this issue 5 years ago • 5 comments

Describe the bug

Pull the latest code from GitHub, compile and start locally, and write a spring cloud demo, Nacos for the registry

When I request the demo API through the gateway, the following error is reported:

{

"code": -109,

"message": "SpringCloud serviceId does not exist or is configured incorrectly!",

"data": null

}

Environment

  • ShenYu version(s): 2.4.0

Steps to reproduce

Expected behavior

But after analysis, I don't know why I didn't find the demo service. I forgot to take the time to help me see when the latest 2.4.0 release will be released

Debug logs

During preliminary troubleshooting, it is found that there is no service in the service list of ribbon load balancer, and the log is as follows:

2021-08-06 15:51:31 [shenyu-netty-kqueue-2] INFO com.netflix.config.ChainedDynamicProperty - Flipping property: demo.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647

2021-08-06 15:51:31 [shenyu-netty-kqueue-2] INFO com.netflix.loadbalancer.BaseLoadBalancer - Client: demo instantiated a LoadBalancer: DynamicServerListLoadBalancer:{NFLoadBalancer:name=demo,current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:null

2021-08-06 15:51:31 [shenyu-netty-kqueue-2] INFO com.netflix.loadbalancer.DynamicServerListLoadBalancer - Using serverListUpdater PollingServerListUpdater

2021-08-06 15:51:31 [shenyu-netty-kqueue-2] INFO com.netflix.loadbalancer.DynamicServerListLoadBalancer - DynamicServerListLoadBalancer for client demo initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=demo,current list of Servers=[],Load balancer stats=Zone stats: {}, Server stats: []}ServerList:com.alibaba.cloud.nacos.ribbon. NacosServerList@aa91946

15:51:46,369 |-INFO in ReconfigureOnChangeTask(born:1628236246363) - Empty watch file list. Disabling

Click to expand
replace this line with your debug logs

zhentaowang avatar Aug 09 '21 06:08 zhentaowang

can you see this : https://shenyu.apache.org/zh/projects/shenyu/spring-cloud-proxy/

Maybe you're missing the dependency~

yu199195 avatar Aug 09 '21 06:08 yu199195

thk, this bug is solved when nacos discovery version chang to 2.1.0.RELEASE, the version 2.2.5.RELEASE can incompatible

zhentaowang avatar Aug 09 '21 08:08 zhentaowang

Other, when the gateway service and business service are not registered under the same namespace of Nacos, the following error will occur: {

"code": -109,

"message": "SpringCloud serviceId does not exist or is configured incorrectly!",

"data": null

}

zhentaowang avatar Aug 09 '21 08:08 zhentaowang

when the gateway service and business service are not registered under the same namespace of Nacos

so you can register the same namespace

yu199195 avatar Aug 09 '21 08:08 yu199195

yes

zhentaowang avatar Aug 09 '21 08:08 zhentaowang