You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/12/22 15:30:09 UTC

[GitHub] [apisix] caibirdme opened a new issue, #8554: bug: discovery/dns cause panic

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

   ### Current Behavior
   
   1. config dns dicovery in config.yaml:
   ```yaml
   discovery:
     dns:
       servers:
         - 9.166.239.254:53  # k8s coredns svc
   ```
   2. config tcp proxy:
   ```yaml
       stream_routes:
         - server_port: 10000
           upstream:
             service_name: app-service.namespace:8081
             scheme: tcp
             discovery_type: dns
             type: roundrobin
   ```
   3. send request to xxx:10000
   4. apisix aborted with log:
   ```
   2022-12-22T15:07:02.512209987Z 2022/12/22 23:07:02 [error] 56#56: *91098 lua entry thread aborted: runtime error: /usr/local/apisix/apisix/discovery/dns/init.lua:32: attempt to index upvalue 'dns_client' (a nil value)
   2022-12-22T15:07:02.512250920Z stack traceback:
   2022-12-22T15:07:02.512256678Z coroutine 0:
   2022-12-22T15:07:02.512259872Z 	/usr/local/apisix/apisix/discovery/dns/init.lua: in function 'nodes'
   2022-12-22T15:07:02.512263539Z 	/usr/local/apisix/apisix/upstream.lua:259: in function 'set_upstream'
   2022-12-22T15:07:02.512266986Z 	/usr/local/apisix/apisix/init.lua:959: in function 'stream_preread_phase'
   2022-12-22T15:07:02.512270259Z 	preread_by_lua(nginx.conf:90):2: in main chunk while prereading client data, client: 9.166.233.109, server: 0.0.0.0:10000
   ```
   
   ### Expected Behavior
   
   proxy request to desired k8s service
   
   ### Error Logs
   
   2022-12-22T15:07:02.512209987Z 2022/12/22 23:07:02 [error] 56#56: *91098 lua entry thread aborted: runtime error: /usr/local/apisix/apisix/discovery/dns/init.lua:32: attempt to index upvalue 'dns_client' (a nil value)
   2022-12-22T15:07:02.512250920Z stack traceback:
   2022-12-22T15:07:02.512256678Z coroutine 0:
   2022-12-22T15:07:02.512259872Z 	/usr/local/apisix/apisix/discovery/dns/init.lua: in function 'nodes'
   2022-12-22T15:07:02.512263539Z 	/usr/local/apisix/apisix/upstream.lua:259: in function 'set_upstream'
   2022-12-22T15:07:02.512266986Z 	/usr/local/apisix/apisix/init.lua:959: in function 'stream_preread_phase'
   2022-12-22T15:07:02.512270259Z 	preread_by_lua(nginx.conf:90):2: in main chunk while prereading client data, client: 9.166.233.109, server: 0.0.0.0:10000
   
   ### Steps to Reproduce
   
   as current behavior described
   
   ### Environment
   
   - APISIX version (run `apisix version`): 2.15.1 (using helm chart v0.11.4)
   - Operating system (run `uname -a`): centos7
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`): no etcd, yaml
   - APISIX Dashboard version, if relevant: no
   - 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: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] ronething commented on issue #8554: bug: discovery/dns cause panic

Posted by GitBox <gi...@apache.org>.
ronething commented on issue #8554:
URL: https://github.com/apache/apisix/issues/8554#issuecomment-1367373212

   because of dns service discovery didn't support in the stream subsystem yet, so it will cause error like below.
   
   ```
   2022-12-22T15:07:02.512209987Z 2022/12/22 23:07:02 [error] 56#56: *91098 lua entry thread aborted: runtime error: /usr/local/apisix/apisix/discovery/dns/init.lua:32: attempt to index upvalue 'dns_client' (a nil value)
   ```


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] ronething commented on issue #8554: bug: discovery/dns cause panic

Posted by GitBox <gi...@apache.org>.
ronething commented on issue #8554:
URL: https://github.com/apache/apisix/issues/8554#issuecomment-1379700098

   @caibirdme Hi, as PR https://github.com/apache/apisix/pull/8593 is merged, you can pull master branch in your development environment and try dns service discovery in the stream subsystem.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] moonming closed issue #8554: bug: discovery/dns cause panic

Posted by "moonming (via GitHub)" <gi...@apache.org>.
moonming closed issue #8554: bug: discovery/dns cause panic
URL: https://github.com/apache/apisix/issues/8554


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] caibirdme commented on issue #8554: bug: discovery/dns cause panic

Posted by "caibirdme (via GitHub)" <gi...@apache.org>.
caibirdme commented on issue #8554:
URL: https://github.com/apache/apisix/issues/8554#issuecomment-1454624714

   @ronething Thx, is this feature included in any releases?


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] ronething commented on issue #8554: bug: discovery/dns cause panic

Posted by "ronething (via GitHub)" <gi...@apache.org>.
ronething commented on issue #8554:
URL: https://github.com/apache/apisix/issues/8554#issuecomment-1454789101

   > @ronething Thx, is this feature included in any releases?
   
   maybe in version 3.2.0 https://github.com/apache/apisix/pull/8988


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] caibirdme commented on issue #8554: bug: discovery/dns cause panic

Posted by GitBox <gi...@apache.org>.
caibirdme commented on issue #8554:
URL: https://github.com/apache/apisix/issues/8554#issuecomment-1362990820

   When I use nodes directly rather than dns service_name, it works as expected. So I think this might be a bug of discovery/dns
   ```yaml
       stream_routes:
         - server_port: 10000
           upstream:
             nodes:
               "1.2.3.4:8081": 1
             type: roundrobin
   ```
   
   And the dns server is healthy, I can use nslookup to check:
   ```
   nslookup qwe-trpc.test 9.166.239.254:53
   
   Server:         9.166.239.254
   Address:        9.166.239.254#53
   
   Name:   qwe-trpc.test.svc.cluster.local
   Address: 9.166.239.70
   ```


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] moonming commented on issue #8554: bug: discovery/dns cause panic

Posted by "moonming (via GitHub)" <gi...@apache.org>.
moonming commented on issue #8554:
URL: https://github.com/apache/apisix/issues/8554#issuecomment-1650923827

   fixed by https://github.com/apache/apisix/pull/8593


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org