This might be a dumb question, but I can’t work out what I’ve done wrong. I have tried deleting/creating new apps a few times, but keep having the same problem.
In short: how do I change the config of an app? In my case I am trying to add a mount, but none of the fields in the fly.toml file seem to be used if I make changes.
fly config validate tells me the config is valid (I assume this is referring to the local fly.config) fly config display displays a generic config that does not contain my local changes to fly.toml fly deploy deploys successfully, but it clearly isn’t using my fly.toml
In case it helps:
This is a Phoenix app, but pre-1.6.0. I’ve made changes that get it running, but I can’t add a mount to the config.
I originally created the app using fly launch, but I since deleted that and tried creating using fly apps create in case that was the problem.
I think I’ve read the docs, and they don’t seem to specify how to force changes.
And my volume is created. I can’t recall exactly what point I created it, but it’s not possible to create a volume before an app, so I guess it must have been after?
ID NAME SIZE REGION ZONE ATTACHED VM CREATED AT
vol_18l524y7jkp47zmp trips 1GB lhr 34c3 20 minutes ago
Can you post the output of fly volumes list and fly regions list, and the full output of your deploy command? If you have a mounts section, deployment should fail if it cannot find a suitable volume.
~/Projects/trips ❯❯❯ flyctl version ✘ 1
flyctl v0.0.273 darwin/arm64 Commit: 05b5691 BuildDate: 2021-12-31T14:29:07Z
~/Projects/trips ❯❯❯ flyctl volumes list
fID NAME SIZE REGION ZONE ATTACHED VM CREATED AT
vol_18l524y7jkp47zmp trips 1GB lhr 34c3 32 minutes ago
~/Projects/trips ❯❯❯ flyctl regions list
Region Pool:
lhr
Backup Region:
I just tried it a few minutes ago, so I have it here. This time I tried passing in the config file (although the name matches the default so I don’t think it did anything:
I’ve been noticing the same thing this morning. and possibly last night with env vars. neither the env vars nor health checks from my config file are showing up when I run fly config --verbose --config fly/web.toml display after a deploy. In my situation I am using no volumes nor the mounts option.
Unfortunately this doesn’t seem to have changed it for me. I upgraded and deployed, but the mount is still not attached, and the config hasn’t changed.
~/Projects/trips ❯❯❯ fly version update
/opt/homebrew/bin/zsh -c
Running automatic update [brew upgrade flyctl]
==> Auto-updated Homebrew!
Updated 2 taps (superfly/tap and homebrew/core).
==> Updated Formulae
Updated 3 formulae.
==> Upgrading 1 outdated package:
superfly/tap/flyctl 0.0.273 -> 0.0.274
==> Downloading https://github.com/superfly/flyctl/releases/download/v0.0.274/flyctl_0.0.274_macOS_arm64.tar.gz
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/199060308/9a0d91c6-e10f-463c-a824-d94e39aed22b?X-Amz-Algorithm=AWS4-
######################################################################## 100.0%
==> Upgrading superfly/tap/flyctl
0.0.273 -> 0.0.274
==> Caveats
zsh completions have been installed to:
/opt/homebrew/share/zsh/site-functions
==> Summary
🍺 /opt/homebrew/Cellar/flyctl/0.0.274: 7 files, 39.8MB, built in 2 seconds
==> Running `brew cleanup flyctl`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /opt/homebrew/Cellar/flyctl/0.0.273... (7 files, 39.8MB)
Removing: /Users/zander/Library/Caches/Homebrew/flyctl--0.0.273.tar.gz... (18.0MB)
~/Projects/trips ❯❯❯ fly deploy
==> verifying app config ...
--> verified app config.
==> Building image
Remote builder fly-builder-summer-brook-7121 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 225.8s (0/1)
[+] Building 5.2s (30/30) FINISHED
=> [internal] load remote build context 0.0s
=> copy /context / 2.3s
=> [internal] load metadata for docker.io/library/debian:bullseye-20210902-slim 0.9s
=> [internal] load metadata for docker.io/hexpm/elixir:1.13.1-erlang-24.2-debian-bullseye-20210902-slim 0.9s
=> [builder 1/18] FROM docker.io/hexpm/elixir:1.13.1-erlang-24.2-debian-bullseye-20210902-slim@sha256:ba2e50ad59370fab4a63a3751dc867ee45074e5f5201d8b612706d0 0.0s
=> [stage-1 1/7] FROM docker.io/library/debian:bullseye-20210902-slim@sha256:e3ed4be20c22a1358020358331d177aa2860632f25b21681d79204ace20455a6 0.0s
=> CACHED [stage-1 2/7] RUN apt-get update -y && apt-get install -y libstdc++6 openssl libncurses5 locales sqlite3 htop && apt-get clean && rm -f /var/lib 0.0s
=> CACHED [stage-1 3/7] RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen 0.0s
=> CACHED [stage-1 4/7] WORKDIR /app 0.0s
=> CACHED [builder 2/18] RUN apt-get update -y && apt-get install -y build-essential git npm && apt-get clean && rm -f /var/lib/apt/lists/*_* 0.0s
=> CACHED [builder 3/18] WORKDIR /app 0.0s
=> CACHED [builder 4/18] RUN mix local.hex --force && mix local.rebar --force 0.0s
=> CACHED [builder 5/18] COPY mix.exs mix.lock ./ 0.0s
=> CACHED [builder 6/18] RUN mix deps.get --only prod 0.0s
=> CACHED [builder 7/18] RUN mkdir config 0.0s
=> CACHED [builder 8/18] COPY config/config.exs config/prod.exs config/ 0.0s
=> CACHED [builder 9/18] RUN mix deps.compile 0.0s
=> CACHED [builder 10/18] COPY priv priv 0.0s
=> CACHED [builder 11/18] COPY assets assets 0.0s
=> CACHED [builder 12/18] RUN cd assets && npm install && ./node_modules/brunch/bin/brunch build -p 0.0s
=> CACHED [builder 13/18] RUN mix phx.digest 0.0s
=> CACHED [builder 14/18] COPY lib lib 0.0s
=> CACHED [builder 15/18] RUN mix compile 0.0s
=> CACHED [builder 16/18] COPY config/runtime.exs config/ 0.0s
=> CACHED [builder 17/18] COPY rel rel 0.0s
=> CACHED [builder 18/18] RUN mix release 0.0s
=> CACHED [stage-1 5/7] COPY --from=builder /app/_build/prod/rel ./ 0.0s
=> [stage-1 6/7] COPY trips_dump.sql trips_dump.sql 0.2s
=> [stage-1 7/7] RUN set -eux; ln -nfs /app/$(basename *)/bin/$(basename *) /app/entry 0.3s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:2f28134c15a4a426559efc0ffb713c7342f50aa2375c1af9f75422068a962ca3 0.0s
=> => naming to registry.fly.io/dark-breeze-4631:deployment-1640971128 0.0s
--> Building image done
==> Pushing image to fly
The push refers to repository [registry.fly.io/dark-breeze-4631]
d9955cecdf76: Pushed
9f55ab2b5cdd: Pushed
c5637069476c: Layer already exists
85dfabae1706: Layer already exists
8308665c3924: Layer already exists
7229b49946ed: Layer already exists
ba5a5fe43301: Layer already exists
deployment-1640971128: digest: sha256:ff6b9d7ab724355b2b4e1ebc897d1fefef63f1459c6422809b94be293acf7791 size: 1786
--> Pushing image done
image: registry.fly.io/dark-breeze-4631:deployment-1640971128
image size: 133 MB
==> Creating release
--> release v4 created
--> You can detach the terminal anytime without stopping the deployment
==> Monitoring deployment
1 desired, 1 placed, 1 healthy, 0 unhealthy [health checks: 1 total, 1 passing]
--> v4 deployed successfully
~/Projects/trips ❯❯❯ fly volumes list
ID NAME SIZE REGION ZONE ATTACHED VM CREATED AT
vol_18l524y7jkp47zmp trips 1GB lhr 34c3 1 hour ago
~/Projects/trips ❯❯❯ fly volumes list
ID NAME SIZE REGION ZONE ATTACHED VM CREATED AT
vol_18l524y7jkp47zmp trips 1GB lhr 34c3 1 hour ago
~/Projects/trips ❯❯❯ fly config display
{
"env": {},
"experimental": {
"allowed_public_ports": [],
"auto_rollback": true,
"cmd": [],
"entrypoint": [],
"exec": [],
"private_network": true
},
"kill_signal": "SIGINT",
"kill_timeout": 5,
"processes": [],
"services": [
{
"concurrency": {
"hard_limit": 25,
"soft_limit": 20,
"type": "connections"
},
"http_checks": [],
"internal_port": 8080,
"ports": [
{
"handlers": [
"http"
],
"port": 80
},
{
"handlers": [
"tls",
"http"
],
"port": 443
}
],
"processes": [
"app"
],
"protocol": "tcp",
"script_checks": [],
"tcp_checks": [
{
"grace_period": "1s",
"interval": "15s",
"restart_limit": 0,
"timeout": "2s"
}
]
}
]
}
Excellent, I can confirm it’s working for me now. The volume is attached and the configs match. Thanks so much for the quick response, I think your company is great.
I’m seeing something similar to this, although maybe not the same thing. New to fly.io so my assumption is that I’m doing something wrong, but not certain what.
I have an app with env vars defined in my fly.toml. The app deploys and runs fine, and in fact is reading those env vars successfully. So no problems there.
But if I run fly config display or fly config env I see no env vars at all.
My assumption is that a deploy will push the settings from my fly.toml, and that appears to be the case since the app works and sees the env vars.
I picked up an update to flyctl this morning and am currently running flyctl v0.0.396 linux/amd64 Commit: edf8f512 BuildDate: 2022-09-24T19:06:43Z
Are you deploying a regular Fly app or Fly Machines? If the latter, try fly m status <machine-id> -d -a <app-name>. A list of active Machines can be fetched via fly m list -a <app-name>
Sorry, been away from this for a while. Using a regular fly app but seems to be working now. Perhaps there was a delay and I was being impatient, but more likely I was doing something else wrong that I can’t recall at the moment. Thanks for the help.
Hi, I’m experiencing this exact bug. I’ve created a postgres app following the steps here with:
fly postgres create
and I’m trying to expose the 5432 port to the internet. I can confirm postgres is up as I can successfully connect to it if I port forward on my machine. To expose the port I’ve tried to update the apps’s services without success. Steps I’ve done (after creating the database):
Get the configuration with: fly config save --app <app-name>
Edit the fly.toml file to include:
[[services]]
internal_port = 5432 # Postgres instance
protocol = "tcp"
# Open port 10000 for plaintext connections.
[[services.ports]]
handlers = []
port = 10000
However, after inspecting the configuration with fly info I can see that no port is being exposed and the output from fly config display -a <app-name> confirms that the deployment has not altered the services in any way.
This is the version of the fly cli: fly v0.0.415 darwin/amd64 Commit: 09daebe1 BuildDate: 2022-10-18T22:24:36Z
Is there a way to force fly to use the fly.toml? It’s as if it’s ignoring the fly.toml file entirely.