Receiving "Oops, something went wrong! Could you try that again?" when running `fly config validate -a <app name>`

Title explains it. I am trying to validate an app’s config file since the dockerfile field appears to be getting ignored. When I run the command I am met with an error: runtime error: invalid memory address or nil pointer dereference, and a stack trace.

please post the stack trace!

runtime error: invalid memory address or nil pointer dereference
goroutine 1 [running]:
runtime/debug.Stack()
        /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.1.linux-amd64/src/runtime/debug/stack.go:26 +0x5e
github.com/superfly/flyctl/internal/sentry.printError({0x25164e0, 0x427fef0})
        /home/runner/work/flyctl/flyctl/internal/sentry/sentry.go:190 +0x16a
github.com/superfly/flyctl/internal/sentry.Recover({0x25164e0, 0x427fef0})
        /home/runner/work/flyctl/flyctl/internal/sentry/sentry.go:180 +0xb4
main.run.func1()
        /home/runner/work/flyctl/flyctl/main.go:40 +0x2f
panic({0x25164e0?, 0x427fef0?})
        /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.1.linux-amd64/src/runtime/panic.go:792 +0x132
github.com/superfly/flyctl/internal/appconfig.(*Config).SetMachinesPlatform(...)
        /home/runner/work/flyctl/flyctl/internal/appconfig/platformversion.go:5
github.com/superfly/flyctl/internal/command/config.runValidate({0x2e19d60, 0xc0006d7ef0})
        /home/runner/work/flyctl/flyctl/internal/command/config/validate.go:33 +0x7b
github.com/superfly/flyctl/internal/command/config.newValidate.New.newRunE.func1(0xc000646608, {0xc0003e9aa0?, 0x4?, 0x28c9e69?})
        /home/runner/work/flyctl/flyctl/internal/command/command.go:142 +0x1ca
github.com/spf13/cobra.(*Command).execute(0xc000646608, {0xc0003e9a80, 0x2, 0x2})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1015 +0xa94
github.com/spf13/cobra.(*Command).ExecuteC(0xc00081e008)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1148 +0x40c
github.com/spf13/cobra.(*Command).ExecuteContextC(...)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1080
github.com/superfly/flyctl/internal/cli.Run({0x2e19ee8?, 0xc00091d440?}, 0xc000782000, {0xc00004e060, 0x4, 0x4})
        /home/runner/work/flyctl/flyctl/internal/cli/cli.go:95 +0x7cd
main.run()
        /home/runner/work/flyctl/flyctl/main.go:47 +0x150
main.main()
        /home/runner/work/flyctl/flyctl/main.go:26 +0x18

Oddly, if you run touch fly.toml before running that command, it works.

I’ve created a pull request:

It is not clear to me that it makes much sense to validate a remote configuration, but it certainly is better than a stack traceback.

1 Like

For context, my config file in question does exist locally. Maybe my assumption that using the -a flag could hit the local config file was wrong. Now I see that the -c flag works fine for selecting the particular .toml file I was trying to validate.

1 Like