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 2021/06/04 02:13:37 UTC

[GitHub] [apisix] GoneGo1ng opened a new issue #4375: request help: ‘v1/healthcheck’ returns an empty json

GoneGo1ng opened a new issue #4375:
URL: https://github.com/apache/apisix/issues/4375


   ### Issue description
   
   The healthcheck is configured upstream and is already up and running, but calling the 'v1/healthcheck' interface does not return the expected result, instead returning an empty json.
   One more question, I only created an upstream. Why does 'apisix/admin/upstreams' return a count of 2?
   
   ```
   This is the service log, indicating that the health check is running normally.
   
   ...
   [GIN] 2021/06/04 - 10:01:34 | 200 |            0s |     172.16.4.41 |GET      "/ping"
   [GIN] 2021/06/04 - 10:01:39 | 200 |            0s |     172.16.4.41 |GET      "/ping"
   [GIN] 2021/06/04 - 10:01:49 | 200 |            0s |     172.16.4.41 |GET      "/ping"
   [GIN] 2021/06/04 - 10:01:54 | 200 |            0s |     172.16.4.41 |GET      "/ping"
   [GIN] 2021/06/04 - 10:01:59 | 200 |            0s |     172.16.4.41 |GET      "/ping"
   [GIN] 2021/06/04 - 10:02:09 | 200 |            0s |     172.16.4.41 |GET      "/ping"
   ...
   ```
   
   ```
   curl "http://172.16.4.41:9090/v1/healthcheck"
   
   {}
   ```
   
   ```
   curl "http://172.16.4.41:9080/apisix/admin/upstreams" -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
   
   {
       "count": "2",
       "action": "get",
       "node": {
           "dir": true,
           "nodes": [
               {
                   "value": {
                       "name": "httpbin-upstream",
                       "scheme": "http",
                       "type": "roundrobin",
                       "pass_host": "pass",
                       "hash_on": "vars",
                       "id": "357655931518976703",
                       "update_time": 1622719457,
                       "nodes": [
                           {
                               "weight": 1,
                               "port": 7777,
                               "host": "172.16.65.34",
                               "priority": 0
                           },
                           {
                               "weight": 1,
                               "port": 7778,
                               "host": "172.16.65.34",
                               "priority": 0
                           }
                       ],
                       "timeout": {
                           "connect": 6,
                           "read": 6,
                           "send": 6
                       },
                       "checks": {
                           "active": {
                               "concurrency": 10,
                               "http_path": "\/ping",
                               "https_verify_certificate": true,
                               "timeout": 5,
                               "healthy": {
                                   "interval": 5,
                                   "successes": 1,
                                   "http_statuses": [
                                       200,
                                       201
                                   ]
                               },
                               "unhealthy": {
                                   "http_statuses": [
                                       400,
                                       404,
                                       500
                                   ],
                                   "http_failures": 2,
                                   "tcp_failures": 2,
                                   "timeouts": 3,
                                   "interval": 5
                               },
                               "type": "http"
                           }
                       },
                       "create_time": 1622709147
                   },
                   "key": "\/apisix\/upstreams\/357655931518976703",
                   "modifiedIndex": 228,
                   "createdIndex": 18
               }
           ],
           "key": "\/apisix\/upstreams"
       }
   }
   ```
   
   ```
   ```
   
   ### Environment
   
   Request help without environment information will be ignored or closed.
   
   * apisix version (cmd: `apisix version`): 2.5
   
   * OS (cmd: `uname -a`): Linux 74e6fc1aaa26 3.10.0-1127.13.1.el7.x86_64 #1 SMP Tue Jun 23 15:46:38 UTC 2020 x86_64 Linux
   * OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`): openresty/1.19.3.1
   * etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API): 3.4.0
   * apisix-dashboard version, if have: 2.6
   * luarocks version, if the issue is about installation (cmd: `luarocks --version`): 3.5.0
   


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

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



[GitHub] [apisix] spacewander commented on issue #4375: request help: ‘v1/healthcheck’ returns an empty json

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


   What is the output of `etcdctl get --prefix /apisix/upstreams`?


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

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



[GitHub] [apisix] GoneGo1ng commented on issue #4375: request help: ‘v1/healthcheck’ returns an empty json

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


   > etcdctl get --prefix /apisix/upstreams
   
   ```
   /apisix/upstreams/
   init_dir
   /apisix/upstreams/357655931518976703
   {
       "name": "httpbin-upstream",
       "scheme": "http",
       "type": "roundrobin",
       "pass_host": "pass",
       "hash_on": "vars",
       "id": "357655931518976703",
       "nodes": [
           {
               "weight": 1,
               "port": 7777,
               "host": "172.16.65.34",
               "priority": 0
           },
           {
               "weight": 1,
               "port": 7778,
               "host": "172.16.65.34",
               "priority": 0
           }
       ],
       "update_time": 1622719457,
       "timeout": {
           "connect": 6,
           "send": 6,
           "read": 6
       },
       "checks": {
           "active": {
               "concurrency": 10,
               "http_path": "\/ping",
               "https_verify_certificate": true,
               "timeout": 5,
               "healthy": {
                   "successes": 1,
                   "http_statuses": [
                       200,
                       201
                   ],
                   "interval": 5
               },
               "type": "http",
               "unhealthy": {
                   "http_statuses": [
                       400,
                       404,
                       500
                   ],
                   "http_failures": 2,
                   "tcp_failures": 2,
                   "timeouts": 3,
                   "interval": 5
               }
           }
       },
       "create_time": 1622709147
   }
   ```


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

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



[GitHub] [apisix] spacewander commented on issue #4375: request help: ‘v1/healthcheck’ returns an empty json

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


   > The healthcheck is configured upstream and is already up and running, but calling the 'v1/healthcheck' interface does not return the expected result, instead returning an empty json.
   
   I can't reproduce it. The only way to get an empty JSON at my side is when the upstream is not hit.
   
   Maybe you can add more log to see what happened at https://github.com/apache/apisix/blob/405f69b3f9359b9200d595388d6dd6e3e6eb8248/apisix/control/v1.lua#L115


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

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



[GitHub] [apisix] GoneGo1ng commented on issue #4375: request help: ‘v1/healthcheck’ returns an empty json

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


   After I redeployed it, it works now.


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

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



[GitHub] [apisix] GoneGo1ng commented on issue #4375: request help: ‘v1/healthcheck’ returns an empty json

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


   > etcdctl get --prefix /apisix/upstreams
   
   ```
   /apisix/upstreams/
   init_dir
   /apisix/upstreams/357655931518976703
   {
       "name": "httpbin-upstream",
       "scheme": "http",
       "type": "roundrobin",
       "pass_host": "pass",
       "hash_on": "vars",
       "id": "357655931518976703",
       "nodes": [
           {
               "weight": 1,
               "port": 7777,
               "host": "172.16.65.34",
               "priority": 0
           },
           {
               "weight": 1,
               "port": 7778,
               "host": "172.16.65.34",
               "priority": 0
           }
       ],
       "update_time": 1622719457,
       "timeout": {
           "connect": 6,
           "send": 6,
           "read": 6
       },
       "checks": {
           "active": {
               "concurrency": 10,
               "http_path": "\/ping",
               "https_verify_certificate": true,
               "timeout": 5,
               "healthy": {
                   "successes": 1,
                   "http_statuses": [
                       200,
                       201
                   ],
                   "interval": 5
               },
               "type": "http",
               "unhealthy": {
                   "http_statuses": [
                       400,
                       404,
                       500
                   ],
                   "http_failures": 2,
                   "tcp_failures": 2,
                   "timeouts": 3,
                   "interval": 5
               }
           }
       },
       "create_time": 1622709147
   }
   ```


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

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



[GitHub] [apisix] GoneGo1ng closed issue #4375: request help: ‘v1/healthcheck’ returns an empty json

Posted by GitBox <gi...@apache.org>.
GoneGo1ng closed issue #4375:
URL: https://github.com/apache/apisix/issues/4375


   


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

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



[GitHub] [apisix] GoneGo1ng commented on issue #4375: request help: ‘v1/healthcheck’ returns an empty json

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


   @spacewander thx, i will try it.


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

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



[GitHub] [apisix] spacewander commented on issue #4375: request help: ‘v1/healthcheck’ returns an empty json

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


   What is the output of `etcdctl get --prefix /apisix/upstreams`?


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

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