Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增分流方式出错module 'abtesting.diversion.arg_station' not found #82

Open
hypier opened this issue Dec 7, 2017 · 1 comment

Comments

@hypier
Copy link

hypier commented Dec 7, 2017

[root@localhost logs]# cat admin.log
2017/12/07 16:53:12 [error] 8391#0: *1 [lua] log.lua:28: errlog(): ab_div host [ab_admin] code : 40201, desc : lua runtime error ../lib/abtesting/adapter/policy.lua:95: module 'abtesting.diversion.arg_station' not found:
no field package.preload['abtesting.diversion.arg_station']
no file '../abtesting/diversion/arg_station.lua'
no file '../lib/abtesting/diversion/arg_station.lua'
no file '../lib/lua-resty-core/lib/abtesting/diversion/arg_station.lua'
no file '/usr/local/openresty/lualib/abtesting/diversion/arg_station.lua'
no file '/usr/local/openresty/lualib/abtesting/diversion/arg_station/init.lua'
no file './abtesting/diversion/arg_station.lua'
no file '/usr/local/openresty/luajit/share/luajit-2.1.0-beta1/abtesting/diversion/arg_station.lua'
no file '/usr/local/share/lua/5.1/abtesting/diversion/arg_station.lua'
no file '/usr/local/share/lua/5.1/abtesting/diversion/arg_station/init.lua'
no file '/usr/local/openresty/luajit/share/lua/5.1/abtesting/diversion/arg_station.lua'
no file '/usr/local/openresty/luajit/share/lua/5.1/abtesting/diversion/arg_station/init.lua'
no file '/usr/local/openresty/lualib/abtesting/diversion/arg_station.so'
no file './abtesting/diversion/arg_station.so'
no file '/usr/local/lib/lua/5.1/abtesting/diversion/arg_station.so'
no file '/usr/local/openresty/luajit/lib/lua/5.1/abtesting/diversion/arg_station.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/usr/local/openresty/lualib/abtesting.so'
no file './abtesting.so'
no file '/usr/local/lib/lua/5.1/abtesting.so'
no file '/usr/local/openresty/luajit/lib/lua/5.1/abtesting.so'
no file '/usr/local/lib/lua/5.1/loadall.so', errstack : stack traceback:
../lib/abtesting/error/handler.lua:17: in function <../lib/abtesting/error/handler.lua:7>
[C]: in function 'require'
../lib/abtesting/adapter/policy.lua:95: in function 'check'
../lib/abtesting/adapter/policygroup.lua:117: in function <../lib/abtesting/adapter/policygroup.lua:111>
[C]: in function 'xpcall'
../admin/policygroup.lua:160: in function 'checkPolicy'
../admin/policygroup.lua:192: in function 'do_action'
/usr/local/dygateway/utils/../admin/ab_action.lua:82: in function </usr/local/dygateway/utils/../admin/ab_action.lua:1>, client: 127.0.0.1, server: localhost, request: "POST /ab_admin?action=policygroup_set HTTP/1.1", host: "127.0.0.1:8080"

按照arg_city.lua新增了一个分流方式,
1.在lib/abtesting/diversion/下新增文件arg_station.lua
2.在lib/abtesting/userinfo/下新增文件stationParser.lua
3.在lib/abtesting/utils/init.lua文件中新增 ["arg_station"] = 'stationParser' 语句

然后使用abtesting.sh方式重启,最后增加相关策略报上述错误

curl 127.0.0.1:8080/ab_admin?action=policygroup_set -d '{"1":{"divtype":"arg_station","divdata":[{"station":"HDQA00","upstream":"beta1"},{"station":"CQ11","upstream":"beta2"},{"station":"CQ12","upstream":"beta1"},{"station":"CQ13","upstream":"beta3"}]}}'

是还有哪个地方没有加吗,还是什么问题,多谢

@hypier
Copy link
Author

hypier commented Dec 8, 2017

问题解决了,权限问题

[root@localhost diversion]# ll
total 28
-rw-r--r--. 1 root root 2007 Mar 6 2017 arg_city.lua
-rw-------. 1 root root 2040 Dec 7 18:49 arg_station.lua
-rw-r--r--. 1 root root 4018 Mar 6 2017 iprange.lua
-rw-r--r--. 1 root root 2761 Mar 6 2017 uidappoint.lua
-rw-r--r--. 1 root root 3931 Mar 6 2017 uidrange.lua
-rw-r--r--. 1 root root 2325 Mar 6 2017 uidsuffix.lua
-rw-r--r--. 1 root root 2243 Mar 6 2017 url.lua
[root@localhost diversion]# pwd
/usr/local/dygateway/lib/abtesting/diversion
[root@localhost diversion]#
[root@localhost diversion]# ll
total 28
-rw-r--r--. 1 root root 2007 Mar 6 2017 arg_city.lua
-rw-r--r--. 1 root root 2040 Dec 7 18:49 arg_station.lua
-rw-r--r--. 1 root root 4018 Mar 6 2017 iprange.lua
-rw-r--r--. 1 root root 2761 Mar 6 2017 uidappoint.lua
-rw-r--r--. 1 root root 3931 Mar 6 2017 uidrange.lua
-rw-r--r--. 1 root root 2325 Mar 6 2017 uidsuffix.lua
-rw-r--r--. 1 root root 2243 Mar 6 2017 url.lua
[root@localhost diversion]# curl 127.0.0.1:8080/ab_admin?action=policygroup_set -d '{"1":{"divtype":"arg_station","divdata":[{"station":"HDQA00","upstream":"beta1"},{"station":"CQ11","upstream":"beta2"},{"station":"CQ12","upstream":"beta1"},{"station":"CQ13","upstream":"beta3"}]}}'
{"desc":"success ","code":200,"data":{"groupid":2,"group":[2]}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant