oracle/terraform-examples

Error 415 : Unsupported Media Type

cledorze opened this issue · 7 comments

Hello

On :

Terraform v0.11.1
+ provider.null v1.0.0
+ provider.opc v0.1.3

Each of the examples (even simple) ends up with :

* provider.opc: 415: {
  "code" : "UnsupportedMediaType",
  "message" : "Unsupported Media Type"
}

The debug doesn't seems to help but i may track it the wrong way, export TF_LOG=DEBUG till ERROR seems pretty verbose but i can't see the json produced ...

Have a nice day.

Does the following work for you:

$ git clone https://github.com/oracle/terraform-provider-compute
$ cd terraform-provider-compute/examples/opc/instance-with-ssh/
$ ssh-keygen -f ./id_rsa -q -N ""

Create a file terraform.tfvars (set with your account details)

user = "user@example.com"
password = "PASSWORD"
domain = "mydomain"
endpoint = "https://compute.uscom-east-1.oraclecloud.com/"

Then run:

$ terraform init
$ terraform plan
$ terraform apply

Thanks, but still the same issue.

root - terraform.graphNodeRoot
  meta.count-boundary (count boundary fixup) - *terraform.NodeCountBoundary
  provider.opc (close) - *terraform.graphNodeCloseProvider
var.domain - *terraform.NodeRootVariable
var.endpoint - *terraform.NodeRootVariable
var.password - *terraform.NodeRootVariable
var.ssh_public_key_file - *terraform.NodeRootVariable
var.user - *terraform.NodeRootVariable
2017/12/19 09:01:43 [ERROR] root: eval: *terraform.EvalConfigProvider, err: 415: {
  "code" : "UnsupportedMediaType",
  "message" : "Unsupported Media Type"
}

I'm getting the same error. Tested on multiple versions of new opc provider from 0.1.3 to 1.0.1, so assuming this is a syntax issue, however, like @cledorze said, even my simple examples are not working. I'm on Win7 with same error in powershell or cmd. Seems to me it's an auth issue. I get the same error passing fake credentials.

Hold up... I confused the OPC provider with the OCI provider. OPC is for classic api no? So classic auth won't work for new endpoints correct? So in my case, it is probably an auth issue disguised as a resource error. Using this endpoint will generate the error: https://iaas.us-ashburn-1.oraclecloud.com. Using this classic endpoint https://compute.uscom-east-1.oraclecloud.com/ does not and I get an auth error as expected.
Error: Error running plan: 1 error(s) occurred:

  • provider.opc: 401: {"message": "Incorrect username or password"}

OPC provider is for "Oracle Cloud Infrastructure Classic" (previously known as Oracle Public Cloud Compute) and "Oracle Cloud at Customer" (Oracle Cloud Machine)

For the OPC provider authentication you need to set:

More info:

f.y.i the OPC provider and issues repo has moved to the official terraform providers repo at https://github.com/terraform-providers/terraform-provider-opc, this repo location is deprecated.

The "Oracle Cloud Infrastructure" OCI provider is currently maintained at https://github.com/oracle/terraform-provider-oci

Hi
I have also similar issue.
Is there any update.

curl -i -X POST -H "Cookie: $COMPUTE_COOKIE" -H "Content-Type: application/Compute-707014927-v3+json" -H "Accept: application/Compute-707014927-v3+json" -d "@launchplan_instance.json" https://compute.eucom-north-1.oraclecloud.com/launchplan/
HTTP/1.1 415 Unsupported Media Type
Date: Wed, 28 Feb 2018 12:57:31 GMT
Server: nginx
Content-Type: application/json
Content-Length: 37
X-Oracle-Dms-Ecid: 1.005P^L9GMLkFs1c_xh^AyW00010p0061ug;kXjE0ZDLIPJGjCPOpUROcGSRXURB
Expires: Wed, 28 Feb 2018 12:57:31 GMT
X-Oracle-Compute-Call-Id: 180228c62c3674bca62f3b9635b883f1c0cf86
Cache-Control: no-cache
Content-Language: en

{"message": "Unsupported Media Type"}[root@mysql-db1 tmp]

Hi
I have resolve my issue and I can create instance and storage volume now.

Thanks
Sanjay