Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【建议】服务来源地址和端口配置采用有效性校验 #930

Open
huangye123 opened this issue Apr 30, 2024 · 1 comment
Open
Assignees

Comments

@huangye123
Copy link

【现象】配置Higress的Nacos网关的IP地址手误录入为127.0.0,1 后面中逗号了。重启后无法进入Web控制台。
2024-04-30T10:46:24.619122Z info new nacos2 watcher with config Name:nacos103
2024-04-30T10:46:24.619158Z info [INFO] logDir:</var/log/nacos/log/> cacheDir:</var/log/nacos/cache/>
2024-04-30T10:46:24.619307Z error can not create naming client, err:Post "http://127.0.0,1:8848/nacos/v1/auth/users/login": dial tcp: lookup 127.0.0,1: no such host
2024-04-30T10:46:24.719268Z info ads Push debounce stable[2] 2 for config ServiceEntry/higress-system/mcpbridge-serviceentry: 100.63358ms since last change, 100.704802ms since last push, full=true
2024-04-30T10:46:24.719416Z info ingress resource type networking.istio.io/v1alpha3/ServiceEntry, configs number 13
2024-04-30T10:46:24.719516Z info ingress Found http2rpc serviceEntries [%!s(*memory.ServiceEntryWrapper=&{ 0xc000a37a40 {13944359269867304518 245671387 0x516ba20}}) %!s(*memory.ServiceEntryWrapper=&{ 0xc000cf60c0 {13944359269867400141 245767000 0x516ba20}})]
2024-04-30T10:46:24.719529Z info ads XDS: Pushing:2024-04-30T10:46:24Z/2 Services:0 ConnectedEndpoints:0 Version:2024-04-30T10:46:24Z/2
2024-04-30T10:46:34.619694Z error ReconcileRegistries failed, err:new nacos2 watcher timeout
2024-04-30T10:46:34.619714Z error ingress Mcpbridge reconcile failed, err:ReconcileRegistries failed, Init Watchers failed

image

【建议】
1、IP地址和端口号在前端增加有效性验证,避免录入非法的信息。

2、Nacos配置信息有误,也不影响Web控制台的登录。

@CH3CHO
Copy link
Collaborator

CH3CHO commented Apr 30, 2024

这里至少有两个问题:

  1. 服务来源配置是不影响控制台登录的,除非是要通过网关来访问控制台。这个操作是我们不推荐的。你可以使用 hgctl dashboard console 命令直接开启控制台,或使用 kubectl port-forward service/higress-console -n higress-system 8080:8080 将控制台端口映射到本地,然后使用 http://localhost:8080 地址直接访问控制台;
  2. 服务来源配置里是不可以用 127.0.0.1 这种 loopback IP 的。因为这个地址是用于 Higress Controller 获取服务注册信息的。而从 Higress Controller 角度看,127.0.0.1 是它自己的 Pod,而不是你的宿主机。

控制台的输入校验问题我后面会看一下。

@CH3CHO CH3CHO self-assigned this Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants