inwx / terraform-provider-inwx

INWX Terraform Provider plugin for Terraform
MIT License
19 stars 5 forks source link

Deletion fails #12

Closed Semptic closed 11 months ago

Semptic commented 1 year ago

If I try to destroy my stack with an dns record I'm getting following error:

Error: Could not delete nameserver record

could not unmarshal rpc response to json: unexpected end of JSON input, {"method":"nameserver.deleteRecord","params":{"id":"xxx"}}, https://api.domrobot.com/jsonrpc/, 200 OK

Is there anything I can do about it?

aspettl commented 12 months ago

Same issue here, needed to delete the records and clean up the terraform state manually.

costasd commented 11 months ago

Same here. It seems that it is because deleteRecord doesn't return anything, according to the API docs.

...whereas Call() attempts to unmarshal response body no matter what:

https://github.com/inwx/terraform-provider-inwx/blob/51722d8bf999997e6784cd0a46fe4568a06ce6f4/inwx/internal/api/client.go#L110-L114

I prepared a PR around this, #16, but it's the first time looking at this code, so might or might not be the best approach.

Works when tested in my previously failing setup, but would prefer more people to test it!