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

When providing a workspace ID longer than 25 characters, the Astro CLI crashes with a runtime error. #1662

Open
nandlalyadav57 opened this issue Jun 10, 2024 · 0 comments

Comments

@nandlalyadav57
Copy link

nandlalyadav57 commented Jun 10, 2024


Bug Report

Description

When providing a workspace ID longer than 25 characters, the Astro CLI crashes with a runtime error.

Steps to Reproduce

  1. Install Astro CLI version 1.26.0 or 1.27
  2. Run the following command with a bogus workspace ID longer than 25 characters:
    astro deployment variable list --workspace-id crashme111111111111111111
    

Expected Behavior

The CLI should handle invalid workspace IDs gracefully and provide a meaningful error message instead of crashing.

Actual Behavior

The CLI crashes with a runtime error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x1e0 pc=0x104e4a080]

`

astro version
Astro CLI Version: 1.26.0

astro de variable list --workspace-id crashme111111111111111111
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x1e0 pc=0x104e4a080]

goroutine 1 [running]:
github.com/astronomer/astro-cli/cloud/deployment.init.func9({_, }, {, _, _, }, {, _})
github.com/astronomer/astro-cli/cloud/deployment/deployment.go:1490 +0x140
github.com/astronomer/astro-cli/cloud/deployment.Create({0x0, }, {, }, {, }, {, }, {, }, ...)
github.com/astronomer/astro-cli/cloud/deployment/deployment.go:222 +0x2a4
github.com/astronomer/astro-cli/cloud/deployment.deploymentSelectionProcess({
, }, {, _, _}, , {, }, {, }, ...)
github.com/astronomer/astro-cli/cloud/deployment/deployment.go:1684 +0x2bc
github.com/astronomer/astro-cli/cloud/deployment.GetDeployment({
, }, {, }, {, _}, _, , {, _}, ...)
github.com/astronomer/astro-cli/cloud/deployment/deployment.go:1632 +0x1e0
github.com/astronomer/astro-cli/cloud/deployment.VariableList({0x0?, 0x0?}, {0x0, 0x0}, {0x16b69fa0e?, 0x0?}, {0x10549f6f6, 0x4}, {0x0?, 0x0?}, ...)
github.com/astronomer/astro-cli/cloud/deployment/deployment_variable.go:31 +0xa4
github.com/astronomer/astro-cli/cmd/cloud.deploymentVariableList(0x1400002e908, {0x7dace2e600000000?, 0x1400041fc18?, 0x0?}, {0x105a5b658, 0x14000076050})
github.com/astronomer/astro-cli/cmd/cloud/deployment.go:797 +0xd4
github.com/astronomer/astro-cli/cmd/cloud.newDeploymentVariableListCmd.func1(0x1400002e908?, {0x14000486180?, 0x4?, 0x10549f846?})
github.com/astronomer/astro-cli/cmd/cloud/deployment.go:491 +0x28
github.com/spf13/cobra.(*Command).execute(0x1400002e908, {0x14000486160, 0x2, 0x2})
github.com/spf13/[email protected]/command.go:940 +0x654
github.com/spf13/cobra.(*Command).ExecuteC(0x140001daf08)
github.com/spf13/[email protected]/command.go:1068 +0x320
github.com/spf13/cobra.(*Command).Execute(0x105a74660?)
github.com/spf13/[email protected]/command.go:992 +0x1c
main.main()
github.com/astronomer/astro-cli/main.go:21 +0x38

astro deployment variable list --workspace-id=clx8h
A newer version of Astro CLI is available: 1.27.1
Please see https://docs.astronomer.io/astro/cli/install-cli#upgrade-the-cli for information on how to update the Astro CLI
If you don't want to see this message again run 'astro config set -g upgrade_message false'
Error: the Deployment specified was not found in this workspace. Your account or API Key may not have access to the deployment specified: Invalid query parameter values: field workspaceIds[0] failed check on isCuid;

astro deployment variable list --workspace-id=crashme111111111111111111
A newer version of Astro CLI is available: 1.27.1
Please see https://docs.astronomer.io/astro/cli/install-cli#upgrade-the-cli for information on how to update the Astro CLI
If you don't want to see this message again run 'astro config set -g upgrade_message false'
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1e0 pc=0xb5620f]

goroutine 1 [running]:
github.com/astronomer/astro-cli/cloud/deployment.glob..func9({_, }, {, _, _, }, {, })
/go/src/github.com/astronomer/astro-cli/cloud/deployment/deployment.go:1490 +0x18f
github.com/astronomer/astro-cli/cloud/deployment.Create({
, }, {, }, {, }, {, }, {0xc000753540, 0x6}, ...)
/go/src/github.com/astronomer/astro-cli/cloud/deployment/deployment.go:222 +0x2c7
github.com/astronomer/astro-cli/cloud/deployment.deploymentSelectionProcess({
, }, {, _, _}, , {, }, {0x0, 0x0}, ...)
/go/src/github.com/astronomer/astro-cli/cloud/deployment/deployment.go:1684 +0x3ee
github.com/astronomer/astro-cli/cloud/deployment.GetDeployment({
, }, {, }, {, _}, _, _, {0x17cc760, 0xc00047adb0}, ...)
/go/src/github.com/astronomer/astro-cli/cloud/deployment/deployment.go:1632 +0x285
github.com/astronomer/astro-cli/cloud/deployment.VariableList({0x0?, 0x0?}, {0x0, 0x0}, {0x7ffca2d20b13?, 0x0?}, {0x156b34c, 0x4}, {0x0, 0x0}, ...)
/go/src/github.com/astronomer/astro-cli/cloud/deployment/deployment_variable.go:31 +0xbc
github.com/astronomer/astro-cli/cmd/cloud.deploymentVariableList(0xc00002ec00, {0x0?, 0x0?, 0x0?}, {0x17aa3c0, 0xc000088028})
/go/src/github.com/astronomer/astro-cli/cmd/cloud/deployment.go:797 +0xec
github.com/astronomer/astro-cli/cmd/cloud.newDeploymentVariableListCmd.func1(0xc00058cb00?, {0xc00051de50?, 0x4?, 0x156b494?})
/go/src/github.com/astronomer/astro-cli/cmd/cloud/deployment.go:491 +0x25
github.com/spf13/cobra.(*Command).execute(0xc

`

Environment

  • Astro CLI Version: 1.26.0

Additional Context

This issue has been observed when providing workspace IDs longer than 25 characters. It seems to be related to how the CLI handles invalid inputs.

Priority

This issue is not a high priority but should be addressed to improve the stability and usability of the CLI.

Reference: 53573

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

No branches or pull requests

1 participant