hashicorp / hashicorp/packer-plugin-oracle

Failed to creating image from instance due to `malformed MIME header line: application/json`

Open
#154 14 comments 5 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
14
Forks
16
PR merge metrics
No merged PRs in 30d

Description

#### Overview of the Issue

Since approximately **2026-07-25**, `POST /20160918/images` (CreateImage) in
**us-phoenix-1** returns an HTTP/1.1 response that our client cannot parse. The
Oracle Go SDK reports:

```
Error creating image from instance: Post
"https://iaas.us-phoenix-1.oraclecloud.com/20160918/images":
net/http: HTTP/1.x transport connection broken:
malformed MIME header line: application/json: application/json
```

The client's HTTP parser rejects the response headers before a status line is
available (the response appears to contain a malformed/duplicated
`Content-Type: application/json` header line). This is **100% reproducible** and
**endpoint-specific**.

#### Timeline
- Worked normally until ~2026-07-24.
- Began failing ~2026-07-25 and fails on every build since.
- **No change on our side**: same SDK/plugin/Go binary, same credentials,
same request shape as when it last succeeded. This points to a change in the
us-phoenix-1 CreateImage service / its fronting load balancer or API gateway.

#### Client details
- Oracle Go SDK: **Oracle-GoSDK/65.4.0** (linux/amd64; go/go1.23.7)
- Via HashiCorp packer-plugin-oracle v1.1.1 (also reproduced on v1.1.2)
- Request signed headers: `date (request-target) host content-length content-type x-content-sha256`
- No `Expect: 100-continue` header (explicitly disabled via
`OCI_GOSDK_USING_EXPECT_HEADER=FALSE`); still fails.

#### Reproduction Steps

run 'packer build worker-oci.pkr.hcl` and it failed due to the below error

```
16:30:12 2026/07/27 08:30:11 packer-plugin-oracle_v1.1.2_x5.0_linux_amd64 plugin: DEBUG 2026/07/27 08:30:11.830521 client.go:416: Dump Response HTTP/1.1 200 OK
16:30:12 2026/07/27 08:30:11 packer-plugin-oracle_v1.1.2_x5.0_linux_amd64 plugin: Connection: close
16:30:12 2026/07/27 08:30:11 packer-plugin-oracle_v1.1.2_x5.0_linux_amd64 plugin: Content-Length: 5021
16:30:12 2026/07/27 08:30:11 packer-plugin-oracle_v1.1.2_x5.0_linux_amd64 plugin: Content-Type: application/json
16:30:12 2026/07/27 08:30:11 packer-plugin-oracle_v1.1.2_x5.0_linux_amd64 plugin: Date: Mon, 27 Jul 2026 08:30:11 GMT
16:30:12 2026/07/27 08:30:11 packer-plugin-oracle_v1.1.2_x5.0_linux_amd64 plugin: Etag: XXXXXX
16:30:12 2026/07/27 08:30:11 packer-plugin-oracle_v1.1.2_x5.0_linux_amd64 plugin: Opc-Request-Id: XXXXXX
16:30:12 2026/07/27 08:30:11 packer-plugin-oracle_v1.1.2_x5.0_linux_amd64 plugin: Strict-Transport-Security: max-age=31536000; includeSubDomains;
16:30:12 2026/07/27 08:30:11 packer-plugin-oracle_v1.1.2_x5.0_linux_amd64 plugin: X-Content-Type-Options: nosniff
... ...
16:30:12 2026/07/27 08:30:11 packer-plugin-oracle_v1.1.2_x5.0_linux_amd64 plugin: DEBUG 2026/07/27 08:30:11.830561 http.go:1036: RawResponse does not contain presentIn tag. Skipping
16:30:12 2026/07/27 08:30:11 packer-plugin-oracle_v1.1.2_x5.0_linux_amd64 plugin: DEBUG 2026/07/27 08:30:11.830574 http.go:1013: Unmarshalling from body to field: Instance
16:30:12 2026/07/27 08:30:11 packer-plugin-oracle_v1.1.2_x5.0_linux_amd64 plugin: DEBUG 2026/07/27 08:30:11.830853 http.go:1009: Unmarshaling from header to field: Etag
16:30:12 2026/07/27 08:30:11 packer-plugin-oracle_v1.1.2_x5.0_linux_amd64 plugin: DEBUG 2026/07/27 08:30:11.830874 http.go:1009: Unmarshaling from header to field: OpcRequestId
16:30:12 2026/07/27 08:30:11 ui: ==> oracle-oci.main: Terminated instance.
16:30:12 2026/07/27 08:30:11 [INFO] (telemetry) ending oracle-oci.main
16:30:12 2026/07/27 08:30:11 ui error: Build 'oracle-oci.main' errored after 18 minutes 38 seconds: Error creating image from instance: Post "https://iaas.us-phoenix-1.oraclecloud.com/20160918/images": net/http: HTTP/1.x transport connection broken: malformed MIME header line: application/json: application/json
16:30:12 2026/07/27 08:30:11 ui:
16:30:12 ==> Wait completed after 18 minutes 38 seconds
16:30:12 2026/07/27 08:30:11 machine readable: error-count []string{"1"}
16:30:12 2026/07/27 08:30:11 ui error:
16:30:12 ==> Some builds didn't complete successfully and had errors:
16:30:12 2026/07/27 08:30:11 machine readable: oracle-oci.main,error []string{"Error creating image from instance: Post \"[https://iaas.us-phoenix-1.oraclecloud.com/20160918/images\](https://iaas.us-phoenix-1.oraclecloud.com/20160918/images/)": net/http: HTTP/1.x transport connection broken: malformed MIME header line: application/json: application/json"}
16:30:12 2026/07/27 08:30:11 ui error: --> oracle-oci.main: Error creating image from instance: Post "https://iaas.us-phoenix-1.oraclecloud.com/20160918/images": net/http: HTTP/1.x transport connection broken: malformed MIME header line: application/json: application/json
16:30:12 2026/07/27 08:30:11 ui:
16:30:12 ==> Builds finished but no artifacts were created.
16:30:12 2026/07/27 08:30:11 [INFO] (telemetry) Finalizing.
16:30:12 2026/07/27 08:30:12 waiting for all plugin processes to complete...
16:30:12 2026/07/27 08:30:12 /home/ubuntu/.config/packer/plugins/github.com/hashicorp/ansible/packer-plugin-ansible_v1.1.3_x5.0_linux_amd64: plugin process exited
16:30:12 2026/07/27 08:30:12 /usr/local/bin/packer: plugin process exited
16:30:12 2026/07/27 08:30:12 /home/ubuntu/.config/packer/plugins/github.com/hashicorp/oracle/packer-plugin-oracle_v1.1.2_x5.0_linux_amd64: plugin process exited
```

### Plugin and Packer version

Here are my environment version
- packer: 1.10.3
- packer-plugin-oracle: v1.1.2

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `packer build worker-oci.pkr.hcl` with packer-plugin-oracle v1.1.2 and inspect the `POST /20160918/images` response from `us-phoenix-1`. Compare the Oracle Go SDK HTTP parsing and the logged response headers; done means CreateImage completes without the malformed MIME header error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cloud, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.