You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "yujiapingyu (via GitHub)" <gi...@apache.org> on 2023/11/06 09:09:16 UTC

[I] bug: admin-api在保存上游配置时对nodes的检查有bug [apisix]

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

   ### Current Behavior
   
   ![image](https://github.com/apache/apisix/assets/17950204/5958912b-16b9-4a4d-adb4-a965832cd980)
   nodes_schema中的port不是必须的呀,辛苦修复一下,会导致通过admin api put上游时,如果node是array形式,无法通过校验!
   
   ### Expected Behavior
   
   _No response_
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   1. 运行APISIX;
   2. 给admin api发送请求:
   ![image](https://github.com/apache/apisix/assets/17950204/84edd8b6-181c-4bd5-94aa-b60bf417b35d)
   
   
   ### Environment
   
   - APISIX version (run `apisix version`):3.4.1
   - Operating system (run `uname -a`):23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:43:05 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6020 arm64
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`): 3.5.0
   - APISIX Dashboard version, if relevant:3.0.0
   - 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: notifications-unsubscribe@apisix.apache.org.apache.org

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


Re: [I] bug: there is a bug in the schema check of nodes when admin-api saves the upstream configuration. [apisix]

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 closed issue #10455: bug: there is a bug in the schema check of nodes when admin-api saves the upstream configuration.
URL: https://github.com/apache/apisix/issues/10455


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


Re: [I] bug: there is a bug in the schema check of nodes when admin-api saves the upstream configuration. [apisix]

Posted by "yujiapingyu (via GitHub)" <gi...@apache.org>.
yujiapingyu commented on issue #10455:
URL: https://github.com/apache/apisix/issues/10455#issuecomment-1797848680

   
   I think "port is optional" is reasonable. Because when my node is a domain name, I don’t need to provide a port.


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


Re: [I] bug: there is a bug in the schema check of nodes when admin-api saves the upstream configuration. [apisix]

Posted by "yujiapingyu (via GitHub)" <gi...@apache.org>.
yujiapingyu commented on issue #10455:
URL: https://github.com/apache/apisix/issues/10455#issuecomment-1797824107

   https://apisix.apache.org/zh/docs/apisix/admin-api/#upstream
   ![image](https://github.com/apache/apisix/assets/17950204/5c1e8e12-b972-419f-af20-de8d2bee25bf)
   Excerpted from official documentation,port is optional!
   
   And when I set nodes as hashmap, like this:
   ```
   {
     "nodes": {
        "ops-kuber.newlink.com": 1
      },
     "retries": 0,
     "timeout": {
       "connect": 6,
       "send": 6,
       "read": 6
     },
     "type": "roundrobin",
     "scheme": "https",
     "pass_host": "node",
     "name": "认证服务",
     "desc": "认证服务",
     "keepalive_pool": {
       "idle_timeout": 60,
       "requests": 1000,
       "size": 320
     }
   }
   ```
   It becomes valid.


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


Re: [I] bug: there is a bug in the schema check of nodes when admin-api saves the upstream configuration. [apisix]

Posted by "yujiapingyu (via GitHub)" <gi...@apache.org>.
yujiapingyu commented on issue #10455:
URL: https://github.com/apache/apisix/issues/10455#issuecomment-1797716237

   ```json
   {
     "nodes": [
       {
         "host": "ops-kuber.newlink.com",
         "weight": 1
       }
     ],
     "retries": 0,
     "timeout": {
       "connect": 6,
       "send": 6,
       "read": 6
     },
     "type": "roundrobin",
     "scheme": "https",
     "pass_host": "node",
     "name": "认证服务",
     "desc": "认证服务",
     "keepalive_pool": {
       "idle_timeout": 60,
       "requests": 1000,
       "size": 320
     }
   }
   ```
   This is a legitimate upstream,but it can not be saved. 


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


Re: [I] bug: there is a bug in the schema check of nodes when admin-api saves the upstream configuration. [apisix]

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on issue #10455:
URL: https://github.com/apache/apisix/issues/10455#issuecomment-1806663485

   Yeah if you use the other configuration schema, port isn't checked upon.
   
   ![image](https://github.com/apache/apisix/assets/39619599/5808fd27-72e8-4be2-91b5-136b27a3e265)
   


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


Re: [I] bug: there is a bug in the schema check of nodes when admin-api saves the upstream configuration. [apisix]

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on issue #10455:
URL: https://github.com/apache/apisix/issues/10455#issuecomment-1851710724

   considered resolved


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


Re: [I] bug: there is a bug in the schema check of nodes when admin-api saves the upstream configuration. [apisix]

Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #10455:
URL: https://github.com/apache/apisix/issues/10455#issuecomment-1797706461

   Could you please paste the configuration here?


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


Re: [I] bug: there is a bug in the schema check of nodes when admin-api saves the upstream configuration. [apisix]

Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #10455:
URL: https://github.com/apache/apisix/issues/10455#issuecomment-1797833280

   even the code says port is required: https://github.com/apache/apisix/blob/266ace7b82c9bb10dcf68c3ddf727701157f5173/apisix/schema_def.lua#L328
   
   Would you like to raise a PR to update the document?


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


Re: [I] bug: there is a bug in the schema check of nodes when admin-api saves the upstream configuration. [apisix]

Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #10455:
URL: https://github.com/apache/apisix/issues/10455#issuecomment-1797818280

   this isn't valid as `port` is required.


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