apisix icon indicating copy to clipboard operation
apisix copied to clipboard

bug: config.yaml can only use those defined in config-default.yaml

Open JanLi-air opened this issue 6 years ago • 2 comments

Issue description

config.yaml is used to override those configurations in config-default.yaml.

The problem is that some configurations are too niche to be included in config-default.yaml. Such as proxy_protocol.

But if you override something not in config-default.yaml, you will get an error when you init apisix.

Environment

  • apisix version (cmd: apisix version): 2.0
  • OS: Mac

Minimal test code / Steps to reproduce the issue

  1. Add proxy protocol in config.yaml
  2. Run make init

What's the actual result? (including assertion message & call stack if applicable)

You will get this error:

lua: ./bin/apisix:808: attempt to index a nil value (local 'base')
stack traceback:
        ./bin/apisix:808: in upvalue 'merge_conf'
        ./bin/apisix:805: in upvalue 'merge_conf'
        ./bin/apisix:805: in upvalue 'merge_conf'
        ./bin/apisix:849: in upvalue 'read_yaml_conf'
        ./bin/apisix:1015: in field '?'
        ./bin/apisix:1355: in main chunk
        [C]: in ?
make: *** [init] Error 1

What's the expected result?

make init should be able to handle this case: when a config is not defined in config-default.yaml, but defined in config.yaml

JanLi-air avatar Nov 24 '20 07:11 JanLi-air

Fixed by https://github.com/apache/apisix/pull/2476

spacewander avatar Nov 24 '20 08:11 spacewander

@JanLi-air feel free to reopen this issue if you still have this problem

membphis avatar Nov 24 '20 10:11 membphis