App building & deployment questions

Busy following the python tutorial as well.

I added the build section to fly.toml and when I deploy it shows a different name when building than what is defined in app?

Deploying divine-feather-8028
==> Validating app configuration
--> Validating app configuration done
Services
TCP 80/443 ⇢ 8080
Remote builder fly-builder-small-tree-6157 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.10 linux x86_64

I think the build fails too. It has status as running on the web console but it fails to connect when visiting the url

Seems I mistunderstand how Fly works - build processes are separate.

Still not working, build app is failing. Don’t know how to debug except with the log - when I print it out it says:

2021-11-14T16:18:51.459 app[80191b71] maa [info] time="2021-11-14T16:18:51.459446982Z" level=debug msg="Calling GET /v1.41/containers/json?filters=%7B%22status%22%3A%7B%22running%22%3Atrue%7D%7D&limit=0"
2021-11-14T16:18:52.462 app[80191b71] maa [info] time="2021-11-14T16:18:52.462009134Z" level=debug msg="checking docker activity"
2021-11-14T16:18:52.462 app[80191b71] maa [info] time="2021-11-14T16:18:52.462379986Z" level=debug msg="Calling GET /v1.41/containers/json?filters=%7B%22status%22%3A%7B%22running%22%3Atrue%7D%7D&limit=0"
2021-11-14T16:18:53.464 app[80191b71] maa [info] time="2021-11-14T16:18:53.464239654Z" level=debug msg="checking docker activity"
2021-11-14T16:18:53.466 app[80191b71] maa [info] time="2021-11-14T16:18:53.464638316Z" level=debug msg="Calling GET /v1.41/containers/json?filters=%7B%22status%22%3A%7B%22running%22%3Atrue%7D%7D&limit=0"
2021-11-14T16:18:54.466 app[80191b71] maa [info] time="2021-11-14T16:18:54.466638325Z" level=debug msg="checking docker activity"
2021-11-14T16:18:54.467 app[80191b71] maa [info] time="2021-11-14T16:18:54.467011617Z" level=debug msg="Calling GET /v1.41/containers/json?filters=%7B%22status%22%3A%7B%22running%22%3Atrue%7D%7D&limit=0"
2021-11-14T16:18:55.468 app[80191b71] maa [info] time="2021-11-14T16:18:55.468343281Z" level=debug msg="checking docker activity"

Struggling to debug still. Tried deleting the build and rerunning deploy. Still same kind of log messages but I did manage to catch this one:

POST /v1.41/build?buildargs=%7B%7D&cachefrom=null&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=&labels=null&memory=0&memswap=0&networkmode=&platform=linux%2Famd64&rm=0&shmsize=0&t=registry.fly.io%2Fdivine-feather-8028%3Adeployment-1636913038&target=&ulimits=null&version="

@user83 The topic these questions were on was about building static sites, I’ve moved them here to organise them better.

Most of the logs here are from the builder app — a special app that runs on Fly to build your Docker container. If the builder isn’t finishing successfully, you can build locally on your machine with fly deploy --local-only.

There should be a log coming out of the builder with an error, though, if there is a problem. Could you post that error here?

@sudhir.j thanks for doing that.

Here is the log. I don’t see any errors though?

