I would get the following errors at running ./api/build-tools/schema-sync.sh to sync schema definitions with APISIX.
lua: ./apisix/init.lua:24: module 'resty.ngxvar' not found:
and
lua: ./apisix/plugins/traffic-split.lua:21: module 'resty.roundrobin' not found:
After I added these two missing module names into fake_module_list variable. Everything works fine. So please have a check, if it's a bug, I would commit a PR to fix that. Thanks.
I guess this bug is similar to https://github.com/apache/apisix-dashboard/issues/1216 . PR #1221 had fixed part of it, we still need to add the missing resty.ngxvar and resty.roundrobin.
./api/build-tools/schema-sync.sh;The shell runs fine and the new schema.json is synchronized successfully.
cc @nic-chen @starsz
Hi, @imjoey what's your apisix version.
Hi, @imjoey what's your apisix version.
@starsz I did not specify any argument or flag when running ./api/build-tools/schema-sync.sh, so it was downloading master branch of APISIX.
@imjoey Thanks for reporting. It's indeed a bug.
But I think there is a better solution. We can override the require function like this:
local old_require = require
require = function(...)
local status, lib = pcall(old_require, ...)
if status then
return lib
end
return {}
end
@starsz yep, your solution is really fantastic. Looking forward to your PR. Much appreciated. 馃槃
Does this should be fixed in M2.3?
Does this should be fixed in M2.3?
@juzhiyuan , end users rarely run the script to sync schema. Meanwhile, this bug will not make any other impact on the functionality. So IMHO, this could be fixed until M2.4. Let's wait others opinions. Thanks.
Does this should be fixed in M2.3?
@juzhiyuan , end users rarely run the script to sync schema. Meanwhile, this bug will not make any other impact on the functionality. So IMHO, this could be fixed until M2.4. Let's wait others opinions. Thanks.
Agree +1.
@starsz
we don't need the tool schema-sync now, we could use APISIX controlAPI to export schema.
we only need to update doc about sync schema here.
@nic-chen so we can update the doc and close this issue, right?
@nic-chen so we can update the doc and close this issue, right?
sure.
Most helpful comment
@juzhiyuan , end users rarely run the script to sync schema. Meanwhile, this bug will not make any other impact on the functionality. So IMHO, this could be fixed until M2.4. Let's wait others opinions. Thanks.