luthermonson / go-proxmox

Go client with types and tests for the Proxmox-VE REST API
Apache License 2.0
167 stars 48 forks source link

cloud-init returns unexpected end of JSON input #115

Closed Lennart01 closed 7 months ago

Lennart01 commented 9 months ago

Hey, Ive been trying this for at least 6hs now and cant really wrap my head around it. Ive created two very basic cloudinit files as strings (just metadata and the cloudinit file, the rest should be optional after checking the code). It keeps returning unexpected end of JSON input despite being valid yaml. Ive also tried just passing JSON directly, but this also fails with the same issue. Also, there is no real documentation of what device should be. I have tried numerous values but that does not affect the end result.

    // Define the cloud-init configuration strings
    userdata := `
#cloud-config
users:
  - name: default

      `

    metadata := `
instance-id: iid-123456

`
    device := "ide2"

    // Call the CloudInit method
    err = createdVM.CloudInit(ctx, device, userdata, metadata, "", "")
Lennart01 commented 9 months ago

I've done some digging. Looks like it fails in the upload function in storage.go. I've tested uploading the ISO itself to proxmox manually and it works just fine so I'm kinda confused 🤔. I've also checked the generated iso manually and it looks fine so idk.

luthermonson commented 8 months ago

do you have any specific logs or lines from storage.go that it is i failing? could this be permissions and the user you are using go-proxmox with does not have the ability to upload to the storage ?

Lennart01 commented 7 months ago

not reproducible on latest release

justinas-b commented 4 months ago

I am using https://github.com/ionos-cloud/cluster-api-provider-proxmox which depends on v0.1.0 version of this package, and i am still experiencing issue described above 👀 i have documented more details in https://github.com/ionos-cloud/cluster-api-provider-proxmox/issues/252

justinas-b commented 4 months ago

Is there a way to enable verbose logging for this package through environment variables so that I could gather debug information?