Skip to content

Backport of fix a panic in the CLI when deleting an acl policy with an unknown name into release/1.16.x#19691

Merged
hc-github-team-consul-core merged 2 commits intorelease/1.16.xfrom
backport/dhiaayachi/fix_panic_policy_delete/urgently-eternal-mastodon
Nov 20, 2023
Merged

Backport of fix a panic in the CLI when deleting an acl policy with an unknown name into release/1.16.x#19691
hc-github-team-consul-core merged 2 commits intorelease/1.16.xfrom
backport/dhiaayachi/fix_panic_policy_delete/urgently-eternal-mastodon

Conversation

@hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #19679 to be assessed for backporting due to the inclusion of the label backport/1.16.

The below text is copied from the body of the original PR.


Description

This fix a panic in the CLI when deleting a policy using its name and that name do not exist on the server.

consul acl policy delete -namespace david-test -datacenter us-east-infra -name namespace-management

panic: runtime error: invalid memory address or nil pointer dereference

[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1012db5]




goroutine 1 [running]:

github.com/hashicorp/consul/command/acl.GetPolicyIDByName(...)

/Users/dayachi/git/consul-enterprise/command/acl/acl_helpers.go:102

github.com/hashicorp/consul/command/acl/policy/delete.(*cmd).Run(0xc000d62050, {0xc000072180?, 0xffffffffffffffff?, 0x0?})

/Users/dayachi/git/consul-enterprise/command/acl/policy/delete/policy_delete.go:62 +0x155

github.com/mitchellh/cli.(*CLI).Run(0xc000fa3400)

/Users/dayachi/go/pkg/mod/github.com/mitchellh/cli@v1.1.5/cli.go:262 +0x5b8

main.realMain()

/Users/dayachi/git/consul-enterprise/main.go:48 +0x469

main.main()

/Users/dayachi/git/consul-enterprise/main.go:18 +0x13

root@hashi-i-0cb3233c55d0fe848:/opt/consul/1.15.6+debug# consul version

Consul v1.15.6+ent

Revision ba04dc46b8+CHANGES

Build Date 2023-09-19T23:47:29Z

Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/dhiaayachi/fix_panic_policy_delete/urgently-eternal-mastodon branch from 3a455d1 to fd74f36 Compare November 20, 2023 14:48
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/dhiaayachi/fix_panic_policy_delete/urgently-eternal-mastodon branch 2 times, most recently from 257e7da to ae17be0 Compare November 20, 2023 14:48
@github-actions github-actions bot added the theme/cli Flags and documentation for the CLI interface label Nov 20, 2023
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved Consul Bot automated PR

@vercel vercel bot temporarily deployed to Preview – consul November 20, 2023 14:53 Inactive
@hc-github-team-consul-core hc-github-team-consul-core merged commit 0bba440 into release/1.16.x Nov 20, 2023
@hc-github-team-consul-core hc-github-team-consul-core deleted the backport/dhiaayachi/fix_panic_policy_delete/urgently-eternal-mastodon branch November 20, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme/cli Flags and documentation for the CLI interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants