You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the example of using the data source digital ocean-image from the official documentation does not work as expected and fails with errors when running packer build . The sample error is as shown below:
Error: Datasource.Execute failed: No image matching found
on main.pkr.hcl line 1:
(source code not available)
Error: Unsupported attribute
on main.pkr.hcl line 9:
(source code not available)
This object does not have an attribute named "digitalocean-image".
Reproduction Steps
Follow the detailed steps when using the data source digitalocean-image as given here.
Running packer build . fails with the error as shown above.
2024/09/19 03:02:19 [INFO] Packer version: 1.11.2 [go1.21.12 darwin arm64]
2024/09/19 03:02:19 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/09/19 03:02:19 [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/briantical/.packerconfig
2024/09/19 03:02:19 [WARN] Config file doesn't exist: /Users/briantical/.packerconfig2024/09/19 03:02:19 [INFO] Setting cache directory: /Users/briantical/.cache/packer2024/09/19 03:02:19 [TRACE] listing potential installations for "github.com/digitalocean/digitalocean" that match ">= 1.0.4". plugingetter.ListInstallationsOptions{PluginDirectory:"/Users/briantical/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"darwin", ARCH:"arm64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0x140006fa000)}}, ReleasesOnly:false}}2024/09/19 03:02:19 [TRACE] Found the following "github.com/digitalocean/digitalocean" installations: [{/Users/briantical/.config/packer/plugins/github.com/digitalocean/digitalocean/packer-plugin-digitalocean_v1.4.0_x5.0_darwin_arm64 v1.4.0 x5.0}]2024/09/19 03:02:19 [INFO] found external [-packer-default-plugin-name-] builders from digitalocean plugin2024/09/19 03:02:19 [INFO] found external [import] post-processors from digitalocean plugin2024/09/19 03:02:19 found external [image] datasource from digitalocean plugin2024/09/19 03:02:19 [TRACE] listing potential installations for <nil> that match "". plugingetter.ListInstallationsOptions{PluginDirectory:"/Users/briantical/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"darwin", ARCH:"arm64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0x14000632000)}}, ReleasesOnly:false}}2024/09/19 03:02:19 [INFO] found external [chroot ebs ebssurrogate ebsvolume instance] builders from amazon plugin2024/09/19 03:02:19 [INFO] found external [import] post-processors from amazon plugin2024/09/19 03:02:19 found external [ami parameterstore secretsmanager] datasource from amazon plugin2024/09/19 03:02:19 [INFO] found external [-packer-default-plugin-name-] builders from digitalocean plugin2024/09/19 03:02:19 [INFO] found external [import] post-processors from digitalocean plugin2024/09/19 03:02:19 found external [image] datasource from digitalocean plugin2024/09/19 03:02:19 [TRACE] validateValue: not active for auth_key, so skipping2024/09/19 03:02:19 [TRACE] validateValue: not active for ssh_username, so skipping2024/09/19 03:02:19 [TRACE] validateValue: not active for image, so skipping2024/09/19 03:02:19 [TRACE] validateValue: not active for source, so skipping2024/09/19 03:02:19 [INFO] Starting external plugin /Users/briantical/.config/packer/plugins/github.com/digitalocean/digitalocean/packer-plugin-digitalocean_v1.4.0_x5.0_darwin_arm64 start datasource image2024/09/19 03:02:19 Starting plugin: /Users/briantical/.config/packer/plugins/github.com/digitalocean/digitalocean/packer-plugin-digitalocean_v1.4.0_x5.0_darwin_arm64 []string{"/Users/briantical/.config/packer/plugins/github.com/digitalocean/digitalocean/packer-plugin-digitalocean_v1.4.0_x5.0_darwin_arm64", "start", "datasource", "image"}2024/09/19 03:02:19 Waiting for RPC address for: /Users/briantical/.config/packer/plugins/github.com/digitalocean/digitalocean/packer-plugin-digitalocean_v1.4.0_x5.0_darwin_arm642024/09/19 03:02:19 packer-plugin-digitalocean_v1.4.0_x5.0_darwin_arm64 plugin: 2024/09/19 03:02:19 Plugin address: unix /var/folders/wb/ncnfxqk90tv3321b3tfn1jq80000gn/T/packer-plugin39560786222024/09/19 03:02:19 packer-plugin-digitalocean_v1.4.0_x5.0_darwin_arm64 plugin: 2024/09/19 03:02:19 Waiting for connection...2024/09/19 03:02:19 Received unix RPC address for /Users/briantical/.config/packer/plugins/github.com/digitalocean/digitalocean/packer-plugin-digitalocean_v1.4.0_x5.0_darwin_arm64: addr is /var/folders/wb/ncnfxqk90tv3321b3tfn1jq80000gn/T/packer-plugin39560786222024/09/19 03:02:19 packer-plugin-digitalocean_v1.4.0_x5.0_darwin_arm64 plugin: 2024/09/19 03:02:19 Serving a plugin connection...2024/09/19 03:02:19 packer-plugin-digitalocean_v1.4.0_x5.0_darwin_arm64 plugin: 2024/09/19 03:02:19 [TRACE] starting datasource image2024/09/19 03:02:19 [INFO] (telemetry) Starting datasource digitalocean-image2024/09/19 03:02:19 packer-plugin-digitalocean_v1.4.0_x5.0_darwin_arm64 plugin: 2024/09/19 03:02:19 [DEBUG] GET https://api.digitalocean.com/v2/images?page=1&per_page=200&private=true2024/09/19 03:02:20 [INFO] (telemetry) ending digitalocean-image on main.pkr.hcl line 1: (source code not available)Error: Unsupported attribute on main.pkr.hcl line 9: (source code not available)This object does not have an attribute named "digitalocean-image".2024/09/19 03:02:20 [INFO] (telemetry) Finalizing.Error: Datasource.Execute failed: No image matching found on main.pkr.hcl line 1: (source code not available)Error: Unsupported attribute on main.pkr.hcl line 9: (source code not available)This object does not have an attribute named "digitalocean-image".2024/09/19 03:02:21 waiting for all plugin processes to complete...2024/09/19 03:02:21 /Users/briantical/.config/packer/plugins/github.com/digitalocean/digitalocean/packer-plugin-digitalocean_v1.4.0_x5.0_darwin_arm64: plugin process exited
The text was updated successfully, but these errors were encountered:
Error: Datasource.Execute failed: No image matching found
This data source is used look up the ID of an existing DigitalOcean image on your account. golden-image-2022.* is just an example. You should use the name of an image already on your account.
Since the image was not found, it can not be referenced latter. This causes the second error:
This object does not have an attribute named "digitalocean-image".
I've opened a PR (#163) that adds some additional detail to the example. Hopefully that makes things a bit more clear.
Overview of the Issue
Following the example of using the data source
digital ocean-image
from the official documentation does not work as expected and fails with errors when runningpacker build .
The sample error is as shown below:Error: Datasource.Execute failed: No image matching found on main.pkr.hcl line 1: (source code not available) Error: Unsupported attribute on main.pkr.hcl line 9: (source code not available) This object does not have an attribute named "digitalocean-image".
Reproduction Steps
digitalocean-image
as given here.packer build .
fails with the error as shown above.Plugin and Packer version
From
Packer v1.11.2
Simplified Packer Buildfile
Operating system and Environment details
MacOs Sonoma 14.6.1, Apple M1
Log Fragments and crash.log files
The text was updated successfully, but these errors were encountered: