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

runtime error: slice bounds out of range when running uds remove core --confirm #434

Closed
andrewg-xyz opened this issue Feb 15, 2024 · 3 comments
Labels
possible-bug Something may not be working

Comments

@andrewg-xyz
Copy link
Contributor

Environment

Device and OS: M2 Max, 14.2.1
App version: 0.9.0
Kubernetes distro being used: k3d (uds-k3d 0.3.1)
Other: uds zarf package list

     Package | Version | Components
     uds-k3d | 0.3.1   | [destroy-cluster create-cluster uds-dev-stack]
     init    | v0.32.2 | [zarf-injector zarf-seed-registry zarf-registry zarf-agent]
     core    | 0.12.0 | [prometheus-operator-crds istio-controlplane istio-admin-gateway istio-tenant-gateway istio-passthrough-gateway pepr-uds-core metrics-server neuvector loki kube-prometheus-stack promtail grafana]

docker desktop: 4.26.1 (131620)

Steps to reproduce

  1. uds deploy k3d-core-demo:0.12.0
  2. uds zarf tools list
  3. See a package called core that I want to remove
  4. uds remove core --confirm
  5. Error
panic: runtime error: slice bounds out of range [:6] with length 4

goroutine 1 [running]:
github.com/defenseunicorns/uds-cli/src/pkg/utils.EnsureOCIPrefix(...)
        /home/runner/work/uds-cli/uds-cli/src/pkg/utils/oci.go:250
github.com/defenseunicorns/uds-cli/src/pkg/bundle.getOCIValidatedSource({0x16bbb2ea8, 0x4})
        /home/runner/work/uds-cli/uds-cli/src/pkg/bundle/remote.go:263 +0x420
github.com/defenseunicorns/uds-cli/src/pkg/bundle.CheckOCISourcePath({0x16bbb2ea8, 0x4})
        /home/runner/work/uds-cli/uds-cli/src/pkg/bundle/remote.go:330 +0x40
github.com/defenseunicorns/uds-cli/src/pkg/bundle.(*Bundle).Remove(0x140017a6000)
        /home/runner/work/uds-cli/uds-cli/src/pkg/bundle/remove.go:28 +0x38
github.com/defenseunicorns/uds-cli/src/cmd.glob..func13(0x10b9b9d40?, {0x140003f3aa0?, 0x4?, 0x10754ba68?})
        /home/runner/work/uds-cli/uds-cli/src/cmd/uds.go:129 +0x158
github.com/spf13/cobra.(*Command).execute(0x10b9b9d40, {0x140003f3a40, 0x2, 0x2})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987 +0x828
github.com/spf13/cobra.(*Command).ExecuteC(0x10b9ba8c0)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/defenseunicorns/uds-cli/src/cmd.Execute()
        /home/runner/work/uds-cli/uds-cli/src/cmd/root.go:60 +0x24
main.main()
        /home/runner/work/uds-cli/uds-cli/main.go:10 +0x1c

Expected result

Package named core is removed or a sensible error is provided.

Actual Result

non-sensible error. what is confusing code stack trace?

Visual Proof (screenshots, videos, text, etc)

image

Severity/Priority

medium-high?

Additional Context

log file only had two lines "saving log file to..."

@andrewg-xyz andrewg-xyz added the possible-bug Something may not be working label Feb 15, 2024
@decleaver
Copy link
Collaborator

decleaver commented Feb 15, 2024

hey @andrewg-xyz , so the remove command attempts to remove a bundle (and all of the packages in that bundle). To only remove a specific package, you can do uds remove <bundle file> -p <package name>.

Idk, i think from the logs its pretty clear what the problem is..... lol jk, we do need to clean that up and provide something helpful.

@andrewg-xyz
Copy link
Contributor Author

Copy that. Might be good to have a uds list type command similar to zarf package list :)

@decleaver
Copy link
Collaborator

created a new issue for us to provide some helpful messaging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible-bug Something may not be working
Projects
None yet
Development

No branches or pull requests

2 participants