zkx5xkt opened a new issue, #11959:
URL: https://github.com/apache/apisix/issues/11959

   ### Current Behavior
   
   When Consul discovery is enabled, an error occurs during service 
synchronization from Consul (`attempt to concatenate local 'svc_port' (a nil 
value)`) if not all services in Consul contain the port field.
   
   
   The error happens 
[here](https://github.com/apache/apisix/blob/346722f815efb0453aa9858067dfd858d96fab43/apisix/discovery/consul/init.lua#L525)
   
   ### Expected Behavior
   
   In Consul, the only mandatory field when registering a service is `name`. 
Therefore, services that cannot be added to the APISIX discovery should be 
skipped.
   
   ### Error Logs
   
   ```
   2025/02/10 03:57:40 [error] 32#32: *54 lua entry thread aborted: runtime 
error: /usr/local/apisix/apisix/discovery/consul/init.lua:525: attempt to 
concatenate local 'svc_port' (a nil value)
   ```
   
   ### Steps to Reproduce
   
   1. run consul, register service only with name provided 
   2. enable `consul` discovery in apisix
   3. run apisix via docker image
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.11.0
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
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