Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to register .app domain: (json: cannot unmarshal string into Go struct field ErrorResponse.errors of type []string) #248

Open
mpereira opened this issue Dec 22, 2024 · 1 comment

Comments

@mpereira
Copy link

I have other non-app dnsimple_registered_domain that were created in the past with no issues. I'm not sure if it's related to the fact that the domain is .app. The error output doesn't provide any specific information.

resource "dnsimple_registered_domain" "<REDACTED>_dot_app" {
  name = "<REDACTED>.app"

  contact_id            = dnsimple_contact.<REDACTED>.id
  auto_renew_enabled    = true
  whois_privacy_enabled = true
  dnssec_enabled        = true
}

resource "dnsimple_zone_record" "redirect_www_<REDACTED>_dot_app_to_<REDACTED>_dot_app" {
  zone_name = dnsimple_registered_domain.<REDACTED>_dot_app.name
  name      = "www"
  value     = "https://<REDACTED>.app"
  type      = "URL"
  ttl       = 3600
}

Running terraform apply shows:

dnsimple_registered_domain.<REDACTED>_dot_app: Creating...
╷
│ Error: failed to register DNSimple Domain
│ 
│   with dnsimple_registered_domain.<REDACTED>_dot_app,
│   on main.tf line 296, in resource "dnsimple_registered_domain" "<REDACTED>_dot_app":
│  296: resource "dnsimple_registered_domain" "<REDACTED>_dot_app" {
│ 
│ json: cannot unmarshal string into Go struct field ErrorResponse.errors of type []string

Relevant TF_LOG=debug terraform apply output:

2024-12-22T20:36:58.247+0100 [DEBUG] Starting graph walk: walkApply
2024-12-22T20:36:58.249+0100 [DEBUG] created provider logger: level=debug
2024-12-22T20:36:58.249+0100 [INFO]  provider: configuring client automatic mTLS
2024-12-22T20:36:58.252+0100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/dnsimple/dnsimple/1.8.0/darwin_arm64/terraform-provider-dnsimple_v1.8.0 args=[.terraform/providers/registry.terraform.io/dnsimple/dnsimple/1.8.0/darwin_arm64/terraform-provider-dnsimple_v1.8.0]
2024-12-22T20:36:58.254+0100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/dnsimple/dnsimple/1.8.0/darwin_arm64/terraform-provider-dnsimple_v1.8.0 pid=8166
2024-12-22T20:36:58.254+0100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/dnsimple/dnsimple/1.8.0/darwin_arm64/terraform-provider-dnsimple_v1.8.0
2024-12-22T20:36:58.287+0100 [INFO]  provider.terraform-provider-dnsimple_v1.8.0: configuring server automatic mTLS: timestamp=2024-12-22T20:36:58.287+0100
2024-12-22T20:36:58.293+0100 [DEBUG] provider.terraform-provider-dnsimple_v1.8.0: plugin address: address=/var/folders/nn/120cjkpx75b8z_jcvjm04_940000gn/T/plugin1805725203 network=unix timestamp=2024-12-22T20:36:58.293+0100
2024-12-22T20:36:58.293+0100 [DEBUG] provider: using plugin: version=6
2024-12-22T20:36:58.304+0100 [DEBUG] No provider meta schema returned
2024-12-22T20:36:58.307+0100 [DEBUG] skipping FixUpBlockAttrs
2024-12-22T20:36:58.308+0100 [DEBUG] provider.terraform-provider-dnsimple_v1.8.0: Marking Computed attributes with null configuration values as unknown (known after apply) in the plan to prevent potential Terraform errors: tf_provider_addr=registry.terraform.io/dnsimple/dnsimple @caller=github.com/hashicorp/[email protected]/internal/fwserver/server_planresourcechange.go:217 tf_mux_provider=*proto6server.Server tf_req_id=4bc6b782-5efa-1254-634a-ddd6efe7342b tf_resource_type=dnsimple_registered_domain tf_rpc=PlanResourceChange @module=sdk.framework timestamp=2024-12-22T20:36:58.308+0100
2024-12-22T20:36:58.308+0100 [DEBUG] provider.terraform-provider-dnsimple_v1.8.0: marking computed attribute that is null in the config as unknown: tf_req_id=4bc6b782-5efa-1254-634a-ddd6efe7342b tf_resource_type=dnsimple_registered_domain @caller=github.com/hashicorp/[email protected]/internal/fwserver/server_planresourcechange.go:467 @module=sdk.framework tf_attribute_path=AttributeName("account_id") tf_provider_addr=registry.terraform.io/dnsimple/dnsimple tf_rpc=PlanResourceChange tf_mux_provider=*proto6server.Server timestamp=2024-12-22T20:36:58.308+0100
dnsimple_registered_domain.<REDACTED>_dot_app: Creating...
2024-12-22T20:36:58.328+0100 [DEBUG] provider.terraform-provider-dnsimple_v1.8.0: marking computed attribute that is null in the config as unknown: @module=sdk.framework tf_provider_addr=registry.terraform.io/dnsimple/dnsimple tf_req_id=4bc6b782-5efa-1254-634a-ddd6efe7342b @caller=github.com/hashicorp/[email protected]/internal/fwserver/server_planresourcechange.go:467 tf_attribute_path=AttributeName("transfer_lock_enabled") tf_mux_provider=*proto6server.Server tf_resource_type=dnsimple_registered_domain tf_rpc=PlanResourceChange timestamp=2024-12-22T20:36:58.308+0100
2024-12-22T20:36:58.328+0100 [DEBUG] provider.terraform-provider-dnsimple_v1.8.0: marking computed attribute that is null in the config as unknown: @module=sdk.framework tf_provider_addr=registry.terraform.io/dnsimple/dnsimple tf_req_id=4bc6b782-5efa-1254-634a-ddd6efe7342b tf_resource_type=dnsimple_registered_domain tf_rpc=PlanResourceChange @caller=github.com/hashicorp/[email protected]/internal/fwserver/server_planresourcechange.go:467 tf_attribute_path=AttributeName("state") tf_mux_provider=*proto6server.Server timestamp=2024-12-22T20:36:58.308+0100
2024-12-22T20:36:58.328+0100 [INFO]  Starting apply for dnsimple_registered_domain.<REDACTED>_dot_app
2024-12-22T20:36:58.360+0100 [DEBUG] provider.terraform-provider-dnsimple_v1.8.0: marking computed attribute that is null in the config as unknown: @module=sdk.framework tf_attribute_path=AttributeName("domain_registration") tf_provider_addr=registry.terraform.io/dnsimple/dnsimple tf_rpc=PlanResourceChange @caller=github.com/hashicorp/[email protected]/internal/fwserver/server_planresourcechange.go:467 tf_mux_provider=*proto6server.Server tf_req_id=4bc6b782-5efa-1254-634a-ddd6efe7342b tf_resource_type=dnsimple_registered_domain timestamp=2024-12-22T20:36:58.308+0100
2024-12-22T20:36:58.360+0100 [DEBUG] skipping FixUpBlockAttrs
2024-12-22T20:36:58.395+0100 [DEBUG] provider.terraform-provider-dnsimple_v1.8.0: marking computed attribute that is null in the config as unknown: tf_attribute_path=AttributeName("registrant_change") tf_mux_provider=*proto6server.Server tf_provider_addr=registry.terraform.io/dnsimple/dnsimple tf_req_id=4bc6b782-5efa-1254-634a-ddd6efe7342b tf_rpc=PlanResourceChange @caller=github.com/hashicorp/[email protected]/internal/fwserver/server_planresourcechange.go:467 @module=sdk.framework tf_resource_type=dnsimple_registered_domain timestamp=2024-12-22T20:36:58.308+0100
2024-12-22T20:36:58.395+0100 [DEBUG] dnsimple_registered_domain.<REDACTED>_dot_app: applying the planned Create change
2024-12-22T20:36:58.395+0100 [DEBUG] provider.terraform-provider-dnsimple_v1.8.0: marking computed attribute that is null in the config as unknown: @module=sdk.framework tf_provider_addr=registry.terraform.io/dnsimple/dnsimple tf_resource_type=dnsimple_registered_domain @caller=github.com/hashicorp/[email protected]/internal/fwserver/server_planresourcechange.go:467 tf_attribute_path=AttributeName("unicode_name") tf_mux_provider=*proto6server.Server tf_req_id=4bc6b782-5efa-1254-634a-ddd6efe7342b tf_rpc=PlanResourceChange timestamp=2024-12-22T20:36:58.308+0100
2024-12-22T20:36:58.427+0100 [DEBUG] provider.terraform-provider-dnsimple_v1.8.0: marking computed attribute that is null in the config as unknown: tf_resource_type=dnsimple_registered_domain tf_provider_addr=registry.terraform.io/dnsimple/dnsimple tf_attribute_path=AttributeName("expires_at") tf_mux_provider=*proto6server.Server tf_req_id=4bc6b782-5efa-1254-634a-ddd6efe7342b tf_rpc=PlanResourceChange @caller=github.com/hashicorp/[email protected]/internal/fwserver/server_planresourcechange.go:467 @module=sdk.framework timestamp=2024-12-22T20:36:58.308+0100
2024-12-22T20:36:58.463+0100 [DEBUG] provider.terraform-provider-dnsimple_v1.8.0: marking computed attribute that is null in the config as unknown: tf_provider_addr=registry.terraform.io/dnsimple/dnsimple tf_resource_type=dnsimple_registered_domain tf_rpc=PlanResourceChange @module=sdk.framework tf_mux_provider=*proto6server.Server @caller=github.com/hashicorp/[email protected]/internal/fwserver/server_planresourcechange.go:467 tf_attribute_path=AttributeName("id") tf_req_id=4bc6b782-5efa-1254-634a-ddd6efe7342b timestamp=2024-12-22T20:36:58.308+0100
2024-12-22T20:37:00.295+0100 [ERROR] provider.terraform-provider-dnsimple_v1.8.0: Response contains error diagnostic: diagnostic_detail="json: cannot unmarshal string into Go struct field ErrorResponse.errors of type []string" tf_proto_version=6.6 tf_provider_addr=registry.terraform.io/dnsimple/dnsimple @caller=github.com/hashicorp/[email protected]/tfprotov6/internal/diag/diagnostics.go:58 @module=sdk.proto diagnostic_severity=ERROR diagnostic_summary="failed to register DNSimple Domain" tf_req_id=b35e50c2-f368-6c83-c8e3-5d025c61719f tf_resource_type=dnsimple_registered_domain tf_rpc=ApplyResourceChange timestamp=2024-12-22T20:37:00.295+0100
2024-12-22T20:37:00.297+0100 [ERROR] vertex "dnsimple_registered_domain.<REDACTED>_dot_app" error: failed to register DNSimple Domain
2024-12-22T20:37:00.297+0100 [DEBUG] states/remote: state read serial is: 276; serial is: 276
2024-12-22T20:37:00.297+0100 [DEBUG] states/remote: state read lineage is: 0a75ab6a-0e3a-2734-312b-a72e1264a4c6; lineage is: 0a75ab6a-0e3a-2734-312b-a72e1264a4c6
╷
│ Error: failed to register DNSimple Domain
│ 
│   with dnsimple_registered_domain.<REDACTED>_dot_app,
│   on main.tf line 296, in resource "dnsimple_registered_domain" "<REDACTED>_dot_app":
│  296: resource "dnsimple_registered_domain" "<REDACTED>_dot_app" {
│ 
│ json: cannot unmarshal string into Go struct field ErrorResponse.errors of type []string
╵
Releasing state lock. This may take a few moments...
2024-12-22T20:37:00.877+0100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-12-22T20:37:00.879+0100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/dnsimple/dnsimple/1.8.0/darwin_arm64/terraform-provider-dnsimple_v1.8.0 pid=8166
2024-12-22T20:37:00.879+0100 [DEBUG] provider: plugin exited
make: *** [Makefile:380: terraform_apply] Error 1
@mpereira
Copy link
Author

mpereira commented Dec 22, 2024

I found that the issue was that .app domains require an extended attribute:

curl 'https://api.dnsimple.com/v2/tlds/app/extended_attributes' \
     -H 'Authorization: Bearer <token>' \
     -H 'Accept: application/json''
{
  "data": [
    {
      "name": "x-accept-ssl-requirement",
      "title": ".app is a secure namespace",
      "description": null,
      "required": true,
      "options": [
        {
          "title": "i acknowledge that https is required for all .app websites, as they will be encrypted by default and will not allow insecure connections.",
          "value": "1",
          "description": null
        }
      ]
    }
  ]
}

So the resource needed an extended_attributes field:

resource "dnsimple_registered_domain" "<REDACTED>_dot_app" {
  name = "<REDACTED>.app"

  contact_id            = dnsimple_contact.<REDACTED>.id
  auto_renew_enabled    = true
  whois_privacy_enabled = true
  dnssec_enabled        = true

  extended_attributes = {
    "x-accept-ssl-requirement" = "1"
  }
}

The error message from the Terraform provider could show the information available in v2/tlds/app/extended_attributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant