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 2020/11/13 08:12:55 UTC

[GitHub] [apisix] gewei2000 opened a new issue #2739: request help: health check not working

gewei2000 opened a new issue #2739:
URL: https://github.com/apache/apisix/issues/2739


   ### Issue description
   I configured a upstream, 192.168.1.3 is shutdown, but health check  not remove it ,full config:
   
   ```
   {
   	"name": "small_center_upstream",
   	"type": "chash",
   	"hash_on": "header",
   	"key": "remote_addr",
   	"timeout": {
   		"connect": 6000,
   		"send": 6000,
   		"read": 6000
   	},
   	"nodes": [{
   		"host": "192.168.1.2",
   		"port": 8080,
   		"weight": 1
   	}, {
   		"host": "192.168.1.3",
   		"port": 8080,
   		"weight": 1
   	}],
   	"checks": {
   		"active": {
   			"type": "tcp",
   			"healthy": {
   				"interval": 2,
   				"successes": 1
   			},
   			"unhealthy": {
   				"interval": 1,
   				"tcp_failures": 2
   			}
   		}
   	}
   }
   ```
   
   ### Environment
   
   * apisix version (cmd: `apisix version`):2.0
   * OS:centos
   


----------------------------------------------------------------
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] idbeta commented on issue #2739: request help: health check not working

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


   my env( apisix 2.0 + dashboard 2.0) can not reproduce your issue, my route like this:
   ```shell
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/404.html",
       "upstream": {
            "nodes": {
               "192.168.0.2": 1,
               "127.0.0.1:9797": 1
           },
           "type": "roundrobin",
           "retries": 2,
           "checks": {
               "active": {
                   "timeout": 5,
                   "http_path": "/404.html",
                   "healthy": {
                       "interval": 2,
                       "successes": 1
                   },
                   "unhealthy": {
                       "interval": 1,
                       "http_failures": 2
                   },
                   "req_headers": ["User-Agent: curl/7.29.0"]
               }
           }
       }
   }'
   ```
   after I close `127.0.0.1:9797`, APISIX's `error.log` show it only sent tow times traffic to the `127.0.0.1:9797`
   ```
   2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   ```
   Then no more traffic to the `127.0.0.1:9797`.
   But the log has another issue: there are redundant logs, I will report that.


----------------------------------------------------------------
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] idbeta commented on issue #2739: request help: health check not working

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


   @gewei2000 I used your config data and do not reproduce your issue. I want to know if you set the route many time or one time?
   ```
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/route.html",
       "upstream": {
   	    "name":"small_policy_center",
   	    "type":"roundrobin",
   	    "retries":2,
   	    "timeout":{
   	        "connect":6000,
   	        "send":6000,
   	        "read":6000
   	    },
   	    "nodes":[
   	        {
   	            "host":"127.0.0.1",
   	            "port":7001,
   	            "weight":1
   	        },
   	        {
   	            "host":"127.0.0.1",
   	            "port":7002,
   	            "weight":1
   	        }
   	    ],
   	    "checks":{
   	        "active":{
   	            "healthy":{
   	                "interval":2,
   	                "successes":1
   	            },
   	            "http_path":"/",
   	            "timeout":5,
   	            "unhealthy":{
   	                "http_failures":2,
   	                "interval":1
   	            }
   	        }
   	    }
   	}
   
   }'
   ```
   
   
   


----------------------------------------------------------------
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] gewei2000 commented on issue #2739: request help: health check not working

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


   > my env( apisix master + dashboard 2.0) can not reproduce your issue, my route like this:
   > 
   > ```shell
   > curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   > {
   >     "uri": "/404.html",
   >     "upstream": {
   >          "nodes": {
   >             "192.168.0.2": 1,
   >             "127.0.0.1:9797": 1
   >         },
   >         "type": "roundrobin",
   >         "retries": 2,
   >         "checks": {
   >             "active": {
   >                 "timeout": 5,
   >                 "http_path": "/404.html",
   >                 "healthy": {
   >                     "interval": 2,
   >                     "successes": 1
   >                 },
   >                 "unhealthy": {
   >                     "interval": 1,
   >                     "http_failures": 2
   >                 },
   >                 "req_headers": ["User-Agent: curl/7.29.0"]
   >             }
   >         }
   >     }
   > }'
   > ```
   > 
   > after I close `127.0.0.1:9797`, APISIX's `error.log` show it only sent tow times traffic to the `127.0.0.1:9797`
   > 
   > ```
   > 2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > 2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > 2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > 2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > ```
   > 
   > Then no more traffic to the `127.0.0.1:9797`.
   > But the log has another issue: there are redundant logs, I will report that. #2745
   
   let me try


----------------------------------------------------------------
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] membphis edited a comment on issue #2739: request help: health check not working

Posted by GitBox <gi...@apache.org>.
membphis edited a comment on issue #2739:
URL: https://github.com/apache/apisix/issues/2739#issuecomment-728141812


   @gewei2000 do you have fixed this issue? find out the reason?
   
   what is 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] gewei2000 commented on issue #2739: request help: health check not working

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


   > @gewei2000 I used your config data ( as follows ) and do not reproduce your issue. I want to know if you set the route many time or one time?
   > 
   > ```
   > curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   > {
   >     "uri": "/route.html",
   >     "upstream": {
   > 	    "name":"small_policy_center",
   > 	    "type":"roundrobin",
   > 	    "retries":2,
   > 	    "timeout":{
   > 	        "connect":6000,
   > 	        "send":6000,
   > 	        "read":6000
   > 	    },
   > 	    "nodes":[
   > 	        {
   > 	            "host":"127.0.0.1",
   > 	            "port":7001,
   > 	            "weight":1
   > 	        },
   > 	        {
   > 	            "host":"127.0.0.1",
   > 	            "port":7002,
   > 	            "weight":1
   > 	        }
   > 	    ],
   > 	    "checks":{
   > 	        "active":{
   > 	            "healthy":{
   > 	                "interval":2,
   > 	                "successes":1
   > 	            },
   > 	            "http_path":"/",
   > 	            "timeout":5,
   > 	            "unhealthy":{
   > 	                "http_failures":2,
   > 	                "interval":1
   > 	            }
   > 	        }
   > 	    }
   > 	}
   > }'
   > ```
   
   what mean "set the route many time or one time", I only create a route(not any plugin) and a upstream, then the route ref the upstream.


----------------------------------------------------------------
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] membphis commented on issue #2739: request help: health check not working

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


   @gewei2000 do you have fixed this issue? find out the reason?
   
   what is is?


----------------------------------------------------------------
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] gewei2000 commented on issue #2739: request help: health check not working

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


   @membphis @spacewander 


----------------------------------------------------------------
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] gewei2000 edited a comment on issue #2739: request help: health check not working

Posted by GitBox <gi...@apache.org>.
gewei2000 edited a comment on issue #2739:
URL: https://github.com/apache/apisix/issues/2739#issuecomment-727222849


   > @gewei2000 for confirming this issue, please provide more error log(set the APISIX log level to `WARN`).
   > 
   > waiting for your response.
   
   I have already set log level to `WARN`, but has no more health check log


----------------------------------------------------------------
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] gewei2000 commented on issue #2739: request help: health check not working

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


   > @gewei2000 for confirming this issue, please provide more error log(set the APISIX log level to `WARN`).
   > 
   > waiting for your response.
   
   I have already set log level to `WARN`, but has no more log


----------------------------------------------------------------
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] membphis commented on issue #2739: request help: health check not working

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


   @gewei2000 for confirming this issue, please provide more error log(set the APISIX log level to `WARN`). 
   
   waiting for your response.
   
   


----------------------------------------------------------------
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] gewei2000 commented on issue #2739: request help: health check not working

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


   > @gewei2000 do you have fixed this issue? find out the reason?
   > 
   > what is it?
   
   I always think that the upstream and health check are created, then health check will be worked. In fact, after created the route and refer the upstream, the log will be output when you visit to the route. 
   
   Explain: for the configuration of nodes in the upstream, IP must exist, otherwise the request will always hang there
   


----------------------------------------------------------------
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] idbeta edited a comment on issue #2739: request help: health check not working

