Open FlxPeters opened 2 years ago
I could fix the issue by removing the resources from state and re-import them. Terraform gives me a change for:
~ resource "my_monitor" "http" {
+ http_method = "GET"
After re-import everything works as expected.
This fails for me as well, without migrating from the old provider
uptimerobot_monitor.platform_production: Creating...
╷
│ Error: Plugin did not respond
│
│ with uptimerobot_monitor.platform_production,
│ on main.tf line 50, in resource "uptimerobot_monitor" "platform_production":
│ 50: resource "uptimerobot_monitor" "platform_production" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵
Stack trace from the terraform-provider-uptimerobot_v0.8.0 plugin:
panic: interface conversion: interface {} is nil, not float64
goroutine 25 [running]:
github.com/vexxhost/terraform-provider-uptimerobot/internal/provider/api.UptimeRobotApiClient.GetMonitor({{0x1400013c2a0, 0x21}}, 0x2f594d12)
github.com/vexxhost/terraform-provider-uptimerobot/internal/provider/api/monitor.go:156 +0x14d4
github.com/vexxhost/terraform-provider-uptimerobot/internal/provider/api.UptimeRobotApiClient.CreateMonitor({{0x1400013c2a0, 0x21}}, {{0x1400028e0d8, 0x13}, {0x1400028e108, 0x16}, {0x14000282284, 0x4}, 0x12c, {0x0, ...}, ...})
github.com/vexxhost/terraform-provider-uptimerobot/internal/provider/api/monitor.go:278 +0x1a78
github.com/vexxhost/terraform-provider-uptimerobot/internal/provider.resourceMonitorCreate(0x14000295300, {0x100ba9420, 0x14000284280})
github.com/vexxhost/terraform-provider-uptimerobot/internal/provider/resource_uptimerobot_monitor.go:175 +0x7bc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x1400009a700, {0x100be76b8, 0x1400028a4c0}, 0x14000295300, {0x100ba9420, 0x14000284280})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/resource.go:329 +0x170
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x1400009a700, {0x100be76b8, 0x1400028a4c0}, 0x14000438820, 0x14000295180, {0x100ba9420, 0x14000284280})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/resource.go:467 +0x8d8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x1400000c780, {0x100be76b8, 0x1400028a4c0}, 0x14000430640)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/grpc_provider.go:977 +0xe38
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x140000bcb80, {0x100be7760, 0x14000094210}, 0x140004c9c00)
github.com/hashicorp/terraform-plugin-go@v0.5.0/tfprotov5/tf5server/server.go:603 +0x338
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x100ba39c0, 0x140000bcb80}, {0x100be7760, 0x14000094210}, 0x14000138720, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.5.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:380 +0x1c0
google.golang.org/grpc.(*Server).processUnaryRPC(0x140000ac700, {0x100bf2f58, 0x14000400680}, 0x140004bc240, 0x14000396d50, 0x10106a7a0, 0x0)
google.golang.org/grpc@v1.43.0/server.go:1282 +0xc60
google.golang.org/grpc.(*Server).handleStream(0x140000ac700, {0x100bf2f58, 0x14000400680}, 0x140004bc240, 0x0)
google.golang.org/grpc@v1.43.0/server.go:1616 +0xa34
google.golang.org/grpc.(*Server).serveStreams.func1.2(0x1400042a520, 0x140000ac700, {0x100bf2f58, 0x14000400680}, 0x140004bc240)
google.golang.org/grpc@v1.43.0/server.go:921 +0x94
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.43.0/server.go:919 +0x1f0
Error: The terraform-provider-uptimerobot_v0.8.0 plugin crashed!
This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.
Fairly minimal setup:
variable "uptimerobot_api_key" {
type = string
description = "Uptime Robot API Key"
}
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
uptimerobot = {
source = "vexxhost/uptimerobot"
version = "0.8.0"
}
}
}
provider "uptimerobot" {
api_key = "${var.uptimerobot_api_key}"
}
data "uptimerobot_account" "account" {}
# data "uptimerobot_alert_contact" "default_alert_contact" {
# friendly_name = data.uptimerobot_account.account.email
# value = data.uptimerobot_account.account.email
# }
# resource "uptimerobot_alert_contact" "slack" {
# friendly_name = "Slack Alert"
# type = "slack"
# value = "https://hooks.slack.com/services/XXXXXXX"
# }
# Create a monitor
resource "uptimerobot_monitor" "platform_production" {
friendly_name = "Platform Production"
type = "http"
url = "https://partmax.com.au"
interval = 300
# alert_contact {
# id = data.uptimerobot_alert_contact.default_alert_contact.id
# }
}
And a newly created FREE uptimerobot account (I'm planning to upgrade, but first things first).
If I use 0.8.2 instead of 0.8.0 which is linked from the readme then this is fixed.
Might be worth merging:
https://github.com/vexxhost/terraform-provider-uptimerobot/pull/19
When running the plugin with Terraform 1.2 I get an interface conversion error. Code was transferred from
louy/uptimerobot
and provider replaced like documented in the README.The following stack trace is generated on
plan
and onapply
.