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 2019/12/22 06:26:24 UTC

[GitHub] [incubator-apisix] totemofwolf opened a new issue #991: bug: mismatch Redis key and routes' id when updating /apisix/admin/routes

totemofwolf opened a new issue #991: bug: mismatch Redis key and routes' id when updating /apisix/admin/routes
URL: https://github.com/apache/incubator-apisix/issues/991
 
 
   ### Issue description
   
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): 0.9.0
   * OS: alpine 3.7
   
   ### Minimal test code / Steps to reproduce the issue
   
   ``` bash
   
   # create routes with limit-count-redis
   curl -i 127.0.0.1:9180/apisix/admin/routes/ -X POST -H 'Content-Type: application/json' -d '
   {
       "uris":[
           "/api/admin/login"
       ],
       "hosts":[
           "blog.nsa.work"
       ],
       "methods":[
           "POST"
       ],
       "plugins":{
           "limit-count":{
               "count":3,
               "time_window":300,
               "rejected_code":503,
               "key":"remote_addr",
               "policy":"redis",
               "redis_host":"127.0.0.1",
               "redis_port":6389,
               "redis_timeout":1000
           }
       },
       "vars":[
           [
               "scheme",
               "==",
               "https"
           ]
       ],
       "upstream_id":"2",
       "desc":"https://blog.nsa.work/api/admin/login"
   }'
   
   # assume the new created routes' id is 00000000000000000121
   # request this routes and check redis key
   127.0.0.1:6389> KEYS *
   1) "plugin-limit-count1.2.3.4route121"
   
   
   # for example, update redis key with : http_x_forwarded_for
   curl -i 127.0.0.1:9180/apisix/admin/routes/00000000000000000121 -X PUT -H 'Content-Type: application/json' -d '
   {
       "uris":[
           "/api/admin/login"
       ],
       "hosts":[
           "blog.nsa.work"
       ],
       "methods":[
           "POST"
       ],
       "plugins":{
           "limit-count":{
               "count":3,
               "time_window":300,
               "rejected_code":503,
               "key":"http_x_forwarded_for",
               "policy":"redis",
               "redis_host":"127.0.0.1",
               "redis_port":6389,
               "redis_timeout":1000
           }
       },
       "vars":[
           [
               "scheme",
               "==",
               "https"
           ]
       ],
       "upstream_id":"2",
       "desc":"https://blog.nsa.work/api/admin/login"
   }'
   
   # request again
   127.0.0.1:6389> KEYS *
   1) "plugin-limit-countroute122"
   ```
   
   ### What's the actual result? (including assertion message & call stack if applicable)
   
   
   
   ### What's the expected result?
   

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


With regards,
Apache Git Services

[GitHub] [incubator-apisix] moonming commented on issue #991: bug: mismatch Redis key and routes' id when updating /apisix/admin/routes

Posted by GitBox <gi...@apache.org>.
moonming commented on issue #991: bug: mismatch Redis key and routes' id when updating /apisix/admin/routes
URL: https://github.com/apache/incubator-apisix/issues/991#issuecomment-568406233
 
 
   @totemofwolf I don't think this a bug, the last number in the `key` is not route id, is the configure version: https://github.com/apache/incubator-apisix/blob/master/lua/apisix/plugins/limit-count.lua#L114

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


With regards,
Apache Git Services

[GitHub] [incubator-apisix] moonming commented on issue #991: bug: mismatch Redis key and routes' id when updating /apisix/admin/routes

Posted by GitBox <gi...@apache.org>.
moonming commented on issue #991: bug: mismatch Redis key and routes' id when updating /apisix/admin/routes
URL: https://github.com/apache/incubator-apisix/issues/991#issuecomment-568406458
 
 
   Welcome to submit PR to make the `key` more readable

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


With regards,
Apache Git Services

[GitHub] [incubator-apisix] moonming closed issue #991: bug: mismatch Redis key and routes' id when updating /apisix/admin/routes

Posted by GitBox <gi...@apache.org>.
moonming closed issue #991: bug: mismatch Redis key and routes' id when updating /apisix/admin/routes
URL: https://github.com/apache/incubator-apisix/issues/991
 
 
   

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


With regards,
Apache Git Services