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/07/03 06:18:36 UTC
[GitHub] [incubator-apisix] wrl96 opened a new issue #1798: bug: failed to set server peer when upstreams.node is address in apisix.yaml
wrl96 opened a new issue #1798:
URL: https://github.com/apache/incubator-apisix/issues/1798
### Issue description
[apisix/init.lua#L316](https://github.com/apache/incubator-apisix/blob/e6e387a1c5e352cff4645f9da08bc580eb2ba1c2/apisix/init.lua#L316)
`local upstreams_etcd = core.config.fetch_created_obj("/upstreams")`
No key named "/upstreams" in apisix.yaml, then upstreams_etcd == nil
[apisix/core/config_yaml.lua#269](https://github.com/apache/incubator-apisix/blob/e6e387a1c5e352cff4645f9da08bc580eb2ba1c2/apisix/core/config_yaml.lua#L269)
```
if key then
key = sub_str(key, 2)
end
```
[apisix/core/config_yaml.lua#314](https://github.com/apache/incubator-apisix/blob/e6e387a1c5e352cff4645f9da08bc580eb2ba1c2/apisix/core/config_yaml.lua#L314)
```
function _M.fetch_created_obj(key)
return created_obj[key]
end
```
It remove "/" in _M.new() but not remove in _M.fetch_created_obj()
### Environment
* apisix version (cmd: `apisix version`):
* OS: 1.3
### Minimal test code / Steps to reproduce the issue
apisix.yaml
```
routes:
- desc: httpbin
plugins:
proxy-rewrite:
scheme: https
priority: 0
service_id: 101
uri: "/get"
services:
- id: 101
desc: httpbin
plugins: {}
upstream_id: 1
upstreams:
- id: 1
desc: httpbin
enable_websocket: false
hash_on: vars
nodes:
httpbin.org:443: 1
type: roundrobin
```
### What's the actual result? (including assertion message & call stack if applicable)
http://***:9080/get
```
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>openresty</center>
</body>
</html>
```
error.log
```
2020/07/03 06:02:38 [error] 16#16: *5414 [lua] balancer.lua:310: load_balancer(): failed to set server peer [httpbin.org:443] err: no host allowed while connecting to upstream, client: 10.6.7.104, server: , request: "GET /get?api=1 HTTP/1.1", host: "***:9080"
```
----------------------------------------------------------------
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] [incubator-apisix] membphis closed issue #1798: bug: failed to set server peer when upstreams.node is address in apisix.yaml
Posted by GitBox <gi...@apache.org>.
membphis closed issue #1798:
URL: https://github.com/apache/incubator-apisix/issues/1798
----------------------------------------------------------------
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