Hello,
I have a problem with the machine API, it keeps throwing a 503 error when I create or update machines, even after switching regions. Any ideas what might be causing this persistent issue?
api response: [POST /apps/{app_name}/machines/{machine_id}] Machines_update (status 503): {}
here the example of go code using generated machine api:
p := machines.NewMachinesUpdateParams()
p.WithAppName(appName)
p.WithMachineID("17811e11b0d078")
p.WithRequest(&models.UpdateMachineRequest{
Config: struct{ models.APIMachineConfig }{
APIMachineConfig: models.APIMachineConfig{
AutoDestroy: false,
Checks: map[string]models.APIMachineCheck{
"http-get": {
Type: "http",
Protocol: "http",
Port: 8080,
Method: "GET",
Path: "/liveness",
Interval: "15s",
Timeout: "10s",
},
},
DNS: &models.APIDNSConfig{
SkipRegistration: false,
},
Env: map[string]string{
"FLY_PROCESS_GROUP": "app",
"PORT": "8080",
"PRIMARY_REGION": "cdg",
},
Files: nil,
Guest: &models.APIMachineGuest{
CPUKind: "shared",
Cpus: 1,
GpuKind: "",
HostDedicationID: "",
KernelArgs: nil,
MemoryMb: 512,
},
Image: dockerImage,
Init: &models.APIMachineInit{
Cmd: nil,
Entrypoint: nil,
Tty: false,
KernelArgs: nil,
SwapSizeMb: 0,
Exec: nil,
},
Metadata: map[string]string{
"fly_process_group": "app",
"fly_platform_version": "v2",
},
Metrics: nil,
Mounts: nil,
Processes: nil,
Restart: &models.APIMachineRestart{
MaxRetries: 10,
Policy: "on-fail",
},
Schedule: "",
Services: []*models.APIMachineService{
{
Protocol: "tcp",
Ports: []*models.APIMachinePort{
{
Port: 443,
Handlers: []string{"tls", "http"},
},
{
Port: 80,
ForceHTTPS: true,
Handlers: []string{"http"},
},
},
Autostart: true,
Autostop: true,
Checks: nil,
Concurrency: &models.APIMachineServiceConcurrency{
Type: "requests",
HardLimit: 250,
SoftLimit: 200,
},
InternalPort: 8080,
MinMachinesRunning: 0,
},
},
Statics: nil,
StopConfig: nil,
},
},
LeaseTTL: 120,
Region: region,
SkipLaunch: true,
SkipServiceRegistration: false,
})
p.SetContext(context.Background())
result, err := s.machine.Machines.MachinesUpdate(p)
if err != nil {
return nil, err
}
return result, nil