Skip to content

Template upload shows generic "Request failed with status code 500" instead of actual error message #11513

@rybakovanton-metta

Description

@rybakovanton-metta

problem

ISSUE TYPE
  • Bug Report
COMPONENT NAME
UI, Template Upload, Error Handling
SUMMARY

Template upload shows generic "Request failed with status code 500" error in UI instead of displaying the actual server error message, making debugging
impossible for users.

versions

CLOUDSTACK VERSION
4.20.1.0
CONFIGURATION

Advanced networking, KVM hypervisor

OS / ENVIRONMENT

Ubuntu 22.04, KVM hosts

The steps to reproduce the bug

STEPS TO REPRODUCE
1. Go to Templates → Register Template
2. Upload a QCOW2 file that has format detection issues (e.g., with DOS/MBR boot sector)
3. Select "QCOW2" as format
4. Click Register Template
5. Observe error message in UI

What to do about it?

EXPECTED RESULTS
UI should display the actual error message from server, such as:
"File type mismatch between uploaded file and selected format. Selected file format: QCOW2. Received: DOS/MBR boot sector, extended partition table (last)"
ACTUAL RESULTS
UI shows useless generic error:
"Upload Failed - Failed to upload Template - Error: Request failed with status code 500"

Meanwhile server logs show the actual useful error:
2025-08-25 20:53:50,648 WARN [c.c.a.AlertManagerImpl] Template Template {"format":"QCOW2","id":224,"name":"Ubuntu Server 24.04 Custom"} failed to upload.
Error details: File type mismatch between uploaded file and selected format. Selected file format: QCOW2. Received: DOS/MBR boot sector, extended partition
table (last)

Users are forced to check server logs to understand why uploads fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions