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 2022/01/26 03:12:35 UTC

[GitHub] [apisix] jthann opened a new issue #6206: bug: nacos discovery config valid error when using special char password symbol in config.yaml

jthann opened a new issue #6206:
URL: https://github.com/apache/apisix/issues/6206


   ### Issue description
   
   When using special characters in nacos password  in config.yaml following the document from [https://apisix.apache.org/docs/apisix/discovery/nacos](url).
   At starting time the json schema validator report error and apisix start failure
   
   
   ### Environment
   
   - apisix version (cmd: `apisix version`):  2.11.0
   - OS (cmd: `uname -a`):  macOS Big Sur 11.3.1
   
   
   ### Steps to reproduce
   
   1、Config following yaml fragment in config.yaml
   ```yaml 
   discovery:
     nacos:
       host:
         - "http://nacos:NOK1&(&*!#3@127.0.0.1:8848"
   ```
   2、Start apisix
   
   ### Actual result
   
   apisix start failure and report error
   
   ### Error log
   
   ```log
   2022/01/26 11:02:52 [error] 15735#7581333: init_worker_by_lua error: [string "jsonschema:anonymous"]:43: invalid option '%]' to 'format'
   stack traceback:
   	[C]: in function 'string_format'
   	[string "jsonschema:anonymous"]:43: in function 'var_0_4'
   	[string "jsonschema:anonymous"]:60: in function 'var_0_3'
   	[string "jsonschema:anonymous"]:211: in function 'check'
   	.../apisix-2.11.0/apisix/discovery/nacos.lua:382: in function 'init_worker'
   	.../apisix-2.11.0/apisix/discovery/init.lua:35: in function 'init_worker'
   	.../gts-apigw/apisix-2.11.0/apisix/init.lua:109: in function 'http_init_worker'
   	init_worker_by_lua:2: in main chunk
   ```
   
   ### Expected result
   
   _No response_


-- 
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-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] leslie-tsang commented on issue #6206: bug: nacos discovery config valid error when using special character password symbol in config.yaml

Posted by GitBox <gi...@apache.org>.
leslie-tsang commented on issue #6206:
URL: https://github.com/apache/apisix/issues/6206#issuecomment-1022483263


   Hello there, The `host` match pattern for the APISIX `v2.11` `nacos` plugin is `^http(s)?:\/\/[a-zA-Z0-9-_.:\@%]+$`
   Refer to [nacos.lua](https://github.com/apache/apisix/blob/release%2F2.11/apisix/discovery/nacos.lua#L47), the error may caused by [jsonschema](https://github.com/api7/jsonschema/blob/d6a0155586eead4db99f82f399ac56c4e614b130/lib/jsonschema.lua#L944-L948).
   > jsonschema will generate a dynamic code 
   ```lua
   retrun false, string.format([[failed to match pattern "^http(s)?:\\/\\/[a-zA-Z0-9-_.:\\@%]+$" with %q]], "http://nacos:NOK1&(&*!#3@127.0.0.1:8848")
   ```
   I don't know if I'm wrong. also cc @spacewander 
   


-- 
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-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] spacewander closed issue #6206: bug: nacos discovery config valid error when using special character password symbol in config.yaml

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


   


-- 
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-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] tzssangglass commented on issue #6206: bug: nacos discovery config valid error when using special character password symbol in config.yaml

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


   > ```yaml
   > NOK1&(&*!#3@127.0.0.1:8848
   > ```
   
   can you change `NOK1&(&*!#3@127.0.0.1:8848` to normal String to verify if this error is special characters caused by.


-- 
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-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] spacewander commented on issue #6206: bug: nacos discovery config valid error when using special character password symbol in config.yaml

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


   Yes. We should fix host match pattern.


-- 
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-unsubscribe@apisix.apache.org

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