vmware / govmomi

Go library for the VMware vSphere API
Apache License 2.0
2.3k stars 910 forks source link

[BUG] 400 Bad Request #3319

Open Hr46ph opened 9 months ago

Hr46ph commented 9 months ago

Describe the bug Importing OVA results in error 400 Bad Request. The import starts, the ovf file imports and then starts the vmdk. This goes to 100% and then fails.

To Reproduce Steps to reproduce the behavior:

I set variables:

export GOVC_URL=https://vcenter.internal.domainname.net
export GOVC_INSECURE=true
export GOVC_USERNAME=Administrator@vsphere.local
export GOVC_PASSWORD=hohoho123
export GOVC_DATACENTER=my_dc
export GOVC_DATASTORE=nfs_datastore_1
export GOVC_NETWORK=vmnet

I create a content library: govc library.create pbc_clib

I try to import an ova: govc library.import -debug=true -n=talos-v1.6.1 pbc_clib vmware-amd64.ova

I receive the following error: Filename: 2-0008.res.headers

HTTP/2.0 400 Bad Request
Connection: close
Content-Type: application/json
Date: Wed, 27 Dec 2023 13:28:59 GMT
X-Envoy-Upstream-Service-Time: 379

Filename: 2-0008.res.json

{"type":"com.vmware.vapi.std.errors.not_allowed_in_current_state","value":{"error_type":"NOT_ALLOWED_IN_CURRENT_STATE","messages":[{"args":["complete","ERROR","Error transferring file disk.vmdk to ds:///vmfs/volumes/65450c95-bfa2146a-0287-d45d643f0adc//contentlib-65aa022d-959c-4608-ae63-6405d499ef6e/92984ff2-f2fa-4a79-9705-91f84a45710b/disk_a9e77047-d59a-4fe3-8be5-64c3369e142e.vmdk?serverId=e8f92860-2331-4d5e-898c-a419d74b7952. Reason: IO error during transfer of ds:///vmfs/volumes/65450c95-bfa2146a-0287-d45d643f0adc//contentlib-65aa022d-959c-4608-ae63-6405d499ef6e/92984ff2-f2fa-4a79-9705-91f84a45710b/disk_a9e77047-d59a-4fe3-8be5-64c3369e142e.vmdk?serverId=e8f92860-2331-4d5e-898c-a419d74b7952: Pipe closed"],"default_message":"The operation complete can not be invoked when the import session is in the ERROR state. Reason: Error transferring file disk.vmdk to ds:///vmfs/volumes/65450c95-bfa2146a-0287-d45d643f0adc//contentlib-65aa022d-959c-4608-ae63-6405d499ef6e/92984ff2-f2fa-4a79-9705-91f84a45710b/disk_a9e77047-d59a-4fe3-8be5-64c3369e142e.vmdk?serverId=e8f92860-2331-4d5e-898c-a419d74b7952. Reason: IO error during transfer of ds:///vmfs/volumes/65450c95-bfa2146a-0287-d45d643f0adc//contentlib-65aa022d-959c-4608-ae63-6405d499ef6e/92984ff2-f2fa-4a79-9705-91f84a45710b/disk_a9e77047-d59a-4fe3-8be5-64c3369e142e.vmdk?serverId=e8f92860-2331-4d5e-898c-a419d74b7952: Pipe closed","id":"com.vmware.vdcs.cls-main.update_session_invalid_state_for_operation_reason"}]}}%

Expected behavior An imported OVA into the Content Library specified.

Affected version $ govc about

FullName:     VMware vCenter Server 8.0.2 build-22617221
Name:         VMware vCenter Server
Vendor:       VMware, Inc.
Version:      8.0.2
Build:        22617221
OS type:      linux-x64
API type:     VirtualCenter
API version:  8.0.2.0
Product ID:   vpx

Screenshots/Debug Output Already provided above.

Additional context

github-actions[bot] commented 9 months ago

Howdy 🖐   Hr46ph ! Thank you for your interest in this project. We value your feedback and will respond soon.

If you want to contribute to this project, please make yourself familiar with the CONTRIBUTION guidelines.

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Mark as fresh by adding the comment /remove-lifecycle stale.

acsezen commented 5 months ago

