Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ftl secret set panics if ftl-project.toml doesnt exist #1338

Closed
mistermoe opened this issue Apr 26, 2024 · 1 comment
Closed

ftl secret set panics if ftl-project.toml doesnt exist #1338

mistermoe opened this issue Apr 26, 2024 · 1 comment
Labels
triage Issue needs triaging

Comments

@mistermoe
Copy link
Collaborator

mistermoe commented Apr 26, 2024

FTL Version: 0.185.4

not sure if ftl-project.toml ends up getting created by default when calling ftl init now but it definitely didn't get created by default in prior versions. might be helpful to create it if it doesn't exist when running this command or any command that necessitates its existence

Repro

❯ ftl secret set plz --envar
Secret:
FTL_SECRET_cGx6=IlwiYWJjZFwiIg
panic: runtime error: index out of range [-1]

goroutine 1 [running]:
github.com/TBD54566975/ftl/common/configuration.ProjectConfigResolver[...].setMapping(0x140003d9170?, {{0x0, 0x140003d9530}, 0x0, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, ...}, ...)
	github.com/TBD54566975/ftl/common/configuration/projectconfig_resolver.go:154 +0x204
github.com/TBD54566975/ftl/common/configuration.ProjectConfigResolver[...].Set(0x103ebcae0?, {0x103eac0d8?, 0x140003fee10?}, {{{0x0, 0x0?}, 0x0?}, {0x14000162040, 0x3}}, 0x14000617a70)
	github.com/TBD54566975/ftl/common/configuration/projectconfig_resolver.go:84 +0x1c0
github.com/TBD54566975/ftl/common/configuration.(*Manager[...]).Set(0x6, {0x103eac0d8?, 0x140003fee10}, {{{0x0, 0x0}, 0x0}, {0x14000162040, 0x3}}, {0x103bfad40, 0x1400032ad20})
	github.com/TBD54566975/ftl/common/configuration/manager.go:132 +0xf0
main.(*secretSetCmd).Run(0x104a8e8e0, {0x103eac0d8, 0x140003fee10}, 0x140004a20e0?, {0x103eb03a0?, 0x104af8300?})
	github.com/TBD54566975/ftl/cmd/ftl/cmd_secret.go:146 +0x2b4
reflect.Value.call({0x103c52580?, 0x104a8e8e0?, 0x140004a1788?}, {0x1038893f1, 0x4}, {0x140006889c0, 0x3, 0x1033a3688?})
	reflect/value.go:596 +0x970
reflect.Value.Call({0x103c52580?, 0x104a8e8e0?, 0x140004a1888?}, {0x140006889c0?, 0x103e8a9e0?, 0x140004a17c0?})
	reflect/value.go:380 +0x94
github.com/alecthomas/kong.callFunction({0x103c52580?, 0x104a8e8e0?, 0x140004a1a10?}, 0x140003fef60)
	github.com/alecthomas/[email protected]/callbacks.go:98 +0x390
github.com/alecthomas/kong.(*Context).RunNode(0x14000599f00, 0x14000499d10, {0x140004a1e78, 0x1, 0x103ecb1f0?})
	github.com/alecthomas/[email protected]/context.go:774 +0x630
github.com/alecthomas/kong.(*Context).Run(0x1400031da70?, {0x140004a1e78?, 0x140003fee10?, 0x103bbd660?})
	github.com/alecthomas/[email protected]/context.go:799 +0x138
main.main()
	github.com/TBD54566975/ftl/cmd/ftl/main.go:130 +0xc68
@github-actions github-actions bot added the triage Issue needs triaging label Apr 26, 2024
@alecthomas
Copy link
Collaborator

This is actually already fixed in main, just not rolled out yet because of unrelated annoying bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issue needs triaging
Projects
None yet
Development

No branches or pull requests

2 participants