Hi, everyone! This post is my first ever, and I want to know why my app is not working when deployed on Fly.io. Let me overview the essential parts:
I deployed a gRPC (Go Lang) app on Fly.io, which works appropriately. So, I deployed THE SAME app with another name again, and I received this error:
Failed to dial target host "ic-server.fly.dev:50051": context deadline exceeded
Why?
App list
$ fly apps list
NAME OWNER STATUS PLATFORM LATEST DEPLOY
fly-builder-bold-wind-5113 personal deployed machines
ic-app personal running nomad 2h18m ago
ic-server personal running nomad 3m21s ago
ic-app status (this app works)
$ fly status --all -a ic-client
App
Name = ic-app
Owner = personal
Version = 3
Status = running
Hostname = ic-app.fly.dev
Platform = nomad
Deployment Status
ID = 7cc46b88-b102-673a-c694-9542f13044bd
Version = v3
Status = successful
Description = Deployment completed successfully
Instances = 1 desired, 1 placed, 1 healthy, 0 unhealthy
Instances
ID PROCESS VERSION REGION DESIRED STATUS HEALTH CHECKS RESTARTS CREATED
23216c03 app 3 ⇡ gru run running 1 total, 1 passing 0 2h39m ago
1cc9d165 app 1 gru stop complete 1 total, 1 passing 0 2h58m ago
28ae009e app 0 gru stop complete 1 total, 1 passing 0 5h4m ago
Running:
$ grpcurl -plaintext -d '{"inum": {"a": 0,"b": 2}}' -import-path ./proto -proto InfinityCounter.proto ic-app.fly.dev:50051 InfinityCounter.InfinityCounterService.InitNumber
{
"result": 2
}
{
"result": 4
}
{
"result": 6
}
{
"result": 8
}
^C⏎
ic-server (this app doesn’t work)
$ fly status --all -a ic-server
App
Name = ic-server
Owner = personal
Version = 3
Status = running
Hostname = ic-server.fly.dev
Platform = nomad
Deployment Status
ID = e8dc81f5-459c-4ced-169a-810e789680fa
Version = v3
Status = successful
Description = Deployment completed successfully
Instances = 1 desired, 1 placed, 1 healthy, 0 unhealthy
Instances
ID PROCESS VERSION REGION DESIRED STATUS HEALTH CHECKS RESTARTS CREATED
777d2d56 app 3 ⇡ gru run running 1 total, 1 passing 0 4m29s ago
4c19c641 app 2 gru stop complete 1 total, 1 passing 0 7m5s ago
64d3ad76 app 1 gru stop complete 1 total, 1 passing 0 16m13s ago
8071e843 app 0 gru stop complete 1 total, 1 passing 0 21m31s ago
Running (SAME command line, only the app name was changed)
$ grpcurl -plaintext -d '{"inum": {"a": 0,"b": 2}}' -import-path ./proto -proto InfinityCounter.proto ic-server.fly.dev:50051 InfinityCounter.InfinityCounterService.InitNumber
Failed to dial target host "ic-server.fly.dev:50051": context deadline exceeded
Both are configured to IPv4 only.
fly.toml (used in both apps)
app = "app-server"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[experimental]
allowed_public_ports = []
auto_rollback = true
[[services]]
internal_port = 50051
protocol = "tcp"
processes = ["app"]
http_checks = []
scripts_checks = []
[[services.ports]]
port = "50051"
[services.ports.tls_options]
alpn = ["h2"]
[[services.tcp_checks]]
interval = 10000
timeout = 2000
Deployed both apps with THE SAME command line:
fly app create <APP_NAME>
fly ips allocate-v4 -a <APP_NAME>
fly deploy --no-cache -c fly.toml -a <APP_NAME> --detach --dockerfile ./Dockerfile
Restarting the app doesn’t work as well.