Describe the bug Importing OVA results in error 400 Bad Request. The import starts, the ovf file imports and then starts the vmdk. This goes to 100% and then fails.

To Reproduce Steps to reproduce the behavior:

I set variables:

export GOVC_URL=https://vcenter.internal.domainname.net
export GOVC_INSECURE=true
export GOVC_USERNAME=Administrator@vsphere.local
export GOVC_PASSWORD=hohoho123
export GOVC_DATACENTER=my_dc
export GOVC_DATASTORE=nfs_datastore_1
export GOVC_NETWORK=vmnet

I create a content library: govc library.create pbc_clib

I try to import an ova: govc library.import -debug=true -n=talos-v1.6.1 pbc_clib vmware-amd64.ova

I receive the following error: Filename: 2-0008.res.headers

HTTP/2.0 400 Bad Request
Connection: close
Content-Type: application/json
Date: Wed, 27 Dec 2023 13:28:59 GMT
X-Envoy-Upstream-Service-Time: 379

Filename: 2-0008.res.json

{"type":"com.vmware.vapi.std.errors.not_allowed_in_current_state","value":{"error_type":"NOT_ALLOWED_IN_CURRENT_STATE","messages":[{"args":["complete","ERROR","Error transferring file disk.vmdk to ds:///vmfs/volumes/65450c95-bfa2146a-0287-d45d643f0adc//contentlib-65aa022d-959c-4608-ae63-6405d499ef6e/92984ff2-f2fa-4a79-9705-91f84a45710b/disk_a9e77047-d59a-4fe3-8be5-64c3369e142e.vmdk?serverId=e8f92860-2331-4d5e-898c-a419d74b7952. Reason: IO error during transfer of ds:///vmfs/volumes/65450c95-bfa2146a-0287-d45d643f0adc//contentlib-65aa022d-959c-4608-ae63-6405d499ef6e/92984ff2-f2fa-4a79-9705-91f84a45710b/disk_a9e77047-d59a-4fe3-8be5-64c3369e142e.vmdk?serverId=e8f92860-2331-4d5e-898c-a419d74b7952: Pipe closed"],"default_message":"The operation complete can not be invoked when the import session is in the ERROR state. Reason: Error transferring file disk.vmdk to ds:///vmfs/volumes/65450c95-bfa2146a-0287-d45d643f0adc//contentlib-65aa022d-959c-4608-ae63-6405d499ef6e/92984ff2-f2fa-4a79-9705-91f84a45710b/disk_a9e77047-d59a-4fe3-8be5-64c3369e142e.vmdk?serverId=e8f92860-2331-4d5e-898c-a419d74b7952. Reason: IO error during transfer of ds:///vmfs/volumes/65450c95-bfa2146a-0287-d45d643f0adc//contentlib-65aa022d-959c-4608-ae63-6405d499ef6e/92984ff2-f2fa-4a79-9705-91f84a45710b/disk_a9e77047-d59a-4fe3-8be5-64c3369e142e.vmdk?serverId=e8f92860-2331-4d5e-898c-a419d74b7952: Pipe closed","id":"com.vmware.vdcs.cls-main.update_session_invalid_state_for_operation_reason"}]}}%

Expected behavior An imported OVA into the Content Library specified.

Affected version $ govc about

FullName:     VMware vCenter Server 8.0.2 build-22617221
Name:         VMware vCenter Server
Vendor:       VMware, Inc.
Version:      8.0.2
Build:        22617221
OS type:      linux-x64
API type:     VirtualCenter
API version:  8.0.2.0
Product ID:   vpx

Screenshots/Debug Output Already provided above.

Additional context

Hello,

Does your ova file contain .mf ?

br

Janus451 commented 3 months ago

Hi, did you find a solution for that problem? I'm running currently into the exact same issue. My .ova contains a .mf file. The cheksums also match.

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Mark as fresh by adding the comment /remove-lifecycle stale.

TrevorSquillario commented 4 days ago

Ran into this issue today following the Talos VMware guide https://www.talos.dev/v1.8/talos-guides/install/virtualized-platforms/vmware/

It worked the first time, then I destroyed the cluster, deleted the Content Library and I get the 400 Bad Request on the second run.