kayx23 opened a new issue, #9957:
URL: https://github.com/apache/apisix/issues/9957

   ### Current Behavior
   
   This issue summurizes https://github.com/apache/apisix/issues/8719 which was 
reported for the same behaviour.
   
   Specifically, if you configure `proxy-cache` plugin with ONLY 
`"cache_strategy": "memory"`, you get a `500 Internal Server Error` with the 
following logs:
   
   ```text
   [error] 128#128: *7943331 lua entry thread aborted: runtime error: 
./apisix/plugins/proxy-cache/memory.lua:47: attempt to index field 'dict' (a 
nil value)
   stack traceback:
   coroutine 0:
           ./apisix/plugins/proxy-cache/memory.lua: in function 'get'
           ./apisix/plugins/proxy-cache/memory_handler.lua:204: in function 
'phase_func'
           ./apisix/plugin.lua:1099: in function 'run_plugin'
           ./apisix/init.lua:674: in function 'http_access_phase'
           access_by_lua(nginx.conf:340):2: in main chunk, client: 
192.168.112.1, server: _, request: "POST /api HTTP/1.1", host: "127.0.0.1:9080"
   ```
   
   The correct usage is to configure `"cache_strategy": "memory"`with 
"cache_zone": "memory_cache" (or any other customized memory cache zones 
defined in `config.yaml`), such as the below:
   
   ```json
   "proxy-cache": {
         "cache_strategy": "memory",
         "cache_zone": "memory_cache"
   }
   ```
   
   ### Expected Behavior
   
   If a user incorrectly configure just the  `"cache_strategy": "memory"` 
without specifying a memory zone, the program should return an error message to 
help users identify the issue, instead of crashing like the current behaviour.
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   -
   
   ### Environment
   
   APISIX version (run `apisix version`): 3.4.0
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org.apache.org

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

Reply via email to