orlabs / orange

OpenResty/Nginx Gateway for API Monitoring and Management.
http://orange.sumory.com
MIT License
2.31k stars 573 forks source link

no new() function in random.lua,which is balancer plugin require #281

Open liulei18 opened 5 years ago

liulei18 commented 5 years ago

Version

v0.7.0

Description

to archive dynamic upstream

Plugin

balancer plugin & divide plugin

Configuration

Execute

Error Log

2019/07/16 16:48:14 [error] 389667#0: *20 lua entry thread aborted: runtime error: ./lualib/resty/dns/balancer.lua:1027: attempt to call field 'new' (a nil value)
stack traceback:
coroutine 0:
    ./lualib/resty/dns/balancer.lua: in function 'randomlist'
    ./lualib/resty/dns/balancer.lua:1129: in function 'new'
    /usr/local/orange/orange/utils/balancer.lua:145: in function 'get_balancer'
    /usr/local/orange/orange/utils/balancer.lua:241: in function 'balancer_execute'
    /usr/local/orange/orange/plugins/balancer/handler.lua:95: in function 'access'
    /usr/local/orange/orange/orange.lua:166: in function 'access'
    access_by_lua(orange.conf:669):3: in function <access_by_lua(orange.conf:669):1>, client: 192.168.90.26, server: orange.com, request: "GET /balancer HTTP/1.1", host: "orange.com"

Solution

liulei18 commented 5 years ago
zhangbao0325 commented 5 years ago

I feel sorry for causing your confusion and trouble , and I have confirmed this problem . So I update zhangbao0325/orangelib again and modified the README.md. Thank you again and wait for your more suggestions.