Error "Cannot complete login due to an incorrect user name or password" when downloading or enabling download for Media in VMware Cloud Director
search cancel

Error "Cannot complete login due to an incorrect user name or password" when downloading or enabling download for Media in VMware Cloud Director

book

Article ID: 320456

calendar_today

Updated On:

Products

VMware Cloud Director VMware vCenter Server

Issue/Introduction

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.

    • Within the log file /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
    • Within the ESXi log file /var/log/vmware/hostd.log the following error is observed:
      [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)

Environment

VMware Cloud Director 10.x

VMware vSphere 7.x and later

Cause

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.

Resolution

To resolve this issue, the file lock must be released by unmounting the ISO from all Virtual Machines.

  1. Identify the affected ISO: Note the filename of the media failing to download (e.g., media-b3800554-f56...iso).

  2. Locate Mounted VMs: Search the vSphere inventory for any Virtual Machines that have this specific ISO mounted in their CD/DVD drives.

  3. 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.

  4. 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.

Additional Information

Power Off a Virtual Machine in the VMware Cloud Director Tenant Portal

Eject Media from a VM in the VMware Cloud Director Tenant Portal