Hey Its my first time using fly.io , Its been a great experience so far but I have hit a major roadblock.
I am creating apps using api and I set the auto stop and auto start in there. But when I create through the api autostart and auto stop doesn’t work. If I create through fly.toml and cli then auto start and stop works
Code which makes the api call
const machineConfig = {
config: {
image: 'test/expo-fast:latest',
services: [
{
protocol: 'tcp',
internal_port: 8000,
auto_stop_machines: "stop",
auto_start_machines: true,
min_machines_running: 0,
ports: [
{ port: 80, handlers: ['http'] },
{ port: 443, handlers: ['tls', 'http'] }
]
},
{
protocol: 'tcp',
internal_port: 8001,
auto_stop_machines: "stop",
auto_start_machines: true,
min_machines_running: 0,
ports: [
{ port: 8001, handlers: ['tls', 'http'] }
]
}
],
env: {
PORT: '8000',
},
guest: {
cpu_kind: 'shared',
cpus: 2,
memory_mb: 2048
}
},
};
What did I do to debug ?
I ran this cli command to get the config of the machine created by the api
flyctl config save -a container-1744165961751-0
Its missing the auto start and auto stop
[[services]]
protocol = 'tcp'
internal_port = 8000
min_machines_running = 0
[[services.ports]]
port = 80
handlers = ['http']
[[services.ports]]
port = 443
handlers = ['tls', 'http']
[[services]]
protocol = 'tcp'
internal_port = 8001
min_machines_running = 0
[[services.ports]]
port = 8001
handlers = ['tls', 'http']
[[metrics]]
Either this is a major bug no one has gone through before or I am doing something majorly wrong