[GH-ISSUE #115] cloud-init returns unexpected end of JSON input #19

Closed
opened 2026-03-03 15:29:38 +03:00 by kerem · 5 comments
Owner

Originally created by @Lennart01 on GitHub (Feb 9, 2024).
Original GitHub issue: https://github.com/luthermonson/go-proxmox/issues/115

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, "", "")
Originally created by @Lennart01 on GitHub (Feb 9, 2024). Original GitHub issue: https://github.com/luthermonson/go-proxmox/issues/115 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. ```go // 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, "", "") ```
kerem closed this issue 2026-03-03 15:29:38 +03:00
Author
Owner

@Lennart01 commented on GitHub (Feb 14, 2024):

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.

<!-- gh-comment-id:1945066480 --> @Lennart01 commented on GitHub (Feb 14, 2024): 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.
Author
Owner

@luthermonson commented on GitHub (Feb 21, 2024):

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 ?

<!-- gh-comment-id:1957959997 --> @luthermonson commented on GitHub (Feb 21, 2024): 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 ?
Author
Owner

@Lennart01 commented on GitHub (Apr 2, 2024):

not reproducible on latest release

<!-- gh-comment-id:2032082500 --> @Lennart01 commented on GitHub (Apr 2, 2024): not reproducible on latest release
Author
Owner

@justinas-b commented on GitHub (Jul 1, 2024):

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

<!-- gh-comment-id:2201282064 --> @justinas-b commented on GitHub (Jul 1, 2024): 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
Author
Owner

@justinas-b commented on GitHub (Jul 1, 2024):

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

<!-- gh-comment-id:2201371827 --> @justinas-b commented on GitHub (Jul 1, 2024): Is there a way to enable verbose logging for this package through environment variables so that I could gather debug information?
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/go-proxmox#19
No description provided.