{"record":{"id":"1b8a3441010af7e2","repo":"hashicorp/packer","slug":"the-platform-must-be-specified","errorCode":null,"errorMessage":"the `platform` must be specified","messagePattern":"the `platform` must be specified","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"datasource/hcp-packer-artifact/data.go","lineNumber":98,"sourceCode":"\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\ntype DatasourceOutput struct {\n\t// The name of the platform that the artifact exists in.\n\t// For example, \"aws\", \"azure\", or \"gce\".\n\tPlatform string `mapstructure:\"platform\"`\n","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/datasource/hcp-packer-artifact/data.go#L80-L116","documentation":"Configuration validation guard in the hcp-packer-artifact datasource's Configure. The datasource resolves an artifact by iteration platform, so it needs to know which platform (e.g. amazon-ebs, vsphere) built the artifact; this sentinel error is appended to a MultiError when the required platform field is empty. Set platform in the datasource block to the builder component type that produced the artifact.","triggerScenarios":"Thrown at datasource/hcp-packer-artifact/data.go:98 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set platform to the OS platform recorded in HCP Packer, e.g. platform = \"ubuntu\" or \"amazon-linux\""],"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"}