Remote Builder Apps going unresponsive

Remote builders seemingly go into an unresponsive mode after some idle time, and doesn’t seem to come back to life. I’ve been destroying the remote builder apps to be able to do, well, remote builds.

e.g. remote build deploy that hangs:

% LOG_LEVEL=debug flyctl deploy --remote-only --dockerfile Containerfile
DEBUG Loaded flyctl config from${HOME}/.fly/config.yml
DEBUG Checking for updates...
DEBUG Loading app config from${HOME}/${app_path}/fly.toml
DEBUG Working Directory: ${HOME}/${app_path}
DEBUG App Config File: ${HOME}/${app_path}/fly.toml
Deploying bdd
==> Validating app configuration
DEBUG --> POST https://api.fly.io/graphql { [...cut...] }
DEBUG <-- 200 https://api.fly.io/graphql (330.11ms) { [...cut...] }
--> Validating app configuration done
Services
TCP 80/443 ⇢ 8080
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 --> 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":"bdd","organizationId":null}}}
}
DEBUG <-- 200 https://api.fly.io/graphql (320.85ms) {"data":{"ensureMachineRemoteBuilder":{"machine":{"id":"82dd3b5e","state":"starting","ips":{"nodes":[{"family":"v6","kind":"privatenet","ip":"fdaa:0:847:a7b:ad0:0:4baa:2"},{"family":"v6","kind":"public","ip":"2604:1380:45e1:3002::4baa:3"},{"family":"v4","kind":"private","ip":"172.19.0.58"}]}},"app":{"name":"fly-builder-holy-rain-159","organization":{"slug":"personal"}}}}}
DEBUG checking ip &{Family:v6 Kind:privatenet IP:fdaa:0:847:a7b:ad0:0:4baa:2 MaskSize:0}
Waiting for remote builder fly-builder-holy-rain-159... 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":"bdd"}}
}
Waiting for remote builder fly-builder-holy-rain-159... connecting ⣽ DEBUG <-- 200 https://api.fly.io/graphql (359.31ms) {"data":{"app":{"id":"bdd","name":"bdd","hostname":"bdd.fly.dev","deployed":true,"status":"running","version":35,"appUrl":"https://213.188.195.170","organization":{"id":"ZRJPoxp8kwJ0ZuK1KxyBZAnyBoCYG0","slug":"personal"},"services":[{"description":"TCP 80/443 ⇢ 8080","protocol":"TCP","internalPort":8080,"ports":[{"port":80,"handlers":["HTTP"]},{"port":443,"handlers":["TLS","HTTP"]}]}],"ipAddresses":{"nodes":[{"id":"89D45zK5yOwYBTBNA1O09Aebn8sBvA","address":"213.188.195.170","type":"v4","createdAt":"2021-01-10T23:55:39Z"},{"id":"D361ODBOn4xgjT48Kb3VBKkqPzHgV9","address":"2a09:8280:1:715e:4041:f149:6ac0:dc3e","type":"v6","createdAt":"2021-01-10T23:55:41Z"}]}}}}
DEBUG --> POST https://api.fly.io/graphql {{"query":"mutation($input: ValidateWireGuardPeersInput!) { validateWireGuardPeers(input: $input) { invalidPeerIps } }","variables":{"input":{"peerIps":["fdaa:0:847:a7b:e23:0:a:2"]}}}
}
Waiting for remote builder fly-builder-holy-rain-159... connecting ⣻ DEBUG <-- 200 https://api.fly.io/graphql (304.89ms) {"data":{"validateWireGuardPeers":{"invalidPeerIps":[]}}}
DEBUG result image:<nil> error:error connecting to docker: context canceled

I decide to SIGINT above as it wasn’t making any progress.
Then proceeded destroying the builder app.

% flyctl apps destroy fly-builder-holy-rain-159

Try again, and now it succeeds.

% LOG_LEVEL=debug flyctl deploy --remote-only --dockerfile Containerfile
DEBUG Loaded flyctl config from${HOME}/.fly/config.yml
DEBUG Checking for updates...
DEBUG Loading app config from${HOME}/${app_path}/fly.toml
DEBUG Working Directory: ${HOME}/${app_path}
DEBUG App Config File: ${HOME}/${app_path}/fly.toml
Deploying bdd
==> Validating app configuration
DEBUG --> POST https://api.fly.io/graphql { [...cut...] }
DEBUG <-- 200 https://api.fly.io/graphql (339.96ms) { [...cut...]}
--> Validating app configuration done
Services
TCP 80/443 ⇢ 8080
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 --> 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":"bdd","organizationId":null}}}
}
DEBUG <-- 200 https://api.fly.io/graphql (1.63s) {"data":{"ensureMachineRemoteBuilder":{"machine":{"id":"84ee6a91","state":"starting","ips":{"nodes":[{"family":"v6","kind":"privatenet","ip":"fdaa:0:847:a7b:ad0:0:4c62:2"},{"family":"v6","kind":"public","ip":"2604:1380:45e1:3002::4c62:3"},{"family":"v4","kind":"private","ip":"172.19.1.170"}]}},"app":{"name":"fly-builder-wispy-mountain-4171","organization":{"slug":"personal"}}}}}
DEBUG checking ip &{Family:v6 Kind:privatenet IP:fdaa:0:847:a7b:ad0:0:4c62:2 MaskSize:0}
Waiting for remote builder fly-builder-wispy-mountain-4171... 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":"bdd"}}
}
Waiting for remote builder fly-builder-wispy-mountain-4171... connecting ⣽ DEBUG <-- 200 https://api.fly.io/graphql (375.24ms) {"data":{"app":{"id":"bdd","name":"bdd","hostname":"bdd.fly.dev","deployed":true,"status":"running","version":35,"appUrl":"https://213.188.195.170","organization":{"id":"ZRJPoxp8kwJ0ZuK1KxyBZAnyBoCYG0","slug":"personal"},"services":[{"description":"TCP 80/443 ⇢ 8080","protocol":"TCP","internalPort":8080,"ports":[{"port":80,"handlers":["HTTP"]},{"port":443,"handlers":["TLS","HTTP"]}]}],"ipAddresses":{"nodes":[{"id":"89D45zK5yOwYBTBNA1O09Aebn8sBvA","address":"213.188.195.170","type":"v4","createdAt":"2021-01-10T23:55:39Z"},{"id":"D361ODBOn4xgjT48Kb3VBKkqPzHgV9","address":"2a09:8280:1:715e:4041:f149:6ac0:dc3e","type":"v6","createdAt":"2021-01-10T23:55:41Z"}]}}}}
DEBUG --> POST https://api.fly.io/graphql {{"query":"mutation($input: ValidateWireGuardPeersInput!) { validateWireGuardPeers(input: $input) { invalidPeerIps } }","variables":{"input":{"peerIps":["fdaa:0:847:a7b:e23:0:a:2"]}}}
}
Waiting for remote builder fly-builder-wispy-mountain-4171... connecting ⣻ DEBUG <-- 200 https://api.fly.io/graphql (137.95ms) {"data":{"validateWireGuardPeers":{"invalidPeerIps":[]}}}
Waiting for remote builder fly-builder-wispy-mountain-4171... connecting ⣾ DEBUG Remote builder available, but pinging again in 200ms to be sure
Waiting for remote builder fly-builder-wispy-mountain-4171... connecting ⣻ DEBUG Remote builder available, but pinging again in 218.381322ms to be sure
Waiting for remote builder fly-builder-wispy-mountain-4171... connecting ⡿ DEBUG Remote builder is ready to build!
Remote builder fly-builder-wispy-mountain-4171 ready
[...cut...]

