hashicorp / packer-plugin-oracle

Packer plugin for Oracle Builder
https://www.packer.io/docs/builders/oracle
Mozilla Public License 2.0
7 stars 13 forks source link

packer fail to launch oracle oci instance #117

Open gilkatz64 opened 1 month ago

gilkatz64 commented 1 month ago

Community Note

When filing a bug, please include the following headings if possible. Any example text in this template can be deleted.

Overview of the Issue

A paragraph or two about the issue you're experiencing.

Reproduction Steps

Steps to reproduce this issue

Packer version

From packer version

Simplified Packer Template

If the file is longer than a few dozen lines, please include the URL to the gist of the log or use the Github detailed format instead of posting it directly in the issue.

Operating system and Environment details

OS, Architecture, and any other information you can provide about the environment.

Log Fragments and crash.log files

Include appropriate log fragments. If the log is longer than a few dozen lines, please include the URL to the gist of the log or use the Github detailed format instead of posting it directly in the issue.

Set the env var PACKER_LOG=1 for maximum log detail.

I get Problem creating instance: Error returned by Compute Service. Http Status Code: 400. Error Code: CannotParseRequest. Opc request id: 2160e4884da84496111b0aabfcf3029d/E572F4F6442A7FA9334017C75DE8E25D/0C9F438D8FC64774E1559F3CC645E537. Message: Incorrectly formatted request. Please refer to our documentation for help.

the full error log is ` Problem creating instance: Error returned by Compute Service. Http Status Code: 400. Error Code: CannotParseRequest. Opc request id: 2160e4884da84496111b0aabfcf3029d/E572F4F6442A7FA9334017C75DE8E25D/0C9F438D8FC64774E1559F3CC645E537. Message: Incorrectly formatted request. Please refer to our documentation for help. ==> oracle-oci.safebreach-management: Operation Name: LaunchInstance ==> oracle-oci.safebreach-management: Timestamp: 2024-05-26 14:11:53 +0000 GMT ==> oracle-oci.safebreach-management: Client Version: Oracle-GoSDK/65.4.0 ==> oracle-oci.safebreach-management: Request Endpoint: POST https://iaas.us-ashburn-1.oraclecloud.com/20160918/instances ==> oracle-oci.safebreach-management: Troubleshooting Tips: See https://docs.oracle.com/iaas/Content/API/References/apierrors.htm#apierrors_400__400_cannotparserequest for more information about resolving this error. ==> oracle-oci.safebreach-management: Also see https://docs.oracle.com/iaas/api/#/en/iaas/20160918/Instance/LaunchInstance for details on this operation's requirements. ==> oracle-oci.safebreach-management: To get more info on the failing request, you can set OCI_GO_SDK_DEBUG env var to info or higher level to log the request/response details. ==> oracle-oci.safebreach-management: If you are unable to resolve this Compute issue, please contact Oracle support and provide them this full error message. Build 'oracle-oci.safebreach-management' errored after 1 second 54 milliseconds: Problem creating instance: Error returned by Compute Service. Http Status Code: 400. Error Code: CannotParseRequest. Opc request id: 2160e4884da84496111b0aabfcf3029d/E572F4F6442A7FA9334017C75DE8E25D/0C9F438D8FC64774E1559F3CC645E537. Message: Incorrectly formatted request. Please refer to our documentation for help. Operation Name: LaunchInstance Timestamp: 2024-05-26 14:11:53 +0000 GMT Client Version: Oracle-GoSDK/65.4.0 Request Endpoint: POST https://iaas.us-ashburn-1.oraclecloud.com/20160918/instances Troubleshooting Tips: See https://docs.oracle.com/iaas/Content/API/References/apierrors.htm#apierrors_400__400_cannotparserequest for more information about resolving this error. Also see https://docs.oracle.com/iaas/api/#/en/iaas/20160918/Instance/LaunchInstance for details on this operation's requirements. To get more info on the failing request, you can set OCI_GO_SDK_DEBUG env var to info or higher level to log the request/response details. If you are unable to resolve this Compute issue, please contact Oracle support and provide them this full error message.

==> Wait completed after 1 second 54 milliseconds

==> Some builds didn't complete successfully and had errors: --> oracle-oci.safebreach-management: Problem creating instance: Error returned by Compute Service. Http Status Code: 400. Error Code: CannotParseRequest. Opc request id: 2160e4884da84496111b0aabfcf3029d/E572F4F6442A7FA9334017C75DE8E25D/0C9F438D8FC64774E1559F3CC645E537. Message: Incorrectly formatted request. Please refer to our documentation for help. Operation Name: LaunchInstance Timestamp: 2024-05-26 14:11:53 +0000 GMT Client Version: Oracle-GoSDK/65.4.0 Request Endpoint: POST https://iaas.us-ashburn-1.oraclecloud.com/20160918/instances Troubleshooting Tips: See https://docs.oracle.com/iaas/Content/API/References/apierrors.htm#apierrors_400__400_cannotparserequest for more information about resolving this error. Also see https://docs.oracle.com/iaas/api/#/en/iaas/20160918/Instance/LaunchInstance for details on this operation's requirements. To get more info on the failing request, you can set OCI_GO_SDK_DEBUG env var to info or higher level to log the request/response details. If you are unable to resolve this Compute issue, please contact Oracle support and provide them this full error message.

==> Builds finished but no artifacts were created. 2024/05/26 14:11:54 waiting for all plugin processes to complete... 2024/05/26 14:11:54 /home/safebreach/.packer.d/plugins/github.com/hashicorp/oracle/packer-plugin-oracle_v1.1.0_x5.0_linux_amd64: plugin process exited`

the hcl file is

`packer { required_plugins { oracle = { version = ">= 1.1.0" source = "github.com/hashicorp/oracle" } chef = { version = ">= 1.0.0" source = "github.com/hashicorp/chef" } } }

source "oracle-oci" "my-vm" { image_name = "${var.image_name}-${var.build_number}" availability_domain = "${var.availability_domain}" compartment_ocid = "${var.compartment_ocid}" tenancy_ocid = "${var.tenancy_ocid}" fingerprint = "${var.fingerprint}" user_ocid = "${var.user_ocid}" base_image_ocid = var.base_image_ocid image_name = "ExampleImage" shape = "VM.Standard1.1" ssh_username = "ubuntu" subnet_ocid = "${var.subnet_ocid}" }

build { sources = ["source.oracle-oci.my-vm"] }`

lbajolet-hashicorp commented 1 month ago

Hi @gilkatz64,

Have you tried fiddling with the suggestions that OCI provided in order to debug the problem you're experiencing? There's a mention of a OCI_GO_SDK_DEBUG environment variable that you can set to a log level (I do not know what are valid values for this, you'll have to look at the OCI docs for that), which would help you possibly troubleshoot what's going wrong, could be a usage problem or it could be a bug with the plugin.

Also since this is an OCI-related issue, I'll transfer this over to the plugin for tracking it in the expected location.

Thanks!