flyctl icon indicating copy to clipboard operation
flyctl copied to clipboard

`fly launch` crashes for cargo workspace

Open yannbolliger opened this issue 1 year ago • 0 comments

Describe the bug When running fly launch for the first time in a Rust cargo workspace with many crates, the error pasted below is printed
This happens again if the command is retried.

What works is to go into the subfolder/crate that contains the binary we want to deploy. The build fails however, because it doesn't find the root Cargo.toml file. Copying the generated Dockerfile out to the root of the workspace/repo finally did the job.

  • macOS 14.7
  • fly v0.3.49 darwin/arm64 Commit: 9b0779fe9a366c881450a188f04cb97f06d1f24c BuildDate: 2024-12-10T14:59:45Z

Paste your fly.toml: no fly.toml at that point, it would be created by the command

Command output:

$ fly launch      
Scanning source code
Oops, something went wrong! Could you try that again?

interface conversion: interface {} is nil, not map[string]interface {}
goroutine 1 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:26 +0x64
github.com/superfly/flyctl/internal/sentry.printError({0x104b45720, 0x140007b38f0})
	github.com/superfly/flyctl/internal/sentry/sentry.go:190 +0x168
github.com/superfly/flyctl/internal/sentry.Recover({0x104b45720, 0x140007b38f0})
	github.com/superfly/flyctl/internal/sentry/sentry.go:180 +0xb8
main.run.func1()
	github.com/superfly/flyctl/main.go:40 +0x34
panic({0x104b45720?, 0x140007b38f0?})
	runtime/panic.go:785 +0x124
go.opentelemetry.io/otel/sdk/trace.(*recordingSpan).End.deferwrap1()
	go.opentelemetry.io/otel/[email protected]/trace/span.go:422 +0x2c
go.opentelemetry.io/otel/sdk/trace.(*recordingSpan).End(0x140002145a0, {0x0, 0x0, 0x14000917770?})
	go.opentelemetry.io/otel/[email protected]/trace/span.go:461 +0xa08
panic({0x104b45720?, 0x140007b38f0?})
	runtime/panic.go:785 +0x124
github.com/superfly/flyctl/scanner.configureRust({0x1400057eed0, 0x25}, 0x1400081e920?)
	github.com/superfly/flyctl/scanner/rust.go:13 +0x4b8
github.com/superfly/flyctl/scanner.Scan({0x1400057eed0, 0x25}, 0x1400081e920)
	github.com/superfly/flyctl/scanner/scanner.go:141 +0x15c
github.com/superfly/flyctl/internal/command/launch.determineSourceInfo({0x104ec55a8, 0x140007e3b90}, 0x14000790000, 0x0, {0x1400057eed0, 0x25})
	github.com/superfly/flyctl/internal/command/launch/sourceinfo.go:72 +0x354
github.com/superfly/flyctl/internal/command/launch.buildManifest({0x104ec55a8, 0x140007e3b90}, 0x0, 0x140009175d0)
	github.com/superfly/flyctl/internal/command/launch/plan_builder.go:156 +0x27c
github.com/superfly/flyctl/internal/command/launch.run({0x104ec55a8, 0x140007e3b90})
	github.com/superfly/flyctl/internal/command/launch/cmd.go:304 +0x3bc
github.com/superfly/flyctl/internal/command/launch.New.New.newRunE.func1(0x14000620908, {0x106291c40?, 0x4?, 0x1043aaa36?})
	github.com/superfly/flyctl/internal/command/command.go:140 +0x188
github.com/spf13/cobra.(*Command).execute(0x14000620908, {0x106291c40, 0x0, 0x0})
	github.com/spf13/[email protected]/command.go:985 +0x834
github.com/spf13/cobra.(*Command).ExecuteC(0x14000022008)
	github.com/spf13/[email protected]/command.go:1117 +0x344
github.com/spf13/cobra.(*Command).ExecuteContextC(...)
	github.com/spf13/[email protected]/command.go:1050
github.com/superfly/flyctl/internal/cli.Run({0x104ec5730?, 0x14000155940?}, 0x140005580a0, {0x1400004c0b0, 0x1, 0x1})
	github.com/superfly/flyctl/internal/cli/cli.go:94 +0x5a0
main.run()
	github.com/superfly/flyctl/main.go:47 +0x174
main.main()
	github.com/superfly/flyctl/main.go:26 +0x20

yannbolliger avatar Dec 12 '24 13:12 yannbolliger