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

[BUG] Adding nameserver fails #37

Open
4 tasks done
igorakkerman opened this issue Sep 9, 2024 · 5 comments
Open
4 tasks done

[BUG] Adding nameserver fails #37

igorakkerman opened this issue Sep 9, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@igorakkerman
Copy link

Checklist

  • I have used the latest version of terraform (if not please provide a version number).
  • I have used the latest version of this terraform provider (if not please provide a version number).
  • I have provided a sample .tf configuration under "Additional context".
  • I have answered the following question: Is this issue reproducible in OT&E or only applies to live?

Describe the bug
Trying to create a nameserver resource in order to add DNS records for a domain before transferring it to INWX from another registrar.

To Reproduce
Create resource inwx_nameserver

Expected behavior
Nameserver resource is created.

Additional context
Output of terraform apply: (domain name changed for demonstration purposes to example.com)

Terraform will perform the following actions:

  # inwx_nameserver.example_com_master will be created
  + resource "inwx_nameserver" "example_com_master" {
      + domain      = "example.com"
      + id          = (known after apply)
      + nameservers = [
          + "ns.inwx.de",
          + "ns2.inwx.de",
        ]
      + type        = "MASTER"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

inwx_nameserver.example_com_master: Creating...
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to inwx_nameserver.example_com_master, provider "provider[\"registry.terraform.io/inwx/inwx\"]" produced an  
│ unexpected new value: Root object was present, but now absent.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Only tested in live system.

Sample .tf configuration:

resource "inwx_nameserver" "example_com_master" {
  domain = "example.com"
  type   = "MASTER"
  nameservers = [
    "ns.inwx.de",
    "ns2.inwx.de",
  ]
}
@igorakkerman igorakkerman added the bug Something isn't working label Sep 9, 2024
@igorakkerman igorakkerman changed the title [BUG] Add nameserver fails [BUG] Adding nameserver fails Sep 10, 2024
@iamdevnull
Copy link

I have a similar issue:

resource "inwx_nameserver" "xxx" {
  domain = "xxx"
  type   = "MASTER"
  nameservers = [
    "ns.inwx.de",
    "ns2.inwx.de",
    "ns3.inwx.eu"
  ]
}
│ Error: Could not add nameserver record
│ 
│   with inwx_nameserver.fuenfVorflug_at,
│   on at.tf line 1, in resource "inwx_nameserver" "xxx":
│    1: resource "inwx_nameserver" "xxx" {
│ 
│ API response not status code 1000 or 1001. Got response: {"code":2302,"details":[{"code":"DOMAIN_IN_DNS","msg":"The domain is already in the DNS"}],"msg":"Object exists","reason":"The domain is already in the
│ DNS.","reasonCode":"Error_DomainAlreadyInDNS"}
╵

Please help.

@igorakkerman
Copy link
Author

@iamdevnull fyi as a workaround, I looked up the ID of the nameserver resource using the Python API client (https://github.com/inwx/python-client) and used terraform import to get it into the state.

@iamdevnull
Copy link

@igorakkerman thx a lot!

@iamdevnull
Copy link

@iamdevnull fyi as a workaround, I looked up the ID of the nameserver resource using the Python API client (https://github.com/inwx/python-client) and used terraform import to get it into the state.

Can you maybe share with me your code. Which output param did you use as input for tf import?

https://www.inwx.de/en/help/apidoc/f/ch02s15.html#nameserver.info

@igorakkerman
Copy link
Author

igorakkerman commented Sep 16, 2024

@iamdevnull I believe I just printed the result of the API call to the console and copy-pasted the id field:

api_client.call_api(api_method="nameserver.info", method_params= { 
    "domain": "mydomain.com"
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants