Error: "Invalid response code: 500" when trying to import the OVF
search cancel

Error: "Invalid response code: 500" when trying to import the OVF

book

Article ID: 385799

calendar_today

Updated On:

Products

VMware vSphere ESXi 7.0 VMware vSphere ESXi 8.0

Issue/Introduction

  • Import OVF failed due to "response code: 500"
  • When using vSphere Client, you may see errors as below.
    # (VC) /var/log/vmware/content-library/cls.log
    
    YYYY-MM-DDThh:mm:ss.###Z | ERROR    | m4qzkm5i-220444-auto-4q3h-h5:70046326-d1-95 | cls-simple-activity-13    | ImportSessionActivity          | OVF import session 3b0dcf84-ab81-4802-ac01-b6f8406ba85f failed with server error.
    com.vmware.vapi.std.errors.ServiceUnavailable: ServiceUnavailable (com.vmware.vapi.std.errors.service_unavailable) => {
        messages = [LocalizableMessage (com.vmware.vapi.std.localizable_message) => {
        id = com.vmware.ovfs.ovfs-main.ovfs.transfer_failed,
        defaultMessage = Transfer failed: Invalid response code: 500.,
        args = [Invalid response code: 500],
        params = <null>,
        localized = <null>
    }],
        data = <null>,
        errorType = SERVICE_UNAVAILABLE
    }
    :::
    YYYY-MM-DDThh:mm:ss.###Z | DEBUG    | m4qzkm5i-220444-auto-4q3h-h5:70046326-d1-95 | cls-simple-activity-13    | ImportSessionActivity          | Completing import lease ManagedObjectReference: type = HttpNfcLease, value = session[52691d6c-73af-c65c-8068-90a16e0aa234]52e3c630-12b5-0026-b26f-7a03b257de18, serverGuid = e62cf0fb-15c5-4495-9264-f22d92e67e13 (exception: (vim.fault.OvfImportFailed) {
       faultCause = (vmodl.fault.SystemError) {
          faultCause = null,
          faultMessage = (vmodl.LocalizableMessage) [
             (vmodl.LocalizableMessage) {
                dynamicType = null,
                dynamicProperty = null,
                key = com.vmware.ovfs.ovfs-main.ovfs.transfer_failed,
                arg = (vmodl.KeyAnyValue) [
                   (vmodl.KeyAnyValue) {
                      dynamicType = null,
                      dynamicProperty = null,
                      key = 0,
                      value = Invalid response code: 500
                   }
                ],
                message = Transfer failed: Invalid response code: 500.
             }
          ],
          reason = 
       },
       faultMessage = null
    })

     

  • When using ovftool to deploy OVF directly to ESXi host, you may see error below 
    # example output for terminal
    
    PS C:\Program Files\VMware\VMware OVF Tool> .\ovftool.exe -ds=### 'C:\Users\Administrator\Downloads\photon ovf\photon-ovf-test.ovf' vi://root:########@###.###.###.###
    Deploying to VI: vi://root@###.###.###.###:443/
    Transfer Failed
    Error: Failed to transfer file [photon-ovf-test-0.vmdk] to host [###.###.###.###] (response code:500)
    Warning:
     - No manifest file found.
     - Wrong file size specified in OVF descriptor for 'photon-ovf-test-1.vmdk' (specified: -1, actual 232236032).
    Completed with errors
    
    # (ESXi) /var/run/log/hostd.log
    
    YYYY-MM-DDThh:mm:ss.###Z Er(163) Hostd[2098442]: [Originator@6876 sub=Httpnfcsvc] Error on read, error: -1
    YYYY-MM-DDThh:mm:ss.###Z Er(163) Hostd[2098442]: [Originator@6876 sub=Httpnfcsvc] [DiskUploadWorker] Error reading input: Error on read, error: -1

Environment

VMware vSphere ESXi 8.0.X

VMware vSphere ESXi 7.0.X

Cause

  • This could happen because of a corrupted vmdk file included in OVF files. Import OVF may failed with "response code: 500" if OVF includes corrupted vmdk files.
  • If .mf file is available, we could check whether vmdk is corrupted or not by comparing the vmdk hash in .mf file with an actual hash value 
    # In this case, vmdk hash value is different from an actual hash value, which means this vmdk file is corrupted.
    
    PS C:\Users\Administrator\Downloads\photon ovf> cat .\photon-ovf-test.mf
    SHA256(photon-ovf-test-2.nvram)= a79d8d4ea6fcb63ef8b90b3e872a5d5382ec25b8d3af5dc09d1bab24f5f3ef28
    SHA256(photon-ovf-test.ovf)= 117d07136d2b8cbafd834c1fe2c5fe3ea22f0c854b59fdfac9fdf60e5ea85301
    SHA256(photon-ovf-test-1.vmdk)= 23eff1cfb80c92f8d7adc66b08ac9248ef0e83000d7c42eb513db43c9af1c0fe
    
    PS C:\Users\Administrator\Downloads\photon ovf> Get-FileHash .\photon-ovf-test-1.vmdk
    
    Algorithm       Hash                                                                   Path
    ---------       ----                                                                   ----
    SHA256          173477E727467FA9A737F6CE66DFCE290DAF4651AD1FC6E34A619F84E6CC09E9       C:\Users\Administrator\Downlo...

Resolution

  1. To deploy OVF successfully, files cannot be corrupted
  2. There is no workaround for this.