Posted by GitBox <gi...@apache.org>.
idbeta edited a comment on issue #2739:
URL: https://github.com/apache/apisix/issues/2739#issuecomment-727136243


   my env( apisix master + dashboard 2.0) can not reproduce your issue, my route like this:
   ```shell
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/404.html",
       "upstream": {
            "nodes": {
               "192.168.0.2": 1,
               "127.0.0.1:9797": 1
           },
           "type": "roundrobin",
           "retries": 2,
           "checks": {
               "active": {
                   "timeout": 5,
                   "http_path": "/404.html",
                   "healthy": {
                       "interval": 2,
                       "successes": 1
                   },
                   "unhealthy": {
                       "interval": 1,
                       "http_failures": 2
                   },
                   "req_headers": ["User-Agent: curl/7.29.0"]
               }
           }
       }
   }'
   ```
   after I close `127.0.0.1:9797`, APISIX's `error.log` show it only sent tow times traffic to the `127.0.0.1:9797`
   ```
   2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   ```
   Then no more traffic to the `127.0.0.1:9797`.
   But the log has another issue: there are redundant logs, I will report that. https://github.com/apache/apisix/issues/2745


----------------------------------------------------------------
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] gewei2000 edited a comment on issue #2739: request help: health check not working

Posted by GitBox <gi...@apache.org>.
gewei2000 edited a comment on issue #2739:
URL: https://github.com/apache/apisix/issues/2739#issuecomment-727157470


   > my env( apisix master + dashboard 2.0) can not reproduce your issue, my route like this:
   > 
   > ```shell
   > curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   > {
   >     "uri": "/404.html",
   >     "upstream": {
   >          "nodes": {
   >             "192.168.0.2": 1,
   >             "127.0.0.1:9797": 1
   >         },
   >         "type": "roundrobin",
   >         "retries": 2,
   >         "checks": {
   >             "active": {
   >                 "timeout": 5,
   >                 "http_path": "/404.html",
   >                 "healthy": {
   >                     "interval": 2,
   >                     "successes": 1
   >                 },
   >                 "unhealthy": {
   >                     "interval": 1,
   >                     "http_failures": 2
   >                 },
   >                 "req_headers": ["User-Agent: curl/7.29.0"]
   >             }
   >         }
   >     }
   > }'
   > ```
   > 
   > after I close `127.0.0.1:9797`, APISIX's `error.log` show it only sent tow times traffic to the `127.0.0.1:9797`
   > 
   > ```
   > 2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > 2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > 2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > 2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > ```
   > 
   > Then no more traffic to the `127.0.0.1:9797`.
   > But the log has another issue: there are redundant logs, I will report that. #2745
   
   my env(docker:apache/apisix:2.0-centos + dashboard 2.0 ), it also can not work, you can try use this json data
   my json data 
   ```
   {"name":"small_policy_center","type":"roundrobin","retries":2,"timeout":{"connect":6000,"send":6000,"read":6000},"nodes":[{"host":"9.23.27.152","port":7001,"weight":1},{"host":"9.23.27.226","port":7001,"weight":1}],"checks":{"active":{"healthy":{"interval":2,"successes":1},"http_path":"/","timeout":5,"unhealthy":{"http_failures":2,"interval":1}}}}
   ```
   


----------------------------------------------------------------
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] tokers commented on issue #2739: request help: health check not working

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


   > @gewei2000 do you have fixed this issue? find out the reason?
   > 
   > what is it?
   
   The active health check target is added lazily when the upstream was first referenced, at that point, no health check information, so unhealthy endpoints might be used, especially when their weight are high or because the directional selection like consistent hash.
   
   Or after the health checker resume these offline endpoints from unhealthy to healthy,  they are offline again,  before the health checker spawns probe requests and achieve the threshold, these offline (or unstable) endpoints could be selected.


----------------------------------------------------------------
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] idbeta edited a comment on issue #2739: request help: health check not working

