"com.vmware.vcloud.api.presentation.service.InternalServerErrorException" while mounting ISO to a VM in VMware Cloud Director
search cancel

"com.vmware.vcloud.api.presentation.service.InternalServerErrorException" while mounting ISO to a VM in VMware Cloud Director

book

Article ID: 383477

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Mounting ISO to a VM or downloading a file from catalog in VMware Cloud Director fails with 'Internal Server Error' 
  • 'Enabled download of Media File' task in VCD fails with NullPointerException and Object value is empty in the task details.

  • You will be noticing an exception "com.vmware.vcloud.val.http.impl.VCenterUrlFactoryImpl.getVcenterDatastoreFileUrl" in the /opt/vmware/vcloud-director/logs/vcloud-container-debug.log as shown below:
    2024-xx-xx xx:xx:01,xxx | ERROR    | task-service-activity-pool-16025 | FutureUtil                     | Error waiting for export | requestId=xxxxxxxxxxxxxxxxxxxxxxx,request=POST https://<VCD-FQDN>/api/media/xxxxxxxx/action/enableDownload,requestTime=1xxxxxx2,remoteAddress=x.x.x.x:xxxx,userAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ...,accept=a
    pplication/*+xml;version 39.0.0-alpha vcd=xxxxxxxxxxxxxxxxxxxx,task=xxxxxxxxxxxxxxxxx activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:xxxxxxxxxxxxxxxxxxx) vcd=xxxxxxxxxxxxxxxx,task=xxxxxxxxxxxxxxxxxxxxx activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:xxxxxxxxxxxxxxxxxxxxxxxxxxx)
    com.vmware.vcloud.fabric.storage.copy.CompleteFailureException
            at com.vmware.vcloud.fabric.storage.copy.impl.HttpFileCopyService.getFutureValue(HttpFileCopyService.java:201)
            at com.vmware.vcloud.fabric.storage.copy.impl.HttpFileCopyService.copyFromDatastore(HttpFileCopyService.java:95)
            at com.vmware.vcloud.fabric.storage.media.impl.ExportMediaActivity$ExportMediaPhase.invoke(ExportMediaActivity.java:142)
            at com.vmware.vcloud.activity.executors.ActivityRunner.runPhase(ActivityRunner.java:175)
            at com.vmware.vcloud.activity.executors.ActivityRunner.run(ActivityRunner.java:112)
            at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
            at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
            at java.base/java.lang.Thread.run(Thread.java:829)
    Caused by: com.vmware.ssdc.util.LMException: Internal Server Error
            at com.vmware.ssdc.util.LMException.wrap(LMException.java:128)
            at com.vmware.ssdc.library.ExceptionFactory.createFromMultiple(ExceptionFactory.java:32)
            at com.vmware.vcloud.fabric.storage.copy.impl.AbstractFileCopyActivity$ProcessFutureResultsPhase.invoke(AbstractFileCopyActivity.java:130)
            ... 7 more
    Caused by: com.vmware.vcloud.api.presentation.service.InternalServerErrorException: Internal Server Error
            at com.vmware.vcloud.common.future.FutureUtil.convertExecutionException(FutureUtil.java:264)
            at com.vmware.vcloud.common.future.FutureUtil.waitForFuture(FutureUtil.java:129)
            at com.vmware.vcloud.fabric.storage.copy.impl.AbstractFileCopyActivity$ProcessFutureResultsPhase.invoke(AbstractFileCopyActivity.java:116)
            ... 7 more
    Caused by: java.lang.NullPointerException
            at com.vmware.vcloud.val.http.impl.VCenterUrlFactoryImpl.getVcenterDatastoreFileUrl(VCenterUrlFactoryImpl.java:34)
            at com.vmware.vcloud.val.filetransfer.impl.FileTransferServiceImpl$TransferHelper.<init>(FileTransferServiceImpl.java:185)
            at com.vmware.vcloud.val.filetransfer.impl.FileTransferServiceImpl$1.run(FileTransferServiceImpl.java:104)
            at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
            at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
            at com.vmware.vcloud.val.filetransfer.impl.FileTransferServiceImpl.getDatastoreFile(FileTransferServiceImpl.java:116)
            at com.vmware.vcloud.fabric.storage.copy.impl.DownloadDatastoreFileActivity$FileCopyPhase.invoke(DownloadDatastoreFileActivity.java:77)
            ... 7 more

Environment

VMware Cloud Director

VMware vCenter Server

Cause

This issue occurs when the datastore containing the files is missing in vCenter Server.

 

Resolution

To check which datastore is being referred in the Database, take SSH to the primary VCD cell as root user. 

  • Connect to the VCD Database: sudo -i -u postgres psql vcloud
  • Execute the select query and note down the dstore_moref value from the output.
    select * from managed_media where media_name='<File_name>';

     

  • Open the vCenter URL https://<vCenter_FQDN>/mob/?moid=<dstore_moref> in your browser and verify if the specified datastore is valid. If you encounter an "HTTP ERROR 404," it indicates that the underlying vCenter no longer has access to the datastore.
If the datastore containing the ISO/media files is decommissioned in vCenter Server, the files must be re-uploaded to the catalog in VCD before any required operations can be performed.