Skip to content

help request: traffic-split plugin occurs error #9831

Description

@jujiale

Description

hello.
as this issue methioned: #5607

I also suffered such a situation. but I can not reproduce it. the error log is :
`

/traffic-split.lua:209: attempt to index field 'upstream' (a string value)

`

according the source code. when the traffic-split plugin config "weighted_upstreams" . it's element has no property "upstream". but have property "upstream_id", it should not invode the follwing code (line 209, because elseif upstream_obj.upstream then return false )
image

so I confused why line 209 is invoked.

traffic_split config is below:
`

{
"traffic-split": {
	"disable": false,
	"rules": [{
		"weighted_upstreams": [{
			"weight": 0
		}, {
			"upstream_id": "466807194923303750",
			"weight": 100
		}, {
			"upstream_id": "466807194721978186",
			"weight": 0
		}]
	}]
}

}

`

Environment

  • APISIX version (run apisix version): v2.12.0
  • Operating system (run uname -a):
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):3.5.0
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):

Metadata

Metadata

Assignees

Type

No type

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions