Baoyuantop commented on issue #11134:
URL: https://github.com/apache/apisix/issues/11134#issuecomment-2914721174

   > > [@jzhao20230918](https://github.com/jzhao20230918) I haven't gotten the 
time to check this bug but the yaml configuration you shared isn't indented at 
all. Please fix it.
   > 
   > I found the roor cause.
   > 
   > Line 525 is introduced in 3.9.0. 
https://github.com/apache/apisix/blob/release/3.9.1/apisix/discovery/consul/init.lua#L525
 :
   > 
   > ```
   >                 local svc_address, svc_port = node.Service.Address, 
node.Service.Port
   >                 -- if nodes is nil, new nodes table and set to up_services
   >                 if not nodes then
   >                     nodes = core.table.new(1, 0)
   >                     up_services[service_name] = nodes
   >                 end
   >                 -- not store duplicate service IDs.
   >                 local service_id = svc_address .. ":" .. svc_port
   > ```
   > 
   > I had a service registed with consul without port provided and that causes 
svc_port to be nil. And then the whole service discovery by consul function was 
down. After I registed the service correctly everthing works as before.
   
   After verifying locally that not providing a port when registering a service 
does cause this problem.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to