Posted by GitBox <gi...@apache.org>.
idbeta edited a comment on issue #2739:
URL: https://github.com/apache/apisix/issues/2739#issuecomment-727136243


   my env( apisix master + dashboard 2.0) can not reproduce your issue, my route like this:
   ```shell
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/404.html",
       "upstream": {
            "nodes": {
               "192.168.0.2": 1,
               "127.0.0.1:9797": 1
           },
           "type": "roundrobin",
           "retries": 2,
           "checks": {
               "active": {
                   "timeout": 5,
                   "http_path": "/404.html",
                   "healthy": {
                       "interval": 2,
                       "successes": 1
                   },
                   "unhealthy": {
                       "interval": 1,
                       "http_failures": 2
                   },
                   "req_headers": ["User-Agent: curl/7.29.0"]
               }
           }
       }
   }'
   ```
   after I close `127.0.0.1:9797`, APISIX's `error.log` show it only sent tow times traffic to the `127.0.0.1:9797`
   ```
   2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   ```
   Then no more traffic to the `127.0.0.1:9797`.
   But the log has another issue: there are redundant logs, I will report that.


----------------------------------------------------------------
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] idbeta edited a comment on issue #2739: request help: health check not working

Posted by GitBox <gi...@apache.org>.
idbeta edited a comment on issue #2739:
URL: https://github.com/apache/apisix/issues/2739#issuecomment-727178739


   @gewei2000 I used your config data ( as follows ) and do not reproduce your issue. I want to know if you set the route many time or one time?
   ```
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/route.html",
       "upstream": {
   	    "name":"small_policy_center",
   	    "type":"roundrobin",
   	    "retries":2,
   	    "timeout":{
   	        "connect":6000,
   	        "send":6000,
   	        "read":6000
   	    },
   	    "nodes":[
   	        {
   	            "host":"127.0.0.1",
   	            "port":7001,
   	            "weight":1
   	        },
   	        {
   	            "host":"127.0.0.1",
   	            "port":7002,
   	            "weight":1
   	        }
   	    ],
   	    "checks":{
   	        "active":{
   	            "healthy":{
   	                "interval":2,
   	                "successes":1
   	            },
   	            "http_path":"/",
   	            "timeout":5,
   	            "unhealthy":{
   	                "http_failures":2,
   	                "interval":1
   	            }
   	        }
   	    }
   	}
   
   }'
   ```
   
   
   


----------------------------------------------------------------
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] idbeta edited a comment on issue #2739: request help: health check not working

Posted by GitBox <gi...@apache.org>.
idbeta edited a comment on issue #2739:
URL: https://github.com/apache/apisix/issues/2739#issuecomment-727136243


   my env( apisix master + dashboard 2.0) can not reproduce your issue, my route like this:
   ```shell
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/404.html",
       "upstream": {
            "nodes": {
               "192.168.0.2": 1,
               "127.0.0.1:9797": 1
           },
           "type": "roundrobin",
           "retries": 2,
           "checks": {
               "active": {
                   "timeout": 5,
                   "http_path": "/404.html",
                   "healthy": {
                       "interval": 2,
                       "successes": 1
                   },
                   "unhealthy": {
                       "interval": 1,
                       "http_failures": 2
                   },
                   "req_headers": ["User-Agent: curl/7.29.0"]
               }
           }
       }
   }'
   ```
   after I close `127.0.0.1:9797`, APISIX's `error.log` show it only sent two times traffic to the `127.0.0.1:9797`
   ```
   2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   ```
   Then no more traffic to the `127.0.0.1:9797`.
   But the log has another issue: there are redundant logs, I will report that. https://github.com/apache/apisix/issues/2745


