Comments (4)
Hi @snick
I have just been investigating this as follows (on master)
I started with this config:
provider "digitalocean" {}
resource "digitalocean_domain" "foobar" {
name = "foobar-test-terraform-stack72.com"
ip_address = "192.168.0.10"
}
resource "digitalocean_record" "foo_record" {
domain = "${digitalocean_domain.foobar.name}"
name = "terraform"
value = "foobar.${digitalocean_domain.foobar.name}."
type = "MX"
priority = "10"
}
I then went to the DO console and deleted the MX record. When i ran terraform plan, I expected to get the same crash as you did. Unfortunately, I didn't
% terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
digitalocean_domain.foobar: Refreshing state... (ID: foobar-test-terraform-stack72.com)
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed. Cyan entries are data sources to be read.
Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.
+ digitalocean_record.foo_record
domain: "foobar-test-terraform-stack72.com"
fqdn: "<computed>"
name: "terraform"
port: "<computed>"
priority: "10"
ttl: "<computed>"
type: "MX"
value: "foobar.foobar-test-terraform-stack72.com."
weight: "<computed>"
Plan: 2 to add, 0 to change, 0 to destroy.
We recently updated the DO SDK version and I believe this will have been fixed in their SDK. The panic that you got was actually here:
if err != nil {
// If the record is somehow already destroyed, mark as
// successfully gone
if resp.StatusCode == 404 {
d.SetId("")
return nil
}
return err
}
It looks like when there was an error, there was no response from the API. But it returns the correct status code now
Can you confirm for me that the record it crashed on was actually missing from the DO console?
Thanks
Paul
from terraform-provider-digitalocean.
Hi @stack72
Yes, I confirm missing record.
It was a series of tf-file modifications and at the moment terraform starts crashing.
Next day I've been started from a scratch and no crashes anymore.
from terraform-provider-digitalocean.
Hi @snick
I am 100% sure this has been fixed in master - and will be released as part of 0.10.0
I am sorry you have to wait that long
Thanks
Paul
from terraform-provider-digitalocean.
Hi @snick
by looking into the crash log it seems it crashed because the SDK returned nil
response.
It points to this line of code:
https://github.com/hashicorp/terraform/blob/v0.9.6/builtin/providers/digitalocean/resource_digitalocean_record.go#L127
which still exists in the latest version.
That said there isn't enough information to verify this was the case retrospectively and this looks like a misbehaviour of the SDK, rather than provider code. i.e. I'd always expect to get a valid response (whether that's error or success).
The good thing is that we have extra logging in place which allows us to log every single HTTP request and response. I assume having those details would help in this context, so we have it if it happens next time.
With that I'm going to close this issue, but please do let us know if it reappears in the latest release.
Thanks.
from terraform-provider-digitalocean.
Related Issues (20)
- Release v2.35.0 HOT 1
- Add droplet monitor alert for cloud-init completion
- digitalocean_spaces_bucket_cors_configuration: Updating allowed origins has no effect HOT 4
- Add optional "signature" field for `digitalocean_custom_image` resources
- Missing registry_credentials in digitalocean_app.service.image for registry_type = "GHCR" HOT 4
- feature: resource for firewall rule
- digitalocean_cdn custom domain certificate fails "invalid certificate issued by Cloudflare origin CA" HOT 1
- Add Postgres database attributes HOT 2
- digitalocean_spaces_bucket_cors_configuration: Does not allow to order CORS rules
- `digitalocean_project` created on failure, absent from TF state HOT 2
- App Platform image credentials set as required HOT 3
- Dedicated egress IP addresses support for App platform
- digitalocean_spaces_bucket NoSuchBucket while creating bucket HOT 3
- digitalocean_kubernetes_cluster. to support database operator HOT 2
- Consider adding GPG key to OpenTofu registry for the digitalocean provider HOT 2
- Support for database fork
- digitalocean_firewall blocks all ports
- digitalocean_ssh_key race condition (roduced an unexpected new value: Root object was present, but now absent) HOT 1
- digitalocean_database_cluster password is always empty HOT 5
- functions: feature: add resource, and data source for functions and namespaces
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-digitalocean.