Hello
I am running a dart based server (compiled binary) on fly machines. My server needs sqlite. I use the dart package sqlite3
to connect. It works fine on Mac and Linux on my local env. For deploying on fly.io I am using a Dockerfile similar to this…
FROM dart:stable AS build
WORKDIR /app
COPY ./proj/pubspec.* .
RUN dart pub get
# Copy app source code and AOT compile it
COPY ./proj .
# Ensure packages are still up-to-date if anything has changed
RUN dart pub get --offline
RUN dart compile exe ./bin/main.dart -o ./bin/server
# Build minimal serving image from AOT-compiled `/server` and required system
# libraries and configuration files stored in `/runtime/` from the build stage
FROM alpine:3.14 as sqlite
RUN apk add --no-cache sqlite sqlite-dev sqlite-libs
COPY --from=build /runtime/ /
COPY --from=build /app/bin/server /app/bin/
# Start server.
EXPOSE 8080
ENTRYPOINT ["/app/bin/server"]
The server starts up fine. But as soon as it tries to access sqlite, it seems to crash, with no logs either. Fly.io’s orchestrator restarts the machine. Logs look something like this
2023-02-02T14:51:34.257 app[6e82512c736787] maa [info] (I) GameHandler <redacted app log>
2023-02-02T14:51:35.740 app[6e82512c736787] maa [info] Starting clean up.
2023-02-02T14:51:36.099 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.103 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.110 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.117 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.131 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.147 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.147 proxy[6e82512c736787] maa [error] failed to connect to instance after 6 attempts
2023-02-02T14:51:36.177 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.181 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.187 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.193 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.202 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.218 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.218 proxy[6e82512c736787] maa [error] failed to connect to instance after 6 attempts
2023-02-02T14:51:36.270 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.274 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.279 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.285 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.296 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.312 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.312 proxy[6e82512c736787] maa [error] failed to connect to instance after 6 attempts
2023-02-02T14:51:36.457 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.471 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.476 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.481 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.493 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.515 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.515 proxy[6e82512c736787] maa [error] failed to connect to instance after 6 attempts
2023-02-02T14:51:36.642 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.646 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.650 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.656 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.669 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.687 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:36.687 proxy[6e82512c736787] maa [error] failed to connect to instance after 6 attempts
2023-02-02T14:51:36.740 app[6e82512c736787] maa [info] [ 15.126433] reboot: Restarting system
2023-02-02T14:51:37.666 runner[6e82512c736787] maa [info] machine did not have a restart policy, defaulting to restart
2023-02-02T14:51:38.039 app[6e82512c736787] maa [info] Starting init (commit: e3cff9e)...
2023-02-02T14:51:38.058 app[6e82512c736787] maa [info] Preparing to run: `/app/bin/server` as root
2023-02-02T14:51:38.067 app[6e82512c736787] maa [info] 2023/02/02 14:51:38 listening on [fdaa:1:19cd:a7b:1449:d2c4:dff3:2]:22 (DNS: [fdaa::3]:53)
2023-02-02T14:51:38.094 proxy[6e82512c736787] maa [error] failed to connect to machine: could not connect to already-started machine on 172.19.128.26:8081 (is your app listening on 0.0.0.0:8081?), error: connection refused by remote server
2023-02-02T14:51:38.097 proxy[6e82512c736787] maa [info] Starting machine
Any ideas on how I could figure out what’s going on. In the logs, the second line above says Starting clean up
, that is not from my application’s logs, but coming from the application container. No idea what that is about either.
Thanks!