{"record":{"id":"3a7c6dedbe78f264","repo":"hashicorp/packer","slug":"the-region-must-be-specified","errorCode":null,"errorMessage":"the `region` must be specified","messagePattern":"the `region` must be specified","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"datasource/hcp-packer-artifact/data.go","lineNumber":93,"sourceCode":"\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\"),\n\t\t)\n\t}\n\n\tif d.config.Platform == \"\" {\n\t\terrs = packersdk.MultiErrorAppend(errs, fmt.Errorf(\n\t\t\t\"the `platform` must be specified\",\n\t\t))\n\t}\n\n\tif errs != nil && len(errs.Errors) > 0 {\n\t\treturn errs\n\t}\n\treturn nil\n}\n\n// DatasourceOutput Information from []*hcpPackerModels.HashicorpCloudPacker20230101Artifact with some information\n// from the parent []*hcpPackerModels.HashicorpCloudPacker20230101Build included where it seemed\n// like it might be relevant. Need to copy so we can generate","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/datasource/hcp-packer-artifact/data.go#L75-L111","documentation":"Configuration validation guard in the hcp-packer-artifact datasource's Configure. The datasource must know which cloud region the build artifact lives in so it can read the right registry entry; this sentinel error is appended to a MultiError when the required region field is empty. Set region in the datasource block to the region where the target artifact was built.","triggerScenarios":"Thrown at datasource/hcp-packer-artifact/data.go:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set region to the cloud region of the artifact you want, e.g. region = \"us-east-1\"","Use the yandex-cloud-specific region format if targeting Yandex Cloud iterations"],"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"}