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/01/15 10:58:21 UTC
[GitHub] [apisix] dw-3 opened a new issue #3307: 报错 重定向太多
dw-3 opened a new issue #3307:
URL: https://github.com/apache/apisix/issues/3307
我配置一个路由:
当使用test.com访问/时,且使用traffic-split配置了header中带有cmnet会转发到127.0.0.1:80,如果没有header就会转发到test.com
我本地test.com解析到apisix 10.10.100.26机器上,然后apisix那台机器的test.com解析到10.10.100.36上
当我本地访问test.com且不带header时,会通过apisix转发到test.com即10.10.100.36,但是报错信息为重定向太多,错误日志为:
2021/01/15 18:20:39 [warn] 5129#5129: *142686 [lua] upstream.lua:57: set_upstream(): upstream node has been specified, cannot be set repeatedly, client: 10.11.0.89, server: , request: "GET / HTTP/1.1", host: "test.com"
2021/01/15 18:20:39 [warn] 5129#5129: *142686 an upstream response is buffered to a temporary file /usr/local/apisix/proxy_temp/9/00/0000000009 while reading upstream, client: 10.11.0.89, server: , request: "GET / HTTP/1.1", upstream: "http://10.0.15.97:80/", host: "test.com"
----------------------------------------------------------------
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] dw-3 commented on issue #3307: 报错 重定向太多
Posted by GitBox <gi...@apache.org>.
dw-3 commented on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-761961773
> Hi, @dw-3
> You need to provide the etcd data of the route, which will help us to troubleshoot.
路有数据如下
{"id":"337510371847832908","create_time":1610701458,"update_time":1610706983,"uris":["/*"],"name":"homedo-test","methods":["GET","HEAD","POST","PUT","DELETE","OPTIONS","PATCH"],"hosts":["www.homedo.com"],"vars":[],"plugins":{"traffic-split":{"disable":false,"rules":[{"match":[{"vars":[["http_h-x-strategy-token-cmnet","==","CompanyNetwork"]]}],"weighted_upstreams":[{"upstream":{"hash_on":"vars","name":"upstream_A","nodes":{"10.0.15.97:80":10},"pass_host":"pass","type":"roundrobin"},"weight":1}]}]}},"upstream":{"nodes":[{"host":"www.homedo.com","port":80,"weight":1}],"timeout":{"connect":6000,"read":6000,"send":6000},"type":"roundrobin","pass_host":"pass"},"status":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] membphis commented on issue #3307: to many redirect
Posted by GitBox <gi...@apache.org>.
membphis commented on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-762621291
you can set the upstream node by IP, it is an easy way.
```
"upstream":{
"nodes":[
{
"host":"10.10.100.26",
"port":80,
"weight":1
}
],
"timeout":{
"connect":6000,
"read":6000,
"send":6000
},
"type":"roundrobin",
"pass_host":"pass"
},
```
----------------------------------------------------------------
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] dw-3 commented on issue #3307: to many redirect
Posted by GitBox <gi...@apache.org>.
dw-3 commented on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-761996983
> @dw-3 Could you format the JSON string, it's somewhat hard to read now.
{
"id":"337510371847832908",
"create_time":1610701458,
"update_time":1610706983,
"uris":[
"/*"
],
"name":"homedo-test",
"methods":[
"GET",
"HEAD",
"POST",
"PUT",
"DELETE",
"OPTIONS",
"PATCH"
],
"hosts":[
"www.homedo.com"
],
"vars":[
],
"plugins":{
"traffic-split":{
"disable":false,
"rules":[
{
"match":[
{
"vars":[
[
"http_h-x-strategy-token-cmnet",
"==",
"CompanyNetwork"
]
]
}
],
"weighted_upstreams":[
{
"upstream":{
"hash_on":"vars",
"name":"upstream_A",
"nodes":{
"10.0.15.97:80":10
},
"pass_host":"pass",
"type":"roundrobin"
},
"weight":1
}
]
}
]
}
},
"upstream":{
"nodes":[
{
"host":"www.homedo.com",
"port":80,
"weight":1
}
],
"timeout":{
"connect":6000,
"read":6000,
"send":6000
},
"type":"roundrobin",
"pass_host":"pass"
},
"status":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] dw-3 commented on issue #3307: to many redirect
Posted by GitBox <gi...@apache.org>.
dw-3 commented on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-762577735
> > > Hi, @dw-3
> > > According to the log information you provided, this is a normal behavior. Because the upstream information is directly set in the traffic-split plugin, when the upstream used is the upstream in the traffic-split plugin, this information will be printed by default.
> > > Please see here:
> > > Set the upstream code in the plugin:
> > > https://github.com/apache/apisix/blob/c397e4738cb4fd54ec45a4a1de48d5c68eced7f4/apisix/plugins/traffic-split.lua#L252
> > >
> > > The code of apisix/upstream.lua:
> > > https://github.com/apache/apisix/blob/e8dcf3793ca40b30047406ac51a79a500356f67b/apisix/upstream.lua#L29-L71
> > >
> > > I think some people besides me also have this requirement. Can't I configure routing like this? The upstream host of my traffic split cannot be consistent with the host of my route, although the resolution is different. If it doesn’t work, how can I use other ones to achieve this?
>
> Both the upstream in the traffic-split plugin and the upstream in the route will take effect. Only when using the upstream in the traffic-split plug-in, this log will be printed: `upstream node has been specified, cannot be set repeatedly` .
Is there a way to solve my problem?
----------------------------------------------------------------
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] dw-3 edited a comment on issue #3307: to many redirect
Posted by GitBox <gi...@apache.org>.
dw-3 edited a comment on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-761996983
> @dw-3 Could you format the JSON string, it's somewhat hard to read now.
```json
{
"id":"337510371847832908",
"create_time":1610701458,
"update_time":1610706983,
"uris":[
"/*"
],
"name":"homedo-test",
"methods":[
"GET",
"HEAD",
"POST",
"PUT",
"DELETE",
"OPTIONS",
"PATCH"
],
"hosts":[
"www.homedo.com"
],
"vars":[
],
"plugins":{
"traffic-split":{
"disable":false,
"rules":[
{
"match":[
{
"vars":[
[
"http_h-x-strategy-token-cmnet",
"==",
"CompanyNetwork"
]
]
}
],
"weighted_upstreams":[
{
"upstream":{
"hash_on":"vars",
"name":"upstream_A",
"nodes":{
"10.0.15.97:80":10
},
"pass_host":"pass",
"type":"roundrobin"
},
"weight":1
}
]
}
]
}
},
"upstream":{
"nodes":[
{
"host":"www.homedo.com",
"port":80,
"weight":1
}
],
"timeout":{
"connect":6000,
"read":6000,
"send":6000
},
"type":"roundrobin",
"pass_host":"pass"
},
"status":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] dw-3 commented on issue #3307: 报错 重定向太多
Posted by GitBox <gi...@apache.org>.
dw-3 commented on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-761939079
路有数据如下
{"id":"337510371847832908","create_time":1610701458,"update_time":1610706983,"uris":["/*"],"name":"homedo-test","methods":["GET","HEAD","POST","PUT","DELETE","OPTIONS","PATCH"],"hosts":["www.homedo.com"],"vars":[],"plugins":{"traffic-split":{"disable":false,"rules":[{"match":[{"vars":[["http_h-x-strategy-token-cmnet","==","CompanyNetwork"]]}],"weighted_upstreams":[{"upstream":{"hash_on":"vars","name":"upstream_A","nodes":{"10.0.15.97:80":10},"pass_host":"pass","type":"roundrobin"},"weight":1}]}]}},"upstream":{"nodes":[{"host":"www.homedo.com","port":80,"weight":1}],"timeout":{"connect":6000,"read":6000,"send":6000},"type":"roundrobin","pass_host":"pass"},"status":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] dw-3 removed a comment on issue #3307: 报错 重定向太多
Posted by GitBox <gi...@apache.org>.
dw-3 removed a comment on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-761939079
路有数据如下
{"id":"337510371847832908","create_time":1610701458,"update_time":1610706983,"uris":["/*"],"name":"homedo-test","methods":["GET","HEAD","POST","PUT","DELETE","OPTIONS","PATCH"],"hosts":["www.homedo.com"],"vars":[],"plugins":{"traffic-split":{"disable":false,"rules":[{"match":[{"vars":[["http_h-x-strategy-token-cmnet","==","CompanyNetwork"]]}],"weighted_upstreams":[{"upstream":{"hash_on":"vars","name":"upstream_A","nodes":{"10.0.15.97:80":10},"pass_host":"pass","type":"roundrobin"},"weight":1}]}]}},"upstream":{"nodes":[{"host":"www.homedo.com","port":80,"weight":1}],"timeout":{"connect":6000,"read":6000,"send":6000},"type":"roundrobin","pass_host":"pass"},"status":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] spacewander commented on issue #3307: to many redirect
Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-775590759
Closed as lack of 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] membphis commented on issue #3307: 报错 重定向太多
Posted by GitBox <gi...@apache.org>.
membphis commented on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-760876755
@dw-3 need you to provide your route data
----------------------------------------------------------------
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] dw-3 commented on issue #3307: to many redirect
Posted by GitBox <gi...@apache.org>.
dw-3 commented on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-762309356
> Hi, @dw-3
> According to the log information you provided, this is a normal behavior. Because the upstream information is directly set in the traffic-split plugin, when the upstream used is the upstream in the traffic-split plugin, this information will be printed by default.
>
> Please see here:
>
> Set the upstream code in the plugin:
>
> https://github.com/apache/apisix/blob/c397e4738cb4fd54ec45a4a1de48d5c68eced7f4/apisix/plugins/traffic-split.lua#L252
>
> The code of apisix/upstream.lua:
>
> https://github.com/apache/apisix/blob/e8dcf3793ca40b30047406ac51a79a500356f67b/apisix/upstream.lua#L29-L71
I think some people besides me also have this requirement. Can't I configure routing like this? The upstream host of my traffic split cannot be consistent with the host of my route, although the resolution is different. If it doesn’t work, how can I use other ones to achieve this?
----------------------------------------------------------------
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 closed issue #3307: to many redirect
Posted by GitBox <gi...@apache.org>.
spacewander closed issue #3307:
URL: https://github.com/apache/apisix/issues/3307
----------------------------------------------------------------
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] Firstsawyou commented on issue #3307: to many redirect
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-762326434
> > Hi, @dw-3
> > According to the log information you provided, this is a normal behavior. Because the upstream information is directly set in the traffic-split plugin, when the upstream used is the upstream in the traffic-split plugin, this information will be printed by default.
> > Please see here:
> > Set the upstream code in the plugin:
> > https://github.com/apache/apisix/blob/c397e4738cb4fd54ec45a4a1de48d5c68eced7f4/apisix/plugins/traffic-split.lua#L252
> >
> > The code of apisix/upstream.lua:
> > https://github.com/apache/apisix/blob/e8dcf3793ca40b30047406ac51a79a500356f67b/apisix/upstream.lua#L29-L71
> >
> > I think some people besides me also have this requirement. Can't I configure routing like this? The upstream host of my traffic split cannot be consistent with the host of my route, although the resolution is different. If it doesn’t work, how can I use other ones to achieve this?
Both the upstream in the traffic-split plugin and the upstream in the route will take effect. Only when using the upstream in the traffic-split plug-in, this log will be printed: `upstream node has been specified, cannot be set repeatedly` .
----------------------------------------------------------------
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] Firstsawyou commented on issue #3307: to many redirect
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-762613768
> > > > Hi, @dw-3
> > > > According to the log information you provided, this is a normal behavior. Because the upstream information is directly set in the traffic-split plugin, when the upstream used is the upstream in the traffic-split plugin, this information will be printed by default.
> > > > Please see here:
> > > > Set the upstream code in the plugin:
> > > > https://github.com/apache/apisix/blob/c397e4738cb4fd54ec45a4a1de48d5c68eced7f4/apisix/plugins/traffic-split.lua#L252
> > > >
> > > > The code of apisix/upstream.lua:
> > > > https://github.com/apache/apisix/blob/e8dcf3793ca40b30047406ac51a79a500356f67b/apisix/upstream.lua#L29-L71
> > > >
> > > > I think some people besides me also have this requirement. Can't I configure routing like this? The upstream host of my traffic split cannot be consistent with the host of my route, although the resolution is different. If it doesn’t work, how can I use other ones to achieve this?
> >
> >
> > Both the upstream in the traffic-split plugin and the upstream in the route will take effect. Only when using the upstream in the traffic-split plug-in, this log will be printed: `upstream node has been specified, cannot be set repeatedly` .
>
> Is there a way to solve my problem?
Please confirm again whether the warning log in your description still exists. Secondly, does it affect your request.
----------------------------------------------------------------
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] Firstsawyou commented on issue #3307: to many redirect
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-762179504
Hi, @dw-3
According to the log information you provided, this is a normal behavior. Because the upstream information is directly set in the traffic-split plugin, when the upstream used is the upstream in the traffic-split plugin, this information will be printed by default.
Please see here:
Set the upstream code in the plugin:
https://github.com/apache/apisix/blob/c397e4738cb4fd54ec45a4a1de48d5c68eced7f4/apisix/plugins/traffic-split.lua#L252
The code of apisix/upstream.lua:
https://github.com/apache/apisix/blob/e8dcf3793ca40b30047406ac51a79a500356f67b/apisix/upstream.lua#L29-L71
----------------------------------------------------------------
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 #3307: to many redirect
Posted by GitBox <gi...@apache.org>.
tokers commented on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-761990785
@dw-3 Could you format the JSON string, it's somewhat hard to read 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] Firstsawyou commented on issue #3307: 报错 重定向太多
Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #3307:
URL: https://github.com/apache/apisix/issues/3307#issuecomment-760897056
Hi, @dw-3
You need to provide the etcd data of the route, which will help us to troubleshoot.
----------------------------------------------------------------
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