Bad response statusCode [455]

Terraform Version

$ terraform -v
Terraform v0.11.6
+ provider.rancher v1.2.0
+ provider.template v1.0.0

Affected Resource(s)

Please list the resources as a list, for example:

  • rancher_stack

Terraform Configuration Files

$ cat docker-compose.yml.tpl

version: '2'
services:
  web:
    image: ${image_name}

$ cat rancher-compose.yml.tpl

version: '2'
services:
  web:
    scale: ${scale_count}

$ cat main.tf

provider "rancher" {
  api_url    = "${var.rancher_api_url}"
  access_key = "${var.rancher_access_key}"
  secret_key = "${var.rancher_secret_key}"
}

data "template_file" "docker-compose" {
  template = "${file("${path.module}/docker-compose.yml.tpl")}"

  vars {
    image_name = "${var.image_name}"
  }
}

data "template_file" "rancher-compose" {
  template = "${file("${path.module}/rancher-compose.yml.tpl")}"

  vars {
    scale_count = "${var.scale_count}"
  }
}

data "rancher_environment" "rancher_environment" {
  name = "${var.environment}"
}

resource "rancher_stack" "test" {
  name            = "test"
  description     = "teststack"
  environment_id  = "${data.rancher_environment.rancher_environment.id}"
  scope           = "user"
  docker_compose  = "${data.template_file.docker-compose.rendered}"
  rancher_compose = "${data.template_file.rancher-compose.rendered}"
  start_on_create = true
  finish_upgrade  = true
}

Panic Output

# successfully applied the change

$ terraform init
$ terraform apply

# but has issue to change the setting or destroy

$ TF_VAR_scale_count=3 terraform apply
> rancher_stack.test: Error deleting Stack: Bad response statusCode [455]. Status [455 ]. Body: [] from [https://rancher.xxx.com/v2-beta/projects/1a7/stacks/1st31]

$ terraform destroy
> rancher_stack.test: Error deleting Stack: Bad response statusCode [455]. Status [455 ]. Body: [] from [https://rancher.xxx.com/v2-beta/projects/1a7/stacks/1st31]

Secondly, when plan it after apply, always see the change:

~ rancher_stack.test
    rancher_compose:   version: '2'
                        services:
                          web:
                            scale: 3
                       -    start_on_create: true

Report the issue to terraform as well: https://github.com/terraform-providers/terraform-provider-rancher/issues/69

Do you have some sort of proxy/corporate spying device in front of the server? I don’t think that status is coming from us…

1 Like

We do have proxy. Thanks.

How can I troubleshooting this issue? Rancher server logs?

Since it’s returning an error code the proxy is probably not even successfully to reach Rancher, but you could check the server container log anyway. 455 is not a standard response code, and didn’t even bring up any reference to any common software returning it with a cursory Googling.

Thanks, Vincent.

I will go through deeply for the logs.

But the interesting part is, when I run first time to terraform apply, it works and I can see the new rancher stack running.