----------------------------------------------------------------
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] gewei2000 commented on issue #2739: request help: health check not working

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


   > my env( apisix master + dashboard 2.0) can not reproduce your issue, my route like this:
   > 
   > ```shell
   > curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   > {
   >     "uri": "/404.html",
   >     "upstream": {
   >          "nodes": {
   >             "192.168.0.2": 1,
   >             "127.0.0.1:9797": 1
   >         },
   >         "type": "roundrobin",
   >         "retries": 2,
   >         "checks": {
   >             "active": {
   >                 "timeout": 5,
   >                 "http_path": "/404.html",
   >                 "healthy": {
   >                     "interval": 2,
   >                     "successes": 1
   >                 },
   >                 "unhealthy": {
   >                     "interval": 1,
   >                     "http_failures": 2
   >                 },
   >                 "req_headers": ["User-Agent: curl/7.29.0"]
   >             }
   >         }
   >     }
   > }'
   > ```
   > 
   > after I close `127.0.0.1:9797`, APISIX's `error.log` show it only sent tow times traffic to the `127.0.0.1:9797`
   > 
   > ```
   > 2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > 2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > 2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > 2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > ```
   > 
   > Then no more traffic to the `127.0.0.1:9797`.
   > But the log has another issue: there are redundant logs, I will report that. #2745
   my env( apache/apisix:2.0-centos + dashboard 2.0 ), it also can not work, you can try use this json data
   my json data 
   ```
   {"name":"small_policy_center","type":"roundrobin","retries":2,"timeout":{"connect":6000,"send":6000,"read":6000},"nodes":[{"host":"9.23.27.152","port":7001,"weight":1},{"host":"9.23.27.226","port":7001,"weight":1}],"checks":{"active":{"healthy":{"interval":2,"successes":1},"http_path":"/","timeout":5,"unhealthy":{"http_failures":2,"interval":1}}}}
   ```
   


----------------------------------------------------------------
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] gewei2000 closed issue #2739: request help: health check not working

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


   


----------------------------------------------------------------
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] idbeta commented on issue #2739: request help: health check not working

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


   I'm not quite sure what your question means. @membphis @spacewander please help answer if you two are free.


----------------------------------------------------------------
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] HelloBug0 commented on issue #2739: request help: health check not working

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


   I used you configuration to see wheather it's as same as yours.  I tried to close each port configured in the upstream and everything works well in the program.
   You can see if there is a warn log in the log file which means this host has been checked and it won't be choosen again.
   ```
   2020/11/14 02:14:23 [warn] 218476#218476: *33720 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/upstreams/1) unhealthy TCP increment (1/2) for '(9.23.27.226:7001)', context: ngx.timer, client: ::1, server: [::]:9080
   2020/11/14 02:14:25 [warn] 218473#218473: *33843 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/upstreams/1) unhealthy TCP increment (2/2) for '(9.23.27.226:7001)', context: ngx.timer, client: ::1, server: [::]:9080
   ```
   And if I close both ports, I can see the log just like you. 
   ```
   2020/11/14 02:22:51 [error] 218476#218476: *62776 connect() failed (111: Connection refused) while connecting to upstream, client: ::1, server: , request: "GET /route1 HTTP/1.1", upstream: "http://9.23.27.226:7001/route1", host: "localhost:9080"
   ```
   Here I use you ip and port to replace mine. :)


----------------------------------------------------------------
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] gewei2000 commented on issue #2739: request help: health check not working

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


   @membphis @moonming 


----------------------------------------------------------------
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] idbeta edited a comment on issue #2739: request help: health check not working

Posted by GitBox <gi...@apache.org>.
idbeta edited a comment on issue #2739:
URL: https://github.com/apache/apisix/issues/2739#issuecomment-727178739


   @gewei2000 I used your config data ( as follows ) and do not reproduce your issue. I want to know if you set the route many time or one time?
   ```
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/route.html",
       "upstream": {
   	    "name":"small_policy_center",
   	    "type":"roundrobin",
   	    "retries":2,
   	    "timeout":{
   	        "connect":6000,
   	        "send":6000,
   	        "read":6000
   	    },
   	    "nodes":[
   	        {
   	            "host":"127.0.0.1",
   	            "port":7001,
   	            "weight":1
   	        },
   	        {
   	            "host":"127.0.0.1",
   	            "port":7002,
   	            "weight":1
   	        }
   	    ],
   	    "checks":{
   	        "active":{
   	            "healthy":{
   	                "interval":2,
   	                "successes":1
   	            },
   	            "http_path":"/",
   	            "timeout":5,
   	            "unhealthy":{
   	                "http_failures":2,
   	                "interval":1
   	            }
   	        }
   	    }
   	}
   }'
   ```
   
   
   


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