registerTemplate / registerIso accept a 2048-character URL, but vm_template.url holds 1024
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
閱讀 RegisterTemplateCmd、RegisterIsoCmd 和 VMTemplateVO,然後將它們的 URL 長度與 vm_template.url 的定義以及現有升級指令碼進行比較。遵循 schema-41900to41910.sql 中的遷移模式,並檢查相關 URL 欄位是如何擴大的。資料庫限制與可接受的 URL 長度相符,且升級指令碼能順利套用,即表示完成。
由索引模型根據 Issue 內容生成。
描述
problem
registerTemplate and registerIso declare their url parameter with length = 2048, and VMTemplateVO maps the column with length = 2048. The column itself is VARCHAR(1024): #8675 (the fix for #8669, released in 4.19.1) widened it from 255 to 1024 in schema-41900to41910.sql, and no later upgrade script changes it.
A URL of 1025 to 2048 characters therefore passes the API's length check and fails afterwards, when the template row is written. The caller gets a generic internal error that names neither the URL nor a limit: seen in practice with a presigned URL of about 1700 characters, which came back as HTTP 530 with cserrorcode 4250. The cause given here is from reading the source.
URLs of that length are ordinary for object storage. An S3 presigned URL signed with temporary credentials (an instance role, a task role, an assumed role) carries an X-Amz-Security-Token of about a thousand characters and usually comes to 1500–1800 characters in all. The same object signed with a long-lived access key gives a URL of 500–600 characters, which registers. #8669 was this trigger at the old 255 limit.
The sibling columns were widened to 2048 back in 4.8 (schema-471to480.sql: template_store_ref.url, volume_store_ref.url, volume_store_ref.download_url, upload.url, image_store.url). vm_template.url is the one left behind.
versions
Read in the source at tags 4.20.0.0 and 4.23.0.0 and on main (2026-11-16): RegisterTemplateCmd, RegisterIsoCmd, VMTemplateVO, schema-41900to41910.sql. By the upgrade scripts, every release from 4.19.1 on has the 1024 column.
The steps to reproduce the bug
- Take any reachable template URL and pad its query string until the whole URL is longer than 1024 characters and shorter than 2048 (or presign an S3 object with temporary credentials).
- Call
registerTemplate(orregisterIso) with it. - The call fails with a generic internal error instead of registering the template.
A URL of 1024 characters or fewer for the same object registers.
What to do about it?
Widen vm_template.url to VARCHAR(2048) in an upgrade script, so the column matches the API parameter, the VO and the sibling tables. Failing that, lower the parameter's length to 1024 so the API refuses the URL with a message that names the limit.
- 主要語言
- Java
- 星號
- 3.1k
- 分支
- 1.4k
- 平均合併
- 7 天 4 小時
- 30 天內合併 PR
- 13
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
apache/cloudstack 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
apache/cloudstack#14719 ·
維護者通常 1 天內回覆
-
resizeVolume of a running system VM's volume is accepted but the VM never sees the new size可能已有人在做 @bhouse-nexthop 於 7 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
apache/cloudstack#14645 · 1 則留言 ·
維護者通常 1 天內回覆
-
VR reports a load balancer change as applied when haproxy.cfg cannot be replaced可能已有人在做 @bhouse-nexthop 於 7 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
apache/cloudstack#14633 · 1 則留言 ·
維護者通常 1 天內回覆
-
restartNetwork reports a ResourceUnavailableException as an unexpected error (530), unlike restartVPC (534)可能已有人在做 @bhouse-nexthop 於 7 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
apache/cloudstack#14631 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
apache/cloudstack#14625 · 1 則留言 ·
維護者通常 1 天內回覆
查看 apache/cloudstack 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 75/100
SAP/ai-sdk-java#1206 ·
維護者通常 1 天內回覆
-
enhancement good first issue insight-module
難度 2/5 1-3 小時 新手友好度 86/100
sdlc-pro/spring-lens#606 ·
維護者通常 1 天內回覆
-
quality-assurance
難度 2/5 1-3 小時 新手友好度 62/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#252 ·
維護者通常 1 天內回覆
-
backlog kind/bug
難度 2/5 1-3 小時 新手友好度 83/100
TencentBlueKing/bk-job#4627 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 63/100
openrocket/openrocket#3460 ·
維護者通常 1 天內回覆