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

[Issue] panic when I don't explicitly select a location #2714

Closed
1 task done
pamelafox opened this issue Sep 6, 2023 · 0 comments · Fixed by #2713
Closed
1 task done

[Issue] panic when I don't explicitly select a location #2714

pamelafox opened this issue Sep 6, 2023 · 0 comments · Fixed by #2713
Assignees

Comments

@pamelafox
Copy link
Member

Output from azd version

@pamelafox ➜ /workspaces/azure-search-openai-demo (aca) $ azd version
azd version 1.2.0 (commit 99ea757)

Describe the bug

For https://github.com/Azure-Samples/azure-search-openai-demo/tree/aca when running azd up, I opted to just go with the top location in the allowed subset, but kept getting panics:

  (✓) Done: Retrieving locations...
? Enter a value for the 'openAiResourceGroupLocation' infrastructure parameter: 
panic: runtime error: index out of range [-1]

goroutine 1 [running]:
github.com/azure/azure-dev/cli/azd/pkg/azureutil.PromptLocationWithFilter({0x555bf5920b50, 0xc0004d1110}, {0xc0004ba870, 0x24}, {0xc00004c2d0, 0x4d}, {0x0, 0x0}, {0x555bf5929be8, 0xc0004c4680}, ...)
        /mnt/vss/_work/1/s/cli/azd/pkg/azureutil/location.go:88 +0x70d
github.com/azure/azure-dev/cli/azd/pkg/prompt.(*DefaultPrompter).PromptLocation(0xc000497080, {0x555bf5920b50, 0xc0004d1110}, {0xc0004ba870, 0x24}, {0xc00004c2d0?, 0x0?}, 0x0?)
        /mnt/vss/_work/1/s/cli/azd/pkg/prompt/prompter.go:94 +0x98
github.com/azure/azure-dev/cli/azd/pkg/infra/provisioning/bicep.(*BicepProvider).promptForParameter(0xc0004ee340, {0x555bf5920b50, 0xc0004d1110}, {0xc00021c240, 0x1b}, {{0xc0002fa326, 0x6}, {0x0, 0x0}, 0xc0002ac258, ...})

I think it said -1 index not allowed, though thats cut off in my terminal now.

Once I re-ran and explicitly up/down'ed through the options, I could select the first location.

I also don't know if I accidentally pressed some other weird key as I was jamming pretty hard at the time but I also think its funny that dancing causes a panic... at the disco.

To Reproduce

azd up on above repo, try to go with japaneast by not explicitly selecting anything else, just pressing enter.

Environment

GitHub Codespaces

@weikanglim weikanglim self-assigned this Sep 6, 2023
weikanglim added a commit that referenced this issue Sep 6, 2023
Update changelog and bump version.txt for 1.3.0

Fix #2714 by avoiding an empty string being set as the default value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants