Unclear error message when app recipe is improperly structured #278

Closed
opened 2021-12-01 11:18:30 +00:00 by notplants · 1 comment
Member

Describe the current behavior

Unclear error message when app recipe is improperly structured (found while working on mattermost recipe)

Steps to reproduce

From this version of mattermost repo 3e31f25f80

abra app new mattermost
yields:

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
coopcloud.tech/abra/pkg/upstream/stack.getConfigDetails({0x0, 0xc00061f348, 0xc00003c948}, 0xc00061f348)
	/drone/src/pkg/upstream/stack/loader.go:70 +0x2e5
coopcloud.tech/abra/pkg/upstream/stack.LoadComposefile({{0x0, 0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, 0x0, 0x0}, 0xc0004804e0)
	/drone/src/pkg/upstream/stack/loader.go:18 +0x96
coopcloud.tech/abra/pkg/recipe.Get({0x7ffeefbff76d, 0xa})
	/drone/src/pkg/recipe/recipe.go:91 +0x269
coopcloud.tech/abra/cli/internal.ValidateRecipeWithPrompt(0xc0000308c0)
	/drone/src/cli/internal/validate.go:70 +0x232
coopcloud.tech/abra/cli/internal.NewAction(0xc000406000)
	/drone/src/cli/internal/new.go:138 +0x4b
github.com/urfave/cli/v2.(*Command).Run(0x213e960, 0xc000030580)
	/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:163 +0x64a
github.com/urfave/cli/v2.(*App).RunAsSubcommand(0xc000001a00, 0xc0000303c0)
	/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:434 +0x9a6
github.com/urfave/cli/v2.(*Command).startApp(0x213ffe0, 0xc0000303c0)
	/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:278 +0x713
github.com/urfave/cli/v2.(*Command).Run(0xc00048a000, 0x7ffeefbff765)
	/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:94 +0x7bc
github.com/urfave/cli/v2.(*App).RunContext(0xc000622680, {0x1b2f8d8, 0xc000130008}, {0xc00012e040, 0x4, 0x4})
	/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:313 +0x81e
github.com/urfave/cli/v2.(*App).Run(...)
	/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224
coopcloud.tech/abra/cli.RunApp({0x1b0b1c0, 0x1018a45}, {0x1b24b60, 0xc0000001a0})
	/drone/src/cli/cli.go:107 +0x4f
main.main()
	/drone/src/cmd/abra/main.go:23 +0xbb

abra catalogue generate mattermost
yields:
retrieving recipes... 99% |██████████████████████████████████████████████████████ | (116/117) FATA[0001] branch not found

Describe the expected behavior

This commit from @cellarspoon fixes the issue: bc1eb3554f

abra couldn't understand a missing compose.yml and missing TYPE=...

It would be preferable if Abra gave error messages that could somehow indicate what was missing.

## Describe the current behavior Unclear error message when app recipe is improperly structured (found while working on mattermost recipe) ## Steps to reproduce From this version of mattermost repo https://git.coopcloud.tech/coop-cloud/mattermost/commit/3e31f25f8025828d0f9f7b620c5cba1e5bfa39ec ```abra app new mattermost``` yields: ``` panic: runtime error: index out of range [0] with length 0 goroutine 1 [running]: coopcloud.tech/abra/pkg/upstream/stack.getConfigDetails({0x0, 0xc00061f348, 0xc00003c948}, 0xc00061f348) /drone/src/pkg/upstream/stack/loader.go:70 +0x2e5 coopcloud.tech/abra/pkg/upstream/stack.LoadComposefile({{0x0, 0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, 0x0, 0x0}, 0xc0004804e0) /drone/src/pkg/upstream/stack/loader.go:18 +0x96 coopcloud.tech/abra/pkg/recipe.Get({0x7ffeefbff76d, 0xa}) /drone/src/pkg/recipe/recipe.go:91 +0x269 coopcloud.tech/abra/cli/internal.ValidateRecipeWithPrompt(0xc0000308c0) /drone/src/cli/internal/validate.go:70 +0x232 coopcloud.tech/abra/cli/internal.NewAction(0xc000406000) /drone/src/cli/internal/new.go:138 +0x4b github.com/urfave/cli/v2.(*Command).Run(0x213e960, 0xc000030580) /go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:163 +0x64a github.com/urfave/cli/v2.(*App).RunAsSubcommand(0xc000001a00, 0xc0000303c0) /go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:434 +0x9a6 github.com/urfave/cli/v2.(*Command).startApp(0x213ffe0, 0xc0000303c0) /go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:278 +0x713 github.com/urfave/cli/v2.(*Command).Run(0xc00048a000, 0x7ffeefbff765) /go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:94 +0x7bc github.com/urfave/cli/v2.(*App).RunContext(0xc000622680, {0x1b2f8d8, 0xc000130008}, {0xc00012e040, 0x4, 0x4}) /go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:313 +0x81e github.com/urfave/cli/v2.(*App).Run(...) /go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224 coopcloud.tech/abra/cli.RunApp({0x1b0b1c0, 0x1018a45}, {0x1b24b60, 0xc0000001a0}) /drone/src/cli/cli.go:107 +0x4f main.main() /drone/src/cmd/abra/main.go:23 +0xbb ``` ```abra catalogue generate mattermost``` yields: ```retrieving recipes... 99% |██████████████████████████████████████████████████████ | (116/117) FATA[0001] branch not found ``` ## Describe the expected behavior This commit from @cellarspoon fixes the issue: https://git.coopcloud.tech/coop-cloud/mattermost/commit/bc1eb3554f133031e81c10c704f43c9edd56bcc7 abra couldn't understand a missing compose.yml and missing TYPE=... It would be preferable if Abra gave error messages that could somehow indicate what was missing.
notplants added the
bug
abra
labels 2021-12-01 11:18:30 +00:00
decentral1se added this to the Beta release (software) project 2021-12-05 00:52:21 +00:00
Owner
https://git.coopcloud.tech/coop-cloud/abra/commit/3d3eefb2fe520d355ef9157d61abd48715a62c3a
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/organising#278
No description provided.