(reposting a variation of my comment here)
If I have an app with non-standard handlers on ports 80/443 (see example below) and I try to run fly ips allocate-v4 --shared
, it fails (as expected) but the error message doesn’t make sense:
Error Services defined at indexes: 0 require a dedicated IP address. You currently have a shared IPv4 assigned to your app (
fly ips list
). Release the shared IP (fly ips release <shared ip>
) and/or allocate only dedicated IPs before deploying (fly ips allocate-v4
and/orfly ips allocate-v6
). Affected services:
[0] tcp/80,443 => 8080
This message would make sense in the context of fly deploy
, but in the context of ips allocate-v4 --shared
it is plain wrong: the app doesn’t currently have a shared IPv4. I’m not sure what a better message would be. Maybe suggest to the user to allocate a dedicated IP by dropping the --shared
option. It would also help if the error message explained how to modify the port handlers (editing fly.toml wasn’t enough, I also had to run fly deploy
; not sure if there is a simpler way).
Full steps to reproduce:
$ mkdir app && cd app
$ fly launch --image flyio/hellofly:latest # accept defaults
# change the handlers of external port 443 from TLS+HTTP to no handlers
$ patch fly.toml <<"EOF"
--- fly.toml.orig
+++ fly.toml
@@ -32,3 +32,3 @@
[[services.ports]]
- handlers = ["tls", "http"]
+ handlers = []
port = 443
EOF
# add an IPv6 address to allow deployment
$ fly ips allocate-v6
$ fly deploy
# attempt to allocate a shared IPv4 address
# (this is expected to fail because shared IPv4 only supports TLS+HTTP on port 443, but the error message is inaccurate)
$ fly ips allocate-v4 --shared
Error Services defined at indexes: 0 require a dedicated IP address. You currently have a shared IPv4 assigned to your app (`fly ips list`). Release the shared IP (`fly ips release <shared ip>`) and/or allocate only dedicated IPs before deploying (`fly ips allocate-v4` and/or `fly ips allocate-v6`). Affected services:
[0] tcp/80,443 => 8080
Cc: @jerome
P.S. Is there a better way to report bugs such as this? I considered opening an issue in the flyctl GitHub project, but I don’t think the bug is in flyctl
and it wasn’t clear from the issue template whether such platform bugs belong there.