`Automatic setup using Colaboratory` fails in configure password step
In Automatic setup using Colaboratory, the following step causes an error.
# Configure password
!/root/.fly/bin/flyctl secrets set COUCHDB_PASSWORD=${couchPwd}
Error: failed loading app config from /content/fly.toml: toml: line 28: Key 'build' has already been defined.
Quick workaround
After getting the error, download fly.toml from the colab, delete the first [build] from the file, upload it to the colab, and try the step again.
fly.toml
# fly.toml app configuration file generated for lively-tree-6491 on 2023-08-07T11:28:36Z
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = "lively-tree-6491"
primary_region = "nrt"
[build] // <- delete this line
[http_service]
internal_port = 5984
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]
[env]
COUCHDB_USER = "username"
ERL_FLAGS="-couch_ini /opt/couchdb/etc/default.ini /opt/couchdb/etc/default.d/ /opt/couchdb/etc/local.d /opt/couchdb/etc/local.ini /opt/couchdb/data/persistence.ini"
[mounts]
source="couchdata"
destination="/opt/couchdb/data"
[build]
dockerfile = "./Dockerfile"
Reproducing procedure
- Open colab(deploy_couchdb_to_flyio_v2_with_swap.ipynb) and follow instructions until the error occurs.
Insights
It seems # Generate server step produces the empty [build] line.
# Generate server
!/root/.fly/bin/flyctl launch --auto-confirm --generate-name --detach --no-deploy --region ${region}
!/root/.fly/bin/fly volumes create --region ${region} couchdata --size 2 --yes
// fly.toml
# fly.toml app configuration file generated for proud-river-7880 on 2023-08-07T12:44:07Z
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = "proud-river-7880"
primary_region = "nrt"
[build]
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]
I deleted the fly.io app and tried the whole step again, and then it worked without the error... I don't know why that happened.
Thank you for reporting this issue!
I assumed this as flyctl has been updated recently and that some versions could had be reported as an error.
However, we should better modify YAML as YAML (using Python might be a nice way on the colab-note).
I will check it later.