terraform-provider-openstack / terraform-provider-openstack

Terraform OpenStack provider
https://registry.terraform.io/providers/terraform-provider-openstack/openstack/latest/docs
Mozilla Public License 2.0
379 stars 361 forks source link

Error creating openstack_networking_router_v2: Resource not found #1274

Closed Shabirmean closed 2 years ago

Shabirmean commented 3 years ago

Terraform Version

Terraform v0.14.9
+ provider registry.terraform.io/terraform-provider-openstack/openstack v1.43.0

Affected Resource(s)

Terraform Configuration Files

provider "openstack" {
  user_name     = var.os_user_name
  tenant_name   = var.os_tenant_name
  password      = var.os_password
  auth_url      = var.os_auth_url
  region        = var.os_region
  endpoint_type = var.os_endpoint_type
  use_octavia   = true
}

resource "openstack_networking_router_v2" "abm" {
  name                = "abm"
  admin_state_up      = true
  external_network_id = var.external_network_id
}

Debug Output

2021-07-31T02:39:02.689+0530 [DEBUG] plugin.terraform-provider-openstack_v1.43.0: 2021/07/31 02:39:02 [DEBUG] OpenStack Response Code: 404
2021-07-31T02:39:02.689+0530 [DEBUG] plugin.terraform-provider-openstack_v1.43.0: 2021/07/31 02:39:02 [DEBUG] OpenStack Response Headers:
2021-07-31T02:39:02.689+0530 [DEBUG] plugin.terraform-provider-openstack_v1.43.0: Content-Length: 138
2021-07-31T02:39:02.689+0530 [DEBUG] plugin.terraform-provider-openstack_v1.43.0: Content-Type: application/json
2021-07-31T02:39:02.689+0530 [DEBUG] plugin.terraform-provider-openstack_v1.43.0: Date: Fri, 30 Jul 2021 21:09:02 GMT
2021-07-31T02:39:02.689+0530 [DEBUG] plugin.terraform-provider-openstack_v1.43.0: X-Openstack-Request-Id: req-152804d3-601e-4a54-82f5-211e08dbb7a7
2021-07-31T02:39:02.689+0530 [DEBUG] plugin.terraform-provider-openstack_v1.43.0: 2021/07/31 02:39:02 [DEBUG] OpenStack Response Body: {
2021-07-31T02:39:02.689+0530 [DEBUG] plugin.terraform-provider-openstack_v1.43.0:   "NeutronError": {
2021-07-31T02:39:02.689+0530 [DEBUG] plugin.terraform-provider-openstack_v1.43.0:     "detail": "",
2021-07-31T02:39:02.689+0530 [DEBUG] plugin.terraform-provider-openstack_v1.43.0:     "message": "Network 47794d2e-ef2a-4b6c-8dc6-7e4d400a658b could not be found.",
2021-07-31T02:39:02.689+0530 [DEBUG] plugin.terraform-provider-openstack_v1.43.0:     "type": "NetworkNotFound"
2021-07-31T02:39:02.689+0530 [DEBUG] plugin.terraform-provider-openstack_v1.43.0:   }
2021-07-31T02:39:02.689+0530 [DEBUG] plugin.terraform-provider-openstack_v1.43.0: }
2021/07/31 02:39:02 [DEBUG] openstack_networking_router_v2.abm: apply errored, but we're indicating that via the Error pointer rather than returning it: Error creating openstack_networking_router_v2: Resource not found

Error: Error creating openstack_networking_router_v2: Resource not found

  on main.tf line 27, in resource "openstack_networking_router_v2" "abm":
  27: resource "openstack_networking_router_v2" "abm" {

2021-07-31T02:39:02.714+0530 [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-07-31T02:39:02.716+0530 [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/terraform-provider-openstack/openstack/1.43.0/darwin_amd64/terraform-provider-openstack_v1.43.0 pid=19475
2021-07-31T02:39:02.716+0530 [DEBUG] plugin: plugin exited

Panic Output

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. terraform apply on the above script

Important Factoids

References

Shabirmean commented 2 years ago

This error was due to using the incorrect public network id. Putting in the correct network id fixed it