terraform-provider-proxmox: Unable to download any iso

Hello,

I’ve been working with this provider for quite awhile and im really fond of it. So it took my by surprise that i encountered the following issue.

(I am not sure whether this is something on my terraform configuration / VM or is a bug from this provider).

│ Error: Could not get file metadata from url.
│ 
│   with proxmox_virtual_environment_download_file.ubuntu_cloud_image,
│   on default.tf line 12, in resource "proxmox_virtual_environment_download_file" "ubuntu_cloud_image":
│   12: resource "proxmox_virtual_environment_download_file" "ubuntu_cloud_image" {
│ 
│ error fetching metadata from download url, unexpected error in GetQueryURLMetadata: error retrieving URL metadata for 0xc000489838: received an
│ HTTP 500 response - Reason: invalid server response: '404 Not Found'

It’s getting increasingly frustration, because last month cloud init would not apply on any version of 22.04 jammy later than [20241004] (Which will be the next challenge, since that is now been removed from the official cloud images website, but thats for another time 😉 )

This is the code i use to download iso’s:

resource "proxmox_virtual_environment_download_file" "ubuntu_cloud_image" {
  content_type        = "iso"
  datastore_id        = "VMBackup_2024"
  node_name           = "prometheus"
  file_name           = "jammy-server-cloudimg-amd64.img"
  overwrite           = true #added for testing purposes
  overwrite_unmanaged = true #added for testing purposes
  upload_timeout      = 4444 #added for testing purposes

  url = "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"
}

Anyways as for the versions: I have 3 nodes with proxmox 8.2.7 My Terraform version is: Terraform v1.10.4 on linux_amd64 provider registry.terraform.io/bpg/proxmox v0.70.0 The vm has OS: Debian 12

The weird thing is, i havent done anything on this machine since christmas and the only thing what happened on it , were automatic updates.

This is the outpot of curl:

curl -I https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
HTTP/1.1 200 OK
Date: Wed, 22 Jan 2025 18:50:13 GMT
Server: Apache/2.4.29 (Ubuntu)
Last-Modified: Wed, 22 Jan 2025 02:36:56 GMT
ETag: "27b96400-62c425e00ccf3"
Accept-Ranges: bytes
Content-Length: 666461184
Content-Type: application/octet-stream

Downloading locally on my terraform vm also goes fine:

wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
--2025-01-22 19:50:29--  https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
Resolving cloud-images.ubuntu.com (cloud-images.ubuntu.com)... 185.125.190.40, 185.125.190.37, 2620:2d:4000:1::1a, ...
Connecting to cloud-images.ubuntu.com (cloud-images.ubuntu.com)|185.125.190.40|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 666461184 (636M) [application/octet-stream]
Saving to: ‘jammy-server-cloudimg-amd64.img’

jammy-server-cloudimg-amd64.img      100%[====================================================================>] 635.59M  68.8MB/s    in 9.1s    

2025-01-22 19:50:38 (69.6 MB/s) - ‘jammy-server-cloudimg-amd64.img’ saved [666461184/666461184]

The same goes for the wget on my proxmox node:

wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
--2025-01-22 19:51:50--  https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
Resolving cloud-images.ubuntu.com (cloud-images.ubuntu.com)... 185.125.190.37, 185.125.190.40, 2620:2d:4000:1::1a, ...
Connecting to cloud-images.ubuntu.com (cloud-images.ubuntu.com)|185.125.190.37|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 666461184 (636M) [application/octet-stream]
Saving to: 'jammy-server-cloudimg-amd64.img'

jammy-server-cloudimg-amd64.img                    100%[==============================================================================================================>] 635.59M  82.6MB/s    in 7.7s    

2025-01-22 19:51:58 (82.6 MB/s) - 'jammy-server-cloudimg-amd64.img' saved [666461184/666461184]

I’ve tried the 22.04 and 24.04 images in addition to debian netinst. I keep getting the same error.

I’ve attached the complete log of my TF_LOG=DEBUG terraform plan in the hopes somebody might have a clue as what’s causing this. https://pastebin.com/8LkwCBy5

I hope i have supplied enough information. If not, please let me know what is needed.

Thank you in advance!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (16 by maintainers)

Most upvoted comments

Hi mate, so, I’ve also tried to play with “override” and “override_unmanaged” options in order to perform some tests but nothing changed.

I also tried to add the same URL into pve iso download page, and it works 😐

Image

Really, I don’t have any idea of what happening, also because other pieces of code works properly and also this piece that manages templates was working very well.

Thanks @demophoon! I think you’re right and that was the use case, but nobody clearly mentioned that url was updated in the config. And error message was confusing as it didn’t include the actual URL used in the file check. Now (since v0.77) it is clear that provider is using the previous (incorrect) url that is “stuck” in the state 🤦🏼

This had nothing to do with the provider. Turns out i have some issues with a buggy network card. A terraform refresh helped me out.