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

   ### Current Behavior
   
   1. With plugin_config_id: 123456789123456789 (18 characters), the route 
could not be created. When I use plugin_config_id: 12345678912345 (14 
characters) the route can be created successfully.
   2. I can successfully create plugin_config with id `123456789123456789` (18 
characters).
   
   
   ### Expected Behavior
   
   When I use plugin_config_id: 123456789123456789 (18 characters) the route 
can be created successfully.
   
   ### Error Logs
   
   2022/10/31 08:23:22 [info] 65#65: *28197 [lua] init.lua:131: handler(): uri: 
["","apisix","admin","routes","1"], client: 172.18.0.1, server: , request: "PUT 
/apisix/admin/routes/1 HTTP/1.1", host: "127.0.0.1:9180"
   2022/10/31 08:23:22 [info] 65#65: *28197 [lua] routes.lua:53: check_conf(): 
schema: {"properties":{"uris":{"items":{"type":"string","description":"HTTP 
uri"},"uniqueItems":true,"type":"array","minItems":1},"id":{"anyOf":[{"pattern":"^[a-zA-Z0-9-_.]+$","minLength":1,"type":"string","maxLength":64},{"type":"integer","minimum":1}]},"create_time":{"type":"integer"},"remote_addr":{"anyOf":[{"title":"IPv4","type":"string","format":"ipv4"},{"title":"IPv4\/CIDR","type":"string","pattern":"^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\/([12]?[0-9]|3[0-2])$"},{"title":"IPv6","type":"string","format":"ipv6"},{"title":"IPv6\/CIDR","type":"string","pattern":"^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?\/[0-9]{1,3}$"}],"type":"string","description":"client
 IP"},"script":{"minLength":10,"type":"string","maxLength":102
 
400},"update_time":{"type":"integer"},"hosts":{"items":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-._\\[\\]:]+$"},"uniqueItems":true,"type":"array","minItems":1},"remote_addrs":{"items":{"anyOf":[{"title":"IPv4","type":"string","format":"ipv4"},{"title":"IPv4\/CIDR","type":"string","pattern":"^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\/([12]?[0-9]|3[0-2])$"},{"title":"IPv6","type":"string","format":"ipv6"},{"title":"IPv6\/CIDR","type":"string","pattern":"^([a-fA-F0-9]{0,4}:){1,8}(:[a-fA-F0-9]{0,4}){0,8}([a-fA-F0-9]{0,4})?\/[0-9]{1,3}$"}],"type":"string","description":"client
 
IP"},"uniqueItems":true,"type":"array","minItems":1},"filter_func":{"minLength":10,"type":"string","pattern":"^function"},"vars":{"type":"array"},"name":{"minLength":1,"type":"string","maxLength":100},"status":{"default":1,"enum":[1,0],"type":"integer","d
 escription":"route status, 1 to enable, 0 to 
disable"},"enable_websocket":{"type":"boolean","description":"enable websocket 
for 
request"},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-._\\[\\]:]+$"},"plugins":{"type":"object"},"uri":{"minLength":1,"type":"string","maxLength":4096},"service_id":{"anyOf":[{"pattern":"^[a-zA-Z0-9-_.]+$","minLength":1,"type":"string","maxLength":64},{"type":"integer","minimum":1}]},"timeout":{"properties":{"send":{"type":"number","exclusiveMinimum":0},"read":{"type":"number","exclusiveMinimum":0},"connect":{"type":"number","exclusiveMinimum":0}},"required":["connect","send","read"],"type":"object"},"upstream":{"properties":{"id":{"anyOf":[{"pattern":"^[a-zA-Z0-9-_.]+$","minLength":1,"type":"string","maxLength":64},{"type":"integer","minimum":1}]},"create_time":{"type":"integer"},"retries":{"type":"integer","minimum":0},"retry_timeout":{"type":"number","minimum":0},"timeout":{"properties":{"send":{"type":"number","exclusiveMinimum":0},"read":{"type"
 
:"number","exclusiveMinimum":0},"connect":{"type":"number","exclusiveMinimum":0}},"required":["connect","send","read"],"type":"object"},"nodes":{"anyOf":[{"type":"object","patternProperties":{".*":{"minimum":0,"type":"integer","description":"weight
 of 
node"}}},{"type":"array","items":{"properties":{"priority":{"default":0,"type":"integer","description":"priority
 of node"},"metadata":{"type":"object","description":"metadata of 
node"},"port":{"minimum":1,"type":"integer","description":"port of 
node"},"weight":{"minimum":0,"type":"integer","description":"weight of 
node"},"host":{"type":"string","pattern":"^\\*?[0-9a-zA-Z-._\\[\\]:]+$"}},"required":["host","port","weight"],"type":"object"}}]},"type":{"type":"string","description":"algorithms
 of load 
balancing"},"hash_on":{"default":"vars","type":"string","enum":["vars","header","cookie","consumer","vars_combinations"]},"name":{"minLength":1,"type":"string","maxLength":100},"service_name":{"minLength":1,"type":"string","maxLength":256},"
 
checks":{"properties":{"active":{"type":"object","properties":{"http_path":{"type":"string","default":"\/"},"
   2022/10/31 08:23:22 [info] 65#65: *28197 [lua] routes.lua:54: check_conf(): 
conf  : 
{"plugin_config_id":1.2345678912346e+17,"methods":["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","CONNECT","TRACE"],"uri":"\/index.html","id":"1","upstream_id":"123456789123456789","name":"test","status":1},
 client: 172.18.0.1, server: , request: "PUT /apisix/admin/routes/1 HTTP/1.1", 
host: "127.0.0.1:9180"
   2022/10/31 08:23:22 [info] 65#65: *28197 [lua] v3.lua:181: _request_uri(): 
v3 request uri: /kv/range, timeout: 30, client: 172.18.0.1, server: , request: 
"PUT /apisix/admin/routes/1 HTTP/1.1", host: "127.0.0.1:9180"
   2022/10/31 08:23:22 [info] 65#65: *28197 [lua] v3.lua:70: choose_endpoint(): 
choose endpoint: http://127.0.0.1:2379, client: 172.18.0.1, server: , request: 
"PUT /apisix/admin/routes/1 HTTP/1.1", host: "127.0.0.1:9180"
   
   ### Steps to Reproduce
   
   1. run APISIX via docker images.
   2. create plugin_config.example
   ```
   curl http://127.0.0.1:9180/apisix/admin/plugin_configs/123456789123456789 \
   -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
   {
       "desc": "enable limit-count plugin",
       "plugins": {
           "limit-count": {
               "count": 2,
               "time_window": 60,
               "rejected_code": 503
           }
       }
   }'
   ```
   3. create route. example:
   ```
   curl -i http://127.0.0.1:9180/apisix/admin/routes/1 \
   -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
     "uri": "/index.html",
     "plugin_config_id": '123456789123456789',
     "name": "test",
     "upstream": {
           "type": "roundrobin",
           "nodes": {
               "web1:80": 1
           }
       }
   }'
   ```
   
   ### Environment
   
   - APISIX version (run `apisix version`):2.99
   - Operating system (run `uname -a`): via Docker 
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to