hashicorp / hashicorp/packer-plugin-oracle

Not able to authenticate using config file on windows while running packer build

Open
#20 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Go
Stars
14
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Issues on GitHub are intended to be related to bugs or feature requests, so we
recommend using our other community resources instead of asking here if you
have a question.

- Packer Guides: https://www.packer.io/guides
- Discussion List: https://groups.google.com/group/packer-tool
- Any other questions can be sent to the packer section of the HashiCorp
forum: https://discuss.hashicorp.com/c/packer
- Packer community links: https://www.packer.io/community

I have written below packer configuration file

source "oracle-oci" "example" {
availability_domain = "fGpl:US-ASHBURN-AD-1"
base_image_ocid = "ocid1.image.oc1.iad.aaaaaaaas2dadadadadsadtjobv2pgprzvsvdttho3a"
image_name = "OCI-Custom-Image"
shape = "VM.Standard2.1"
ssh_username = "opc"
access_cfg_file = "C:\\Users\\Anandkumar\\.oci\\config"
subnet_ocid = "ocid1.subnet.oc1.iad.aaaaaaaafonrdwsc6zvaswtwq4dsmilsx67d6q"
}

build {
sources = ["source.oracle-oci.example"]

provisioner "shell" {
inline = ["echo Configuration is going to Start",
"sudo yum install bind-utils"
]
}
}

When I run packer build I am getting the below error. Packer version 1.7.4

PS C:\Users\Anandkumar\OneDrive - Personal\Hashicorp Examples\Packer> packer build .\build.pkr.hcl
oracle-oci.example: output will be in this color.

==> oracle-oci.example: Creating temporary ssh key for instance...
==> oracle-oci.example: Creating instance...
==> oracle-oci.example: Problem creating instance: Service error:NotAuthorizedOrNotFound. Authorization failed or requested resource not found.. http status code: 404. Opc request id: 50dfe82afe71836965e6b7d29cf89f9a/4B6825337CBA98FF424BED9DB7AAC466/D068EFB76A5CBE95E943B0DE186F9985
Build 'oracle-oci.example' errored after 2 seconds 126 milliseconds: Problem creating instance: Service error:NotAuthorizedOrNotFound. Authorization failed or requested resource not found.. http status code: 404. Opc request id: 50dfe82afe71836965e6b7d29cf89f9a/4B6825337CBA98FF424BED9DB7AAC466/D068EFB76A5CBE95E943B0DE186F9985

==> Wait completed after 2 seconds 126 milliseconds

==> Some builds didn't complete successfully and had errors:
--> oracle-oci.example: Problem creating instance: Service error:NotAuthorizedOrNotFound. Authorization failed or requested resource not found.. http status code: 404. Opc request id: 50dfe82afe71836965e6b7d29cf89f9a/4B6825337CBA98FF424BED9DB7AAC466/D068EFB76A5CBE95E943B0DE186F9985

==> Builds finished but no artifacts were created.
PS C:\Users\Anandkumar\OneDrive - Personal\Hashicorp Examples\Packer>

I am able to run OCI CLI commands from windows command prompt without any issues. I am not getting why its not getting authenticated using confi file when running packer build command.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.