% LOG_LEVEL=debug flyctl deploy
DEBUG Loaded flyctl config from/Users/karl/.fly/config.yml
DEBUG determined working directory: "/Users/karl/tst/python-hellofly-flask"
DEBUG determined user home directory: "/Users/karl"
DEBUG determined config directory: "/Users/karl/.fly"
DEBUG cache loaded.
DEBUG config initialized.
DEBUG initialized task manager.
DEBUG started querying for new release
DEBUG client initialized.
DEBUG Loading app config from/Users/karl/tst/python-hellofly-flask/fly.toml
DEBUG Working Directory: /Users/karl/tst/python-hellofly-flask
DEBUG App Config File: /Users/karl/tst/python-hellofly-flask/fly.toml
Deploying divine-feather-8028
==> Validating app configuration
DEBUG --> POST https://api.fly.io/graphql {{"query":"query($appName: String!, $definition: JSON!) { app(name: $appName) { parseConfig(definition: $definition) { definition valid errors services { description } } } }","variables":{"appName":"divine-feather-8028","definition":{"env":{},"experimental":{"allowed_public_ports":[],"auto_rollback":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"}]}]}}}
}
DEBUG <-- 200 https://api.fly.io/graphql (1.1s) {"data":{"app":{"parseConfig":{"definition":{"kill_timeout":5,"kill_signal":"SIGINT","processes":[],"experimental":{"allowed_public_ports":[],"auto_rollback":true},"services":[{"processes":["app"],"protocol":"tcp","internal_port":8080,"concurrency":{"soft_limit":20,"hard_limit":25,"type":"connections"},"ports":[{"port":80,"handlers":["http"]},{"port":443,"handlers":["tls","http"]}],"tcp_checks":[{"interval":"15s","timeout":"2s","grace_period":"1s","restart_limit":0}],"http_checks":[],"script_checks":[]}],"env":{}},"valid":true,"errors":[],"services":[{"description":"TCP 80/443 ⇢ 8080"}]}}}}
--> Validating app configuration done
Services
TCP 80/443 ⇢ 8080
DEBUG trying local docker daemon
DEBUG Local docker daemon unavailable
DEBUG trying remote docker daemon
DEBUG Trying 'Buildpacks' strategy
DEBUG no buildpack builder configured, skipping
DEBUG result image:<nil> error:<nil>
DEBUG Trying 'Dockerfile' strategy
DEBUG dockerfile not found, skipping
DEBUG result image:<nil> error:<nil>
DEBUG Trying 'Builtin' strategy
DEBUG --> POST https://api.fly.io/graphql {{"query":"mutation($input: EnsureMachineRemoteBuilderInput!) { ensureMachineRemoteBuilder(input: $input) { machine { id state ips { nodes { family kind ip } } }, app { name organization { slug } } } }","variables":{"input":{"appName":"divine-feather-8028","organizationId":null}}}
}
DEBUG <-- 200 https://api.fly.io/graphql (541.82ms) {"data":{"ensureMachineRemoteBuilder":{"machine":{"id":"815d5f3d","state":"starting","ips":{"nodes":[{"family":"v6","kind":"privatenet","ip":"fdaa:0:39b0:a7b:14bf:0:572f:2"},{"family":"v6","kind":"public","ip":"2607:f740:10:1a::572f:3"},{"family":"v4","kind":"private","ip":"172.19.0.138"}]}},"app":{"name":"fly-builder-aged-rain-2534","organization":{"slug":"personal"}}}}}
DEBUG checking ip &{Family:v6 Kind:privatenet IP:fdaa:0:39b0:a7b:14bf:0:572f:2 MaskSize:0}
Waiting for remote builder fly-builder-aged-rain-2534... connecting ⣾ DEBUG --> POST https://api.fly.io/graphql {{"query":"query ($appName: String!) { app(name: $appName) { id name hostname deployed status version appUrl organization { id slug } services { description protocol internalPort ports { port handlers } } ipAddresses { nodes { id address type createdAt } } } }","variables":{"appName":"divine-feather-8028"}}
}
Waiting for remote builder fly-builder-aged-rain-2534... connecting ⡿ DEBUG <-- 200 https://api.fly.io/graphql (1.06s) {"data":{"app":{"id":"divine-feather-8028","name":"divine-feather-8028","hostname":"divine-feather-8028.fly.dev","deployed":false,"status":"pending","version":0,"appUrl":null,"organization":{"id":"50NmY73lPeNz9H6y6PJO8ovJO4unx4","slug":"personal"},"services":[{"description":"TCP 80/443 ⇢ 8080","protocol":"TCP","internalPort":8080,"ports":[{"port":80,"handlers":["HTTP"]},{"port":443,"handlers":["TLS","HTTP"]}]}],"ipAddresses":{"nodes":[]}}}}
DEBUG --> POST https://api.fly.io/graphql {{"query":"mutation($input: ValidateWireGuardPeersInput!) { validateWireGuardPeers(input: $input) { invalidPeerIps } }","variables":{"input":{"peerIps":["fdaa:0:39b0:a7b:1bfe:0:a:2"]}}}
}
Waiting for remote builder fly-builder-aged-rain-2534... connecting ⣟ DEBUG <-- 200 https://api.fly.io/graphql (383.3ms) {"data":{"validateWireGuardPeers":{"invalidPeerIps":[]}}}
Waiting for remote builder fly-builder-aged-rain-2534... connecting ⣟ DEBUG Remote builder available, but pinging again in 200ms to be sure
Waiting for remote builder fly-builder-aged-rain-2534... connecting ⣾ DEBUG Remote builder available, but pinging again in 224.992882ms to be sure
Waiting for remote builder fly-builder-aged-rain-2534... connecting ⢿ DEBUG Remote builder is ready to build!
Remote builder fly-builder-aged-rain-2534 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.10 linux x86_64

I don’t see any errors either, there might not be a problem in the build process at all.

If you do a fly checks list you should see if any of the health checks are failing after deployment, and fly logs should show what’s actually going on in the instance. That would be more helpful at this point.

Here is the output of fly checks list:

% fly checks list
Health Checks for divine-feather-8028
NAME STATUS ALLOCATION REGION TYPE LAST UPDATED OUTPUT

Nothing happens when I type fly logs (hangs?).

Anything else I can check?

hi @sudhir.j quite lost as what to do next - any advice for me?

All of those logs you posted are normal. Is that --> docker host: 20.10.10 line the last thing you ever see during a build?

Yes that’s the last line. It just hangs from there.