Start to finish deployment time was roughly an hour minor deployment hiccups: • I didn't run ./task dev after updating by task.env which i believe caused an error because i wasn't sending the correct github repo. • you have to run ./task init at least once before deployment before being on the happy path. Current blocker:
➜ bean git:(master) ✗ ./task tf apply
Error: Could not load plugin
Plugin reinitialization required. Please run "terraform init".
Plugins are external binaries that Terraform uses to access and manipulate
resources. The configuration provided requires plugins which can't be located,
don't satisfy the version constraints, or are otherwise incompatible.
Terraform automatically discovers provider requirements from your
configuration, including providers used in child modules. To see the
requirements and constraints, run "terraform providers".
Failed to instantiate provider
"<http://registry.terraform.io/digitalocean/digitalocean|registry.terraform.io/digitalocean/digitalocean>" to obtain schema: unknown
provider "<http://registry.terraform.io/digitalocean/digitalocean|registry.terraform.io/digitalocean/digitalocean>"
I wonder if terraform didn't update something? Looking there instructions, i see some variables were missing. "do_token" "pvt_key" . If i copy the "http://provider.tf" directly into my project and run terraform init (which before gives the same error as above) it succeeds.The error says the provider is uknown though...
➜ bean git:(master) ✗ terraform providers
Providers required by configuration:
.
└── provider[<http://registry.terraform.io/digitalocean/digitalocean|registry.terraform.io/digitalocean/digitalocean>] 1.22.2
DIGITALOCEAN_API_KEY isn't in this list: https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs
we add it to the vars though
I really hope terraform doesn't do breaking changes.
maybe ... https://www.terraform.io/upgrade-guides/0-13.html#explicit-provider-source-locations
FIXED. you have to run ./task tf init
which the error makes clear but obviously we have to run it via the ./task command to keep the correct context.
rror: Error creating droplet: POST https://api.digitalocean.com/v2/droplets: 422 .... are invalid key identifiers for Droplet creation. I can only assume my ssh key in the config/ssh-public-key folder is somehow wrong.
I added my computers public ssh key to digital ocean and that didn't work.. though maybe i should wait a minute.
i can't figure out what else it could be. Ill wait 30 minutes and try again.
thanks for the experience report--perhaps it would be good to add some checks to the various task
commands. so e.g. it could tell you "you need to run ./task init
first" etc.
did you run ./task build-image
successfully?
If so, you should have something like export IMAGE_ID=12345 # Managed by Biff.
in config/task.env
. If not, that would probably be the cause of the 422 error.
I added an issue to the repo: https://github.com/jacobobryant/biff/issues/66
this is another issue that might be a good idea: https://github.com/jacobobryant/biff/issues/59
There is an IMAGE_ID="..." in my config/task file.
I'n not sure what the Error is saying:
Error: Error creating droplet: POST <https://api.digitalocean.com/v2/droplets>: 422 c1:de:81:ac:1c:1f:4b:61:1f:f2:4c:a4:f8:1c:b6:75 are invalid key identifiers for Droplet creation.
Is that saying the hashmap has invalid keys? or that the values are invalid. If only someone had invented a system which made it easy to tell the difference!
ah I see. yes that does look like a problem with the public key.
{
"webserver" : {
"image" : "${var.image_id}",
"name" : "biff-webserver",
"region" : "nyc1",
"size" : "s-1vcpu-1gb",
"private_networking" : true,
"ssh_keys" : [ "${var.ssh_key_fingerprint}" ],
"connection" : {
"host" : "${self.ipv4_address}",
"user" : "root",
"type" : "ssh",
"timeout" : "2m"
},
"provisioner" : [ {
"file" : {
"source" : "../config/main.edn",
"destination" : "/home/biff/config/main.edn"
}
}, {
"file" : {
"content" : "${var.deploy_key}",
"destination" : "/home/biff/.ssh/id_rsa"
}
} ]
}
}
We can likely eliminate constants: so its either image_id, ssh_key_fingerprint, ipv4_address, source, destination or deploy_key.
maybe my key has a passphrase and they dont allow that?
ill make a new one.
I'm on my phone at the moment, I'll do some testing when I get home too. the public key thing was a little tricky to get set up. I was hoping to get the config right so that you don't need to add your public key in the digital ocean ui, but I didn't actually test it using a new public key that I hadn't already added to my account
gotcha. no worries.
pass phrase on the ssh key should be fine
its likely that i mixed up the ssh keys. That would be an easy mistake to make here and i took a break inbetween those steps! i probably posted the wrong one.
its working now. Either i mixed up the ssh keys or it was because i never ran git push to get my code to the repo.
ah good to hear. it's probably the ssh keys. without the git push, the ./task tf apply
command should still run fine, but there would be an error later when your app attempts to start up