Skip to content

fix(console): ZSTAC-85595 listen on IPv6 proxy host#4122

Closed
zstack-robot-1 wants to merge 1 commit into
feature-5.5.28-IPv6-management-networkfrom
sync/shixin.ruan/shixin-ZSTAC-85595
Closed

fix(console): ZSTAC-85595 listen on IPv6 proxy host#4122
zstack-robot-1 wants to merge 1 commit into
feature-5.5.28-IPv6-management-networkfrom
sync/shixin.ruan/shixin-ZSTAC-85595

Conversation

@zstack-robot-1
Copy link
Copy Markdown
Collaborator

Root cause:
Console proxy returned the MN IPv6 address to clients, but the console agent listen address was selected from agentIp. For management-node console proxy agent, agentIp is 127.0.0.1, so websockify listened on IPv4 only while API returned [fd00:172:24:246::247].

Fix:
Select the console proxy wildcard listen address from the client-facing proxy hostname instead of agentIp. When the proxy hostname is IPv6, the console proxy agent receives :: and websockify listens for IPv6 clients.

Jira:
http://jira.zstack.io/browse/ZSTAC-85595
Linked e2e task: http://jira.zstack.io/browse/ZSTAC-85504

Verification:

  • mvn -Dmaven.test.skip=true clean install
  • mvn -f test/pom.xml -Dtest=org.zstack.test.integration.core.ManagementNetworkIpv6Case test
  • Hotfix verified on http://172.24.246.247:5000/: RequestConsoleAccess returned hostname [fd00:172:24:246::247], port 4900.
  • curl -g http://[fd00:172:24:246::247]:4900/ returned HTTP 405 instead of connection refused.
  • curl http://172.24.246.247:4900/ returned HTTP 405.

sync from gitlab !10021

Console proxy returned the MN IPv6 address to clients but selected the
listen address from agentIp, which is 127.0.0.1 for the management-node
agent. Use the client-facing proxy hostname to choose the wildcard
listen address so IPv6 console URLs are reachable.

Resolves: ZSTAC-85595

Change-Id: Ief18c9b847f0e0c050ce993a50244533614fd2b8
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml (via .coderabbit.yaml)

Review profile: CHILL

Plan: Pro

Run ID: 4b843b5d-b3c6-4aba-b282-675e1e333f96

📥 Commits

Reviewing files that changed from the base of the PR and between 3df089c and 46cd118.

📒 Files selected for processing (2)
  • console/src/main/java/org/zstack/console/ConsoleProxyBase.java
  • test/src/test/groovy/org/zstack/test/integration/core/ManagementNetworkIpv6Case.groovy

概览

该PR更新了ConsoleProxyBase中的代理主机名设置逻辑,改用getProxyHostname()替代getAgentIp(),并将相关helper方法的参数名从agentIp改为proxyHostname以保持语义一致。同步更新了对应的集成测试方法名称。

变更

控制台代理主机名参数统一

层级 / 文件 摘要
代理主机名设置和监听地址选择逻辑
console/src/main/java/org/zstack/console/ConsoleProxyBase.java
建立代理连接时,cmd.setProxyHostname()的输入从self.getAgentIp()改为self.getProxyHostname()selectProxyListenHostname方法参数名从agentIp改为proxyHostname,IPv6/IPv4判断逻辑不变。
测试方法重命名以匹配参数语义变化
test/src/test/groovy/org/zstack/test/integration/core/ManagementNetworkIpv6Case.groovy
测试方法和其调用从testConsoleProxyListenHostByAgentIpVersion重命名为testConsoleProxyListenHostByProxyIpVersion,以反映参数命名变化。

代码审查工作量评估

🎯 1 (简单) | ⏱️ ~5 分钟

代理的名字改了新,
从Agent到Proxy的音韵,
参数重命名保逻辑真,
测试方法跟随齐齐进,
一次小重构,百般清新!🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 标题遵循了指定的格式 [scope]: ,且字符长度为51个,符合72字符以内的要求,清晰描述了修复IPv6代理主机监听问题的主要改动。
Description check ✅ Passed 描述详细说明了根本原因、修复方案、Jira关联信息和验证步骤,与变更内容高度相关,清晰解释了为什么需要将agentIp改为proxyHostname。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/shixin.ruan/shixin-ZSTAC-85595

Comment @coderabbitai help to get the list of available commands and usage tips.

@MatheMatrix MatheMatrix deleted the sync/shixin.ruan/shixin-ZSTAC-85595 branch May 28, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants