You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/03 13:39:26 UTC

[GitHub] [apisix] nanamikon opened a new issue #2600: bug: Add lua_shared_dicts setting occurs nil exception

nanamikon opened a new issue #2600:
URL: https://github.com/apache/apisix/issues/2600


   ### Issue description
   Add lua_shared_dicts setting occurs nil exception
   ### Environment
   
   * apisix version (1.5):
   * OS:mac
   
   ### Minimal test code / Steps to reproduce the issue
   1.add lua_shared_dicts in the config.yaml
   ```
   nginx_config:
     http:
       lua_shared_dicts:
         office_ips_list: 10m
     vhost_path: /Users/jianzhou/workspace/apisix/conf/vhost
   ```
   2. start apisix,   will see the following exceptiong
   ```
   lua: ./bin/apisix:604: attempt to index a nil value (local 'base')
   stack traceback:
           ./bin/apisix:604: in upvalue 'merge_conf'
           ./bin/apisix:601: in upvalue 'merge_conf'
           ./bin/apisix:601: in upvalue 'merge_conf'
           ./bin/apisix:601: in upvalue 'merge_conf'
           ./bin/apisix:645: in upvalue 'read_yaml_conf'
           ./bin/apisix:809: in upvalue 'init'
           ./bin/apisix:1035: in field '?'
           ./bin/apisix:1087: in main chunk
           [C]: in ?
   
   ```
   
   ### What's the actual result? (including assertion message & call stack if applicable)
   According to the code in apisix,   the exception occurs when merge congfig.yaml and config-default.yaml
   ``` lua
   local function merge_conf(base, new_tab)
       for key, val in pairs(new_tab) do
           if type(val) == "table" then
               if tab_is_array(val) then
                   base[key] = val
               else
                   merge_conf(base[key], val)
               end
           else
               base[key] = val
           end
       end
       return base
   end
   ``` 
   So I add parent path of  the key in config-default.yaml,   everything will be ok.
   ```
       #lua_shared_dicts:              # add custom shared cache to nginx.conf
       #  ipc_shared_dict: 100m        # custom shared cache, format: `cache-key: cache-size`
   ``` 
   --->
   ```
       lua_shared_dicts:              # add custom shared cache to nginx.conf
       #  ipc_shared_dict: 100m        # custom shared cache, format: `cache-key: cache-size`
   ```
   
   ### What's the expected result?
   No exception
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander closed issue #2600: bug: Add lua_shared_dicts setting occurs nil exception

Posted by GitBox <gi...@apache.org>.
spacewander closed issue #2600:
URL: https://github.com/apache/apisix/issues/2600


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #2600: bug: Add lua_shared_dicts setting occurs nil exception

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2600:
URL: https://github.com/apache/apisix/issues/2600#issuecomment-720417878


   Fixed by #2476 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org