{"record":{"id":"17be667f0e799876","repo":"hashicorp/packer","slug":"the-bucket-name-must-be-specified","errorCode":null,"errorMessage":"the `bucket_name` must be specified","messagePattern":"the `bucket_name` must be specified","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"datasource/hcp-packer-artifact/data.go","lineNumber":75,"sourceCode":"\t// For example, \"amazon-ebs.example\"\n\tComponentType string `mapstructure:\"component_type\" required:\"false\"`\n}\n\nfunc (d *Datasource) ConfigSpec() hcldec.ObjectSpec {\n\treturn d.config.FlatMapstructure().HCL2Spec()\n}\n\nfunc (d *Datasource) Configure(raws ...interface{}) error {\n\terr := config.Decode(&d.config, nil, raws...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar errs *packersdk.MultiError\n\n\tif d.config.BucketName == \"\" {\n\t\terrs = packersdk.MultiErrorAppend(\n\t\t\terrs, fmt.Errorf(\"the `bucket_name` must be specified\"),\n\t\t)\n\t}\n\n\t// Ensure either channel_name or version_fingerprint is set, and not both at the same time.\n\tif d.config.ChannelName == \"\" && d.config.VersionFingerprint == \"\" {\n\t\terrs = packersdk.MultiErrorAppend(errs, errors.New(\n\t\t\t\"`version_fingerprint` or `channel_name` must be specified\",\n\t\t))\n\t}\n\tif d.config.ChannelName != \"\" && d.config.VersionFingerprint != \"\" {\n\t\terrs = packersdk.MultiErrorAppend(errs, errors.New(\n\t\t\t\"`version_fingerprint` and `channel_name` cannot be specified together\",\n\t\t))\n\t}\n\n\tif d.config.Region == \"\" {\n\t\terrs = packersdk.MultiErrorAppend(errs,\n\t\t\tfmt.Errorf(\"the `region` must be specified\"),","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/datasource/hcp-packer-artifact/data.go#L57-L93","documentation":"Configuration validation guard in the hcp-packer-artifact datasource's Configure. The datasource queries HCP Packer for a build artifact, which requires knowing which bucket to look in; this sentinel error is appended to a MultiError when the required bucket_name field is empty or omitted from the datasource block. Set bucket_name in the datasource configuration to the HCP Packer bucket that holds the artifact.","triggerScenarios":"Thrown at datasource/hcp-packer-artifact/data.go:75 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set bucket_name in the data block to your HCP Packer bucket name, e.g. bucket_name = \"my-images\"","Verify the bucket exists in HCP Packer and copy its exact slug"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eb36e3c3e48a036f3e8cc94087636ee72e1303c9","analyzedAt":"2026-09-05T13:20:43.127Z","contentChangedAt":"2026-09-05T13:20:43.127Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}