Ah this is super helpful. We just uncovered the logs from your failed restart and it seems like there was a problem booting getting the network interface back for the existing builder. We’re debugging.

1 Like

I am also experiencing some issues while deploying

Remote builder fly-builder-bitter-cloud-8683 ready
==> Building image with Buildpacks
--> docker host: 20.10.8 linux x86_64
20: Pulling from heroku/buildpacks
Digest: sha256:c42ef608e159258b9b1570cd011686fd4d3f63a0053662bfd5e45f180a64861b
Status: Image is up to date for heroku/buildpacks:20
20: Pulling from heroku/pack
Digest: sha256:dd3a7e568f9f3251b915707f063592310acda36b98341c60f2e58dcd03a9d4e6
Status: Image is up to date for heroku/pack:20

Error fetching base layers: saving base image with ID "sha256:3361b2975280d5ab215aa3b9d7f336817a7e6b9f79ec8ec7968c66fe15a9e432" from the docker daemon: error during connect: Get "http://[fdaa:0:3758:a7b:14bf:0:4ce9:2]:2375/v1.41/images/get?names=sha256%3A3361b2975280d5ab215aa3b9d7f336817a7e6b9f79ec8ec7968c66fe15a9e432": err err handling connect: connection failed: connect tcp [fdaa:0:3758:a7b:14bf:0:4ce9:2]:2375: connection was refused

I’m having the same “waiting for remote builder” problem. My builder is fly-builder-broken-smoke-5499. Even fly apps destroy fly-builder-broken-smoke-5499 fails, so I’m not able to deploy at all.

Based on advice in another thread, I tried fly wireguard remove, but that didn’t help. Deploying still blocks indefinitely, as does destroying the builder app.

@arthurgleckler @vinay_puppal We’re looking into both problems, will get back with an update soon.

I discovered a workaround. While destroying the builder app through flyctl didn’t work, there is a way to do it through the web UI. Once that was done, I was able to deploy again.

1 Like

Thanks for the update, glad to know you’re not stuck. We’re analysing the logs and we’ll try to make sure the problem doesn’t come up again.

1 Like

I don’t know if this is related, but the go example with remote builders does not work for me. It fails with a timeout every time. I pasted the last few log lines. Any way how I could help debug this?

