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/08/02 10:41:56 UTC
[GitHub] [apisix] kuberxy opened a new issue #4741: request help: How to configure HTTP status codes in local YAML file
kuberxy opened a new issue #4741:
URL: https://github.com/apache/apisix/issues/4741
### Issue description
I get this error:
```
2021/08/02 18:32:42 [error] 25921#25921: *9160472 [lua] config_yaml.lua:202: failed to check item data of [upstreams] err:property "checks" validation failed: property "passive" validation failed: property "unhealthy" validation failed: property "http_statuses" validation failed: failed to validate item 1: wrong type: expected integer, got string ,val: {"nodes":{"nginx3:8091":1,"nginx1:8091":1,"nginx2:8091":1},"id":1,"name":"nginx","checks":{"active":{"unhealthy":{"http_statuses":[429,404,500,501,502,503,504,505],"interval":1,"timeouts":3,"http_failures":2,"tcp_failures":2},"http_path":"\/","timeout":1,"type":"http","healthy":{"successes":1,"interval":2,"http_statuses":[200,302]},"https_verify_certificate":true,"concurrency":10},"passive":{"unhealthy":{"http_failures":3,"http_statuses":["500"],"tcp_failures":3},"healthy":{"successes":3,"http_statuses":["200","201"]}}},"type":"roundrobin"}, context: ngx.timer
```
This is my configuration:
```
upstreams:
-
id: 1
name: "nginx"
nodes:
"nginx1:8091": 1
"nginx2:8091": 1
"nginx3:8091": 1
type: roundrobin
checks:
active:
http_path: "/"
healthy:
interval: 2
successes: 1
unhealthy:
interval: 1
http_failures: 2
passive:
healthy:
http_statuses: [200, 201]
successes: 3
unhealthy:
http_statuses: [500]
http_failures: 3
tcp_failures: 3
routes:
-
uri: /*
upstream_id: 1
#END
```
### Environment
* apisix version (cmd: `apisix version`): 2.3
* OS (cmd: `uname -a`): 4.15.0-111-generic Ubuntu 18.04
* OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`): openresty/1.15.8.3
* etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API): Stand-Alone
* apisix-dashboard version, if have: not have
* luarocks version, if the issue is about installation (cmd: `luarocks --version`): 2.4.2
--
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] kuberxy edited a comment on issue #4741: request help: How to configure HTTP status codes in local YAML file
Posted by GitBox <gi...@apache.org>.
kuberxy edited a comment on issue #4741:
URL: https://github.com/apache/apisix/issues/4741#issuecomment-891436060
After I changed the configuration file to this, it was normal
```
upstreams:
-
id: 1
name: "nginx"
nodes:
"nginx1:8091": 1
"nginx2:8091": 1
"nginx3:8091": 1
type: roundrobin
checks:
active:
http_path: "/"
healthy:
interval: 2
successes: 1
unhealthy:
interval: 1
http_failures: 2
passive:
healthy:
http_statuses:
- 200
- 201
successes: 3
unhealthy:
http_statuses:
- 500
http_failures: 3
tcp_failures: 3
routes:
-
uri: /*
upstream_id: 1
#END
```
--
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] kuberxy closed issue #4741: request help: How to configure HTTP status codes in local YAML file
Posted by GitBox <gi...@apache.org>.
kuberxy closed issue #4741:
URL: https://github.com/apache/apisix/issues/4741
--
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] kuberxy commented on issue #4741: request help: How to configure HTTP status codes in local YAML file
Posted by GitBox <gi...@apache.org>.
kuberxy commented on issue #4741:
URL: https://github.com/apache/apisix/issues/4741#issuecomment-891436060
After I changed the configuration file to this, it was normal
```
upstreams:
-
id: 1
name: "nginx"
nodes:
"nginx1:8091": 1
"nginx2:8091": 1
"nginx3:8091": 1
type: roundrobin
checks:
active:
http_path: "/"
healthy:
http_statuses:
- 200
- 302
- 304
interval: 2
successes: 1
unhealthy:
interval: 1
http_failures: 2
passive:
healthy:
http_statuses:
- 200
- 302
- 304
successes: 3
unhealthy:
http_statuses:
- 500
- 502
- 504
http_failures: 3
tcp_failures: 3
routes:
-
uri: /*
upstream_id: 1
#END
```
--
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] tokers commented on issue #4741: request help: How to configure HTTP status codes in local YAML file
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #4741:
URL: https://github.com/apache/apisix/issues/4741#issuecomment-890949100
It seems that the `passive.unhealthy.http_statuses` elements were parsed as string. But the configuration looks normal, not sure whether it's caused by some invisible characters.
--
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