This is my first time deploying a server and I am having some trouble getting the API working. After I have successfully deployed I get a 502 bad gateway error to the API. For some background context, I am using vapor and have the default docker file in my vapor project. I am connected to the Supabse Fly database and set the URL and POOL env variables in the fly secrets screen. Lastly I included how i am setting up my configure vapor app and included some of the logs that I am receiving. If anyone has any insight it would greatly be appreciated.
if let url = Environment.get("DATABASE_URL") {
app.databases.use(try DatabaseConfigurationFactory.postgres(url: url), as: .psql)
} else {
app.databases.use(DatabaseConfigurationFactory.postgres(configuration: .init(
hostname: "127.0.0.1",
port: 54322,
username: "postgres",
password: "postgres",
database: "postgres",
tls: .prefer(try .init(configuration: .clientDefault)))
), as: .psql)
}
2024-10-08T01:16:32.144 app[6e8257dda7d248] sjc [info] [ 0.301965] PCI: Fatal: No config space access function found
2024-10-08T01:16:32.582 app[6e8257dda7d248] sjc [info] INFO Starting init (commit: e07a8d0e)...
2024-10-08T01:16:32.735 app[6e8257dda7d248] sjc [info] INFO Preparing to run: `./App serve --env production --hostname 0.0.0.0 --port 8080` as vapor
2024-10-08T01:16:32.742 app[6e8257dda7d248] sjc [info] INFO [fly api proxy] listening at /.fly/api
2024-10-08T01:16:32.751 app[6e8257dda7d248] sjc [info] ERROR stderr to vsock zero copy err: Broken pipe (os error 32)
2024-10-08T01:16:32.751 runner[6e8257dda7d248] sjc [info] Machine started in 1.151s
2024-10-08T01:16:32.899 app[6e8257dda7d248] sjc [info] 2024/10/08 01:16:32 INFO SSH listening listen_address=[fdaa:a:5dc9:a7b:335:8704:d9b9:2]:22 dns_server=[fdaa::3]:53
2024-10-08T01:16:33.742 app[6e8257dda7d248] sjc [info] INFO Main child exited normally with code: 127
2024-10-08T01:16:33.757 app[6e8257dda7d248] sjc [info] INFO Starting clean up.
2024-10-08T01:16:33.761 app[6e8257dda7d248] sjc [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2024-10-08T01:16:33.762 app[6e8257dda7d248] sjc [info] [ 1.919571] reboot: Restarting system
2024-10-08T01:16:34.173 runner[6e8257dda7d248] sjc [info] machine has reached its max restart count of 10
2024-10-08T01:16:39.699 app[6e8257d4b02e28] sjc [info] 2024-10-08T01:16:39.699318524 [01J9MT5EC1YSBNECNRN0R6ZPA0:main] Running Firecracker v1.7.0
2024-10-08T01:16:40.096 app[6e8257d4b02e28] sjc [info] [ 0.297445] PCI: Fatal: No config space access function found
2024-10-08T01:16:40.522 app[6e8257d4b02e28] sjc [info] INFO Starting init (commit: e07a8d0e)...
2024-10-08T01:16:40.690 app[6e8257d4b02e28] sjc [info] INFO Preparing to run: `./App serve --env production --hostname 0.0.0.0 --port 8080` as vapor
2024-10-08T01:16:40.697 app[6e8257d4b02e28] sjc [info] INFO [fly api proxy] listening at /.fly/api
2024-10-08T01:16:40.707 app[6e8257d4b02e28] sjc [info] ERROR stderr to vsock zero copy err: Broken pipe (os error 32)
2024-10-08T01:16:40.714 runner[6e8257d4b02e28] sjc [info] Machine started in 1.104s
2024-10-08T01:16:40.895 app[6e8257d4b02e28] sjc [info] 2024/10/08 01:16:40 INFO SSH listening listen_address=[fdaa:a:5dc9:a7b:336:64ee:6ac8:2]:22 dns_server=[fdaa::3]:53
2024-10-08T01:16:41.698 app[6e8257d4b02e28] sjc [info] INFO Main child exited normally with code: 127
2024-10-08T01:16:41.713 app[6e8257d4b02e28] sjc [info] INFO Starting clean up.
2024-10-08T01:16:41.717 app[6e8257d4b02e28] sjc [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2024-10-08T01:16:41.718 app[6e8257d4b02e28] sjc [info] [ 1.917041] reboot: Restarting system
2024-10-08T01:16:42.067 runner[6e8257d4b02e28] sjc [info] machine has reached its max restart count of 10