When attempting to download an ISO or Media file from a VMware Cloud Director (VCD) Catalog, the task fails.
Symptoms:
The VCD Tenant Portal displays: Cannot complete login due to an incorrect user name or password.
The error occurs during the "Enable Download" or "Download Media" phase.
/opt/vmware/vcloud-director/logs/vcloud-container-debug.log the following error is observed:2022-08-11 11:13:19,779 | DEBUG | storage-fabric-activity-pool-12 | NfcClientFacadeImpl | Unauthorized session still occurred after retrying with a new session on https://vcenter.example.com/sdk, abandon operation. | requestId=<requestid>,request=POST https://vcloud.example.com/api/media/<media-ia>/action/enableDownload,requestTime=1660216392659,remoteAddress=#.#.#.#:56536,userAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ...,accept=application/*+xml;version 36.2 vcd=<vcdid>,task=<taskid> activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:<uuid>) vcd=<vcdid>,task=<taskid> activity=(com.vmware.vcloud.backendbase.management.system.TaskActivity,urn:uuid:<uuid>) activity=(com.vmware.vcloud.fabric.storage.media.impl.ExportMediaActivity,urn:uuid:<uuid>) activity=(com.vmware.vcloud.fabric.storage.copy.impl.DownloadDatastoreFileActivity,urn:uuid:<uuid>)
HTTP error on GET https://vcenter.example.com/folder/vcd1/media/<media-path-id>/media-<media-id>.iso?dcPath=vcenter-DC&dsName=<datastore_name>: 500
at com.vmware.vcloud.val.nfc.client.impl.HttpTransferClientSession$StreamConsumer.execute(HttpTransferClientSession.java:116)
at com.vmware.vcloud.val.nfc.client.impl.HttpTransferClientSession.getFile(HttpTransferClientSession.java:154)
2022-08-11 11:13:19,806 | DEBUG | storage-fabric-activity-pool-12 | DownloadDatastoreFileActivity | [Activity Execution] Serializing Future: /vcd1/media/<media-path-id>/media-<media-id>.iso-> java.util.concurrent.FutureTask@25b25d29[Completed exceptionally: com.vmware.ssdc.util.LMException: Cannot complete login due to an incorrect user name or password.] - Handle: urn:uuid:<uuid>, Current Phase: DownloadDatastoreFileActivity$FileCopyPhase | requestId=<request-id>,request=POST https://vcloud.example.com/api/media/<medi-id>/action/enableDownload
[NFC ERROR]Sending Nfc error 13: NfcFssrvrOpen: Failed to open '[<datastore_name>]vcd1/media/<media-path-id>/media-<media-id>.iso': The file is locked or in use (NFC_FILE_LOCKED)
VMware Cloud Director 10.x
VMware vSphere 7.x and later
The error is caused by a file lock on the ISO media at the vSphere layer.
In vSphere 7.0 and later, if an ISO file is currently mounted to a powered-on Virtual Machine, vCenter Server restricts access to the file via the Datastore Browser and NFC (Network File Copy) services. When VCD attempts to access the file to generate a download URL, vCenter returns an HTTP 500 (Internal Server Error). VCD interprets this response from vCenter as a session or credential failure, leading to the misleading "incorrect user name or password" message.
To resolve this issue, the file lock must be released by unmounting the ISO from all Virtual Machines.
Identify the affected ISO: Note the filename of the media failing to download (e.g., media-b3800554-f56...iso).
Locate Mounted VMs: Search the vSphere inventory for any Virtual Machines that have this specific ISO mounted in their CD/DVD drives.
Unmount the Media:
Edit the Settings of the identified Virtual Machine(s).
Disconnect the CD/DVD drive or change the "Device Type" to Client Device.
Ensure the "Connected" and "Connect at Power On" boxes are unchecked.
Retry Download: Return to the VCD Tenant Portal and attempt to "Enable Download" again.
Workaround: If the ISO must remain mounted to a VM, you may clone the ISO within the VCD catalog to create a second instance and download the clone, as the clone will not have an active file lock.