registerTemplate / registerIso accept a 2048-character URL, but vm_template.url holds 1024
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 77/100
Piste de recherche
Lisez RegisterTemplateCmd, RegisterIsoCmd et VMTemplateVO, puis comparez la longueur de leurs URL à la définition de vm_template.url et aux scripts de mise à niveau existants. Suivez le modèle de migration de schema-41900to41910.sql et vérifiez comment les colonnes URL des champs apparentés ont été élargies. Le travail est terminé lorsque la limite de la base de données correspond à la longueur d’URL acceptée et que le script de mise à niveau s’applique sans erreur.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Java
- Étoiles
- 3.1k
- Forks
- 1.4k
- Merge moyen
- 7 j 4 h
- PR mergées (30 j)
- 13
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/cloudstack
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
apache/cloudstack#14719 ·
Les mainteneurs répondent en général sous 1 jour
-
resizeVolume of a running system VM's volume is accepted but the VM never sees the new sizePeut-être pris @bhouse-nexthop l’a pris il y a 7 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
apache/cloudstack#14645 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
VR reports a load balancer change as applied when haproxy.cfg cannot be replacedPeut-être pris @bhouse-nexthop l’a pris il y a 7 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/cloudstack#14633 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
restartNetwork reports a ResourceUnavailableException as an unexpected error (530), unlike restartVPC (534)Peut-être pris @bhouse-nexthop l’a pris il y a 7 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/cloudstack#14631 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
apache/cloudstack#14625 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de apache/cloudstack
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 75/100
SAP/ai-sdk-java#1206 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement good first issue insight-module
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
sdlc-pro/spring-lens#606 ·
Les mainteneurs répondent en général sous 1 jour
-
quality-assurance
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#252 ·
Les mainteneurs répondent en général sous 1 jour
-
backlog kind/bug
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
TencentBlueKing/bk-job#4627 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 63/100
openrocket/openrocket#3460 ·
Les mainteneurs répondent en général sous 1 jour