dmacvicar / terraform-provider-libvirt

Terraform provider to provision infrastructure with Linux's KVM using libvirt
Apache License 2.0
1.59k stars 458 forks source link

libvirt_volume: Error while uploading source os-image.qcow2: unexpected EOF #308

Closed ayaseen closed 6 years ago

ayaseen commented 6 years ago

Version Reports:

Distro version of host:

Ubuntu openSUSE 42.2/ Centos7/ Ubuntu.. Ubuntu 18.04

Terraform Version Report

(Provided by running terraform -v.) 0.11.7

Libvirt version

libvirtd (libvirt) 4.0.0 virsh --version

MalloZup commented 6 years ago

after using more debug, found out that the unexpectedEOF is coming from https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/libvirt/utils_volume.go#L159.

we have the unexpected. EOF when doing the io.Copy(sio, src)

MalloZup commented 6 years ago

@ayaseen do you have a TF file that you used for this? ( i can reproduce it not always with other env but is ok to have more just in case)tia

@dmacvicar i did some reaserch on this.

so we get an unEOF this mean that an EOF was encountered in the middle of reading a fixed-size block or data structure. I just checkout the HTTP part were we implement the io.Reader and this seems really fine to me.

My rough idea is more on the libvirt-api, namely on the upload call on libvirt, i think we have there the race condition i will investigate and experiment more on it.

Afaik we have this issues since long-long time. We have it more visible using the latest sumaform with tf11 and latest problem , or i can reproduce more frequently this issue.

If you have any hint or suggestion feel free :rocket: :smile: :sunflower: i will dive more on the libvirt part of the copier call.

MalloZup commented 6 years ago

@ayaseen it ended up that was not a bug from provider, but the image on the server were the pb.

curl 18 https://curl.haxx.se/libcurl/c/libcurl-errors.html

I just open a PR for improving the errmsg