akshaykarle / terraform-provider-mongodbatlas

Terraform provider for MongoDB Atlas
Mozilla Public License 2.0
123 stars 54 forks source link

linux_amd64 v0.7.3 binary isn't working #52

Closed jagregory closed 5 years ago

jagregory commented 5 years ago

Not sure exactly what the problem is, but 0.7.3 doesn't work on linux_amd64 for me. v0.7.2 works fine.

Terraform fails with an provider.mongodbatlas: fork/exec /root/.terraform.d/plugins/linux_amd64/terraform-provider-mongodbatlas_v0.7.3: no such file or directory

But the binary does exist. Manually executing the binary gives me a not found error, which is usually an indicator of the binary being built for the wrong OS. Meanwhile, running 0.7.2 directly gives me the usual Terraform notice: "This binary is a plugin. These are not meant to be executed directly."

I ran file on both, and they are slightly different:

file ./terraform-provider-mongodbatlas_v0.7.3
./terraform-provider-mongodbatlas_v0.7.3: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, with debug_info, not stripped

file ./terraform-provider-mongodbatlas_v0.7.2
./terraform-provider-mongodbatlas_v0.7.2: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
akshaykarle commented 5 years ago

Not sure why either. I'm just going to release a new version soon and check that. Will keep you posted. Thanks for pointing this out

dpiddockcmp commented 5 years ago

Classic go problem - the 0.7.3 binary has been dynamically linked to GNU libc6.so. You will get file not found when running under a system with a different libc, like alpine which uses musl.

Setting environment variable CGO_ENABLED=0 forces creation of a static binary when go build is run under linux.

akshaykarle commented 5 years ago

Ahh, that's a great point. Will test it out and make the change. Thank you @dpiddockcmp