terraform-provider-vcd
terraform-provider-vcd copied to clipboard
catalog item upload fails with vCD load balancer
Using a system made of two vCDs and a load balancer in front, we get an error during the upload of a catalog item.
resource "vcd_catalog_item" "photon-hw11a" {
org = datacloud
catalog = cat-datacloud
name = "photon-hw11a"
description = "photon-hw11a"
ova_path = "photon-hw11-3.0-26156e2.ova"
upload_piece_size = 5
show_upload_progress = "true"
}
Error: error uploading media: &errors.errorString{s:"file upload failed. Err: unhandled API response, please report this issue, status code: 416 Content-Range not satisifiable: Request must begin at the last byte stored"}
Here's the relevant portion from the log:
--------------------------------------------------------------------------------
Request caller: govcd.uploadFiles-->govcd.uploadFile-->govcd.uploadPartFile-->govcd.newFileUploadRequest
PUT https://VCD_ADDRESS/transfer/c28a8726-efd4-4f21-ac4b-57b8d73e508b/photon-ova-disk1.vmdk
--------------------------------------------------------------------------------
Req header:
X-Vcloud-Authorization: [********]
Accept: [application/*+xml;version=29.0]
[TRACE] Header: Content-Length :[5242880]
[TRACE] Header: Content-Range :[bytes 68157440-73400319/161960448]
[TRACE] Header: X-Vcloud-Authorization :[fdb4a8229a154945848e99f06cdaf619]
[TRACE] Header: Accept :[application/*+xml;version=29.0]
[TRACE] Creating file upload request: https://VCD_ADDRESS/transfer/c28a8726-efd4-4f21-ac4b-57b8d73e508b/photon-ova-disk1.vmdk, 73400320, 5242880, 161960448
--------------------------------------------------------------------------------
Request caller: govcd.uploadFiles-->govcd.uploadFile-->govcd.uploadPartFile-->govcd.newFileUploadRequest
PUT https://VCD_ADDRESS/transfer/c28a8726-efd4-4f21-ac4b-57b8d73e508b/photon-ova-disk1.vmdk
--------------------------------------------------------------------------------
Req header:
Accept: [application/*+xml;version=29.0]
X-Vcloud-Authorization: [********]
[TRACE] Header: X-Vcloud-Authorization :[fdb4a8229a154945848e99f06cdaf619]
[TRACE] Header: Accept :[application/*+xml;version=29.0]
[TRACE] Header: Content-Length :[5242880]
[TRACE] Header: Content-Range :[bytes 73400320-78643199/161960448]
[ERROR] during upload process: /tmp/photon-ova-disk1.vmdk, error file upload failed. Err: unhandled API response, please report this issue, status code: 416 Content-Range not satisifiable: Request must begin at the last byte stored
2019/11/26 09:40:21 [Error] Error uploading files: &errors.errorString{s:"file upload failed. Err: unhandled API response, please report this issue, status code: 416 Content-Range not satisifiable: Request must begin at the last byte stored"}
The error is repeatable. It happens whether we access the vCD IP directly or using the load balancer address.