user@host ~/r/go-example (master)> fly deploy --remote-only
...
...
...
Digest: sha256:7b70b114ac4fe8d8c201965a99ac204de6a4e848c894eae58abe7b11eb4a0081
Status: Downloaded newer image for gcr.io/paketo-buildpacks/go:latest
Adding buildpack paketo-buildpacks/go version 1.6.0 to builder
Adding buildpack paketo-buildpacks/dep version 0.3.3 to builder
Adding buildpack paketo-buildpacks/environment-variables version 4.1.2 to builder
Adding buildpack paketo-buildpacks/git version 0.4.2 to builder
Adding buildpack paketo-buildpacks/go-build version 1.1.4 to builder
Adding buildpack paketo-buildpacks/go-dist version 1.2.2 to builder
Adding buildpack paketo-buildpacks/image-labels version 4.1.2 to builder
Adding buildpack paketo-buildpacks/ca-certificates version 3.2.4 to builder
Adding buildpack paketo-buildpacks/dep-ensure version 0.2.4 to builder
Adding buildpack paketo-buildpacks/go-mod-vendor version 0.6.2 to builder
Adding buildpack paketo-buildpacks/procfile version 5.1.2 to builder
Adding buildpack paketo-buildpacks/watchexec version 2.5.1 to builder
Setting custom order
Creating builder with the following buildpacks:
-> paketo-buildpacks/dotnet-core@0.19.0
-> paketo-buildpacks/image-labels@4.1.2
-> paketo-buildpacks/node-engine@0.13.0
-> paketo-buildpacks/ca-certificates@3.2.4
-> paketo-buildpacks/dotnet-core-runtime@0.8.0
-> paketo-buildpacks/dotnet-execute@0.9.0
-> paketo-buildpacks/icu@0.2.1
-> paketo-buildpacks/watchexec@2.5.1
-> paketo-buildpacks/dotnet-core-aspnet@0.7.0
-> paketo-buildpacks/dotnet-core-sdk@0.7.0
-> paketo-buildpacks/dotnet-publish@0.7.4
-> paketo-buildpacks/environment-variables@4.1.2
-> paketo-buildpacks/procfile@5.1.2
-> paketo-buildpacks/go@1.6.0
-> paketo-buildpacks/watchexec@2.5.1
-> paketo-buildpacks/environment-variables@4.1.2
-> paketo-buildpacks/git@0.4.2
-> paketo-buildpacks/go-build@1.1.4
-> paketo-buildpacks/go-mod-vendor@0.6.2
-> paketo-buildpacks/image-labels@4.1.2
-> paketo-buildpacks/procfile@5.1.2
-> paketo-buildpacks/ca-certificates@3.2.4
-> paketo-buildpacks/dep@0.3.3
-> paketo-buildpacks/dep-ensure@0.2.4
-> paketo-buildpacks/go-dist@1.2.2
-> paketo-buildpacks/java-native-image@7.21.0
-> paketo-buildpacks/gradle@6.4.5
-> paketo-buildpacks/procfile@5.1.2
-> paketo-buildpacks/upx@3.1.3
-> paketo-buildpacks/maven@6.6.0
-> paketo-buildpacks/sbt@6.4.3
-> paketo-buildpacks/spring-boot@5.13.0
-> paketo-buildpacks/syft@1.12.0
-> paketo-buildpacks/environment-variables@4.1.2
-> paketo-buildpacks/image-labels@4.1.2
-> paketo-buildpacks/leiningen@4.3.3
-> paketo-buildpacks/bellsoft-liberica@9.3.7
-> paketo-buildpacks/ca-certificates@3.2.4
-> paketo-buildpacks/executable-jar@6.2.4
-> paketo-buildpacks/native-image@5.2.3
-> paketo-buildpacks/java@6.29.0
-> paketo-buildpacks/azure-application-insights@5.5.0
-> paketo-buildpacks/encrypt-at-rest@4.1.2
-> paketo-buildpacks/executable-jar@6.2.4
-> paketo-buildpacks/maven@6.6.0
-> paketo-buildpacks/spring-boot@5.13.0
-> paketo-buildpacks/apache-tomee@1.0.5
-> paketo-buildpacks/datadog@1.7.0
-> paketo-buildpacks/dist-zip@5.2.4
-> paketo-buildpacks/gradle@6.4.5
-> paketo-buildpacks/image-labels@4.1.2
-> paketo-buildpacks/watchexec@2.5.1
-> paketo-buildpacks/clojure-tools@2.4.5
-> paketo-buildpacks/google-stackdriver@5.11.3
-> paketo-buildpacks/leiningen@4.3.3
-> paketo-buildpacks/sbt@6.4.3
-> paketo-buildpacks/syft@1.12.0
-> paketo-buildpacks/apache-tomcat@7.3.7
-> paketo-buildpacks/bellsoft-liberica@9.3.7
-> paketo-buildpacks/ca-certificates@3.2.4
-> paketo-buildpacks/environment-variables@4.1.2
-> paketo-buildpacks/jattach@1.0.2
-> paketo-buildpacks/java-memory-assistant@1.0.1
-> paketo-buildpacks/liberty@1.1.1
-> paketo-buildpacks/procfile@5.1.2
-> paketo-buildpacks/nodejs@0.19.0
-> paketo-buildpacks/ca-certificates@3.2.4
-> paketo-buildpacks/node-run-script@0.3.4
-> paketo-buildpacks/npm-install@0.10.0
-> paketo-buildpacks/procfile@5.1.2
-> paketo-buildpacks/yarn@0.7.0
-> paketo-buildpacks/npm-start@0.9.1
-> paketo-buildpacks/yarn-install@0.10.0
-> paketo-buildpacks/yarn-start@0.8.1
-> paketo-buildpacks/environment-variables@4.1.2
-> paketo-buildpacks/node-engine@0.13.0
-> paketo-buildpacks/node-start@0.8.1
-> paketo-buildpacks/watchexec@2.5.0
-> paketo-buildpacks/datadog@1.7.0
-> paketo-buildpacks/image-labels@4.1.2
-> paketo-buildpacks/node-module-bom@0.3.0
-> paketo-buildpacks/procfile@5.1.2
-> paketo-buildpacks/python@1.0.0
-> paketo-buildpacks/pipenv@1.1.0
-> paketo-buildpacks/conda-env-update@0.4.1
-> paketo-buildpacks/python-start@0.10.0
-> paketo-buildpacks/watchexec@2.4.1
-> paketo-buildpacks/procfile@5.1.2
-> paketo-buildpacks/image-labels@4.1.2
-> paketo-buildpacks/pip@0.11.1
-> paketo-buildpacks/pip-install@0.4.2
-> paketo-buildpacks/poetry-install@0.2.1
-> paketo-buildpacks/poetry-run@0.2.0
-> paketo-buildpacks/cpython@1.0.1
-> paketo-buildpacks/environment-variables@4.1.2
-> paketo-buildpacks/miniconda@0.5.0
-> paketo-buildpacks/pipenv-install@0.5.1
-> paketo-buildpacks/poetry@0.2.2
-> paketo-buildpacks/ca-certificates@3.2.4
-> paketo-buildpacks/ruby@0.14.2
-> paketo-buildpacks/node-engine@0.12.3
-> paketo-buildpacks/rails-assets@0.5.0
-> paketo-buildpacks/rake@0.3.0
-> paketo-buildpacks/thin@0.4.0
-> paketo-buildpacks/yarn@0.6.1
-> paketo-buildpacks/ca-certificates@3.2.4
-> paketo-buildpacks/passenger@0.6.1
-> paketo-buildpacks/rackup@0.3.0
-> paketo-buildpacks/unicorn@0.3.0
-> paketo-buildpacks/bundle-install@0.5.1
-> paketo-buildpacks/bundler@0.5.2
-> paketo-buildpacks/image-labels@4.1.2
-> paketo-buildpacks/procfile@5.1.2
-> paketo-buildpacks/puma@0.3.0
-> paketo-buildpacks/yarn-install@0.9.0
-> paketo-buildpacks/environment-variables@4.1.2
-> paketo-buildpacks/mri@0.8.2
-> paketo-buildpacks/watchexec@2.5.1
-> paketo-buildpacks/web-servers@0.0.3
-> paketo-buildpacks/ca-certificates@3.2.3
-> paketo-buildpacks/environment-variables@4.1.2
-> paketo-buildpacks/httpd@0.4.2
-> paketo-buildpacks/image-labels@4.1.2
-> paketo-buildpacks/nginx@0.7.0
-> paketo-buildpacks/node-engine@0.12.3
-> paketo-buildpacks/node-run-script@0.3.3
-> paketo-buildpacks/yarn-install@0.9.0
-> paketo-buildpacks/npm-install@0.9.0
-> paketo-buildpacks/procfile@5.1.2
-> paketo-buildpacks/watchexec@2.4.1
-> paketo-buildpacks/yarn@0.6.1
-> paketo-buildpacks/go@1.6.0
-> paketo-buildpacks/dep@0.3.3
-> paketo-buildpacks/environment-variables@4.1.2
-> paketo-buildpacks/git@0.4.2
-> paketo-buildpacks/go-build@1.1.4
-> paketo-buildpacks/go-dist@1.2.2
-> paketo-buildpacks/image-labels@4.1.2
-> paketo-buildpacks/ca-certificates@3.2.4
-> paketo-buildpacks/dep-ensure@0.2.4
-> paketo-buildpacks/go-mod-vendor@0.6.2
-> paketo-buildpacks/procfile@5.1.2
-> paketo-buildpacks/watchexec@2.5.1
Buildpack paketo-buildpacks/go@1.6.0 already exists on builder with same contents, skipping...
Buildpack paketo-buildpacks/dep@0.3.3 already exists on builder with same contents, skipping...
Buildpack paketo-buildpacks/environment-variables@4.1.2 already exists on builder with same contents, skipping...
Buildpack paketo-buildpacks/git@0.4.2 already exists on builder with same contents, skipping...
Buildpack paketo-buildpacks/go-build@1.1.4 already exists on builder with same contents, skipping...
Buildpack paketo-buildpacks/go-dist@1.2.2 already exists on builder with same contents, skipping...
Buildpack paketo-buildpacks/image-labels@4.1.2 already exists on builder with same contents, skipping...
Buildpack paketo-buildpacks/ca-certificates@3.2.4 already exists on builder with same contents, skipping...
Buildpack paketo-buildpacks/dep-ensure@0.2.4 already exists on builder with same contents, skipping...
Buildpack paketo-buildpacks/go-mod-vendor@0.6.2 already exists on builder with same contents, skipping...
Buildpack paketo-buildpacks/procfile@5.1.2 already exists on builder with same contents, skipping...
Buildpack paketo-buildpacks/watchexec@2.5.1 already exists on builder with same contents, skipping...
DEBUG result image:<nil> error:fetching base layers: saving base image with ID "sha256:94ec39786bc3b96c5fb9151eeac85ef03ca689db6964af775db72a0d7aec4c0a" from the docker daemon: error during connect: Get "http://[fdaa:0:7530:a7b:23c3:9c05:e68c:2]:2375/v1.41/images/get?names=sha256%!A(MISSING)94ec39786bc3b96c5fb9151eeac85ef03ca689db6964af775db72a0d7aec4c0a": connect tcp [fdaa:0:7530:a7b:23c3:9c05:e68c:2]:2375: connection was refused
Error failed to fetch an image or build from source: fetching base layers: saving base image with ID "sha256:94ec39786bc3b96c5fb9151eeac85ef03ca689db6964af775db72a0d7aec4c0a" from the docker daemon: error during connect: Get "http://[fdaa:0:7530:a7b:23c3:9c05:e68c:2]:2375/v1.41/images/get?names=sha256%3A94ec39786bc3b96c5fb9151eeac85ef03ca689db6964af775db72a0d7aec4c0a": connect tcp [fdaa:0:7530:a7b:23c3:9c05:e68c:2]:2375: connection was refused

based off that URL getting a ‘connection refused’ error, I’d be curious to see if generating a new wireguard peer would help-- maybe something along these lines:

fly wireguard list # see current peers
fly wireguard reset # generate new peer
fly wireguard remove # remove the one you were previously using

you might also re-try your deploy after enabling websockets for flyctl with fly wg websockets enable

if you’re still stuck after that, you could try re-deploying with LOG_LEVEL=debug set, or even destroying the builder app.

Thank you for the quick assistance. Tunneling via websockets got me unstuck, but still wondering why the default way does not work?

I tried resetting everything (wireguard peer, destroying all apps) before, but always got stuck at the same point.

The log excerpt I posted above was already with LOG_LEVEL=debug.

Also, I have another wireguard tunnel working, so UDP issues should not be the reason for the timeout here? For debugging, I deactivated my other tunnel to avoid any clashes, of course.

glad it’s working again! I did suggest enabling websockets to rule out any UDP weirdness either on your LAN/reverse path based on the 6PN address in that URL, but if you have another wg tunnel working normally, that’s probably not the case :sweat_smile: