Skip to content

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

Closed
hc-github-team-consul-core wants to merge 184 commits intorelease/1.17.xfrom
backport/dhiaayachi/fix_panic_policy_delete/publicly-pumped-tadpole
Closed

Backport of fix a panic in the CLI when deleting an acl policy with an unknown name into release/1.17.x#19692
hc-github-team-consul-core wants to merge 184 commits intorelease/1.17.xfrom
backport/dhiaayachi/fix_panic_policy_delete/publicly-pumped-tadpole

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.17.

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

rboyer and others added 30 commits October 13, 2023 15:32
Update version file to 1.18-dev, and replace 1.13 nightly test with
1.17.
This change adds ACL hooks to the remaining catalog and mesh resources, excluding any computed ones. Those will for now continue using the default operator:x permissions.

It refactors a lot of the common testing functions so that they can be re-used between resources.

There are also some types that we don't yet support (e.g. virtual IPs) that this change adds ACL hooks to for future-proofing.
…19187)

* NET-5073 - ProxyConfiguration: implement various connection options

* PR feedback - LocalConnection and InboundConnection do not affect exposed routes. configure L7 route destinations. fix connection proto sequence numbers.

* add timeout to L7 Route Destinations
Co-authored-by: Ronald Ekambi <ronekambi@gmail.com>
Enhance the xRoute ACL hook tests to cover tenanted situations.
These tests will only execute in enterprise.
Enhance the DestinationPolicy ACL hook tests to cover tenanted situations.
These tests will only execute in enterprise.
* typo fixes and instruction corrections

* typo

* link path correction
* Update dns-configuration.mdx

* Update website/content/docs/services/discovery/dns-configuration.mdx

Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com>
* Upgrade @hashicorp/design-system-tokens to 1.9.0

* Upgrade @hashicorp/design-system-components to 1.8.1

* Upgrade @hashicorp/design-system-components and ember-in-viewport

* Explicitly install ember-modifier@4.1.0

* rename copy-button

* Fix how cleanup is done in with-copyable

* Update aria-menu modifier for new structure

* Update css-prop modifier to new structure

* Convert did-upsert to regular class modifier

* Update notification modifier for new structure

* Update on-oustside modifier for new structure

* Move destroy handler registration in with-copyable

* Update style modifier for new structure

* Update validate modifier for new structure

* Guard against setting on destroyed object

* Upgrade @hashicorp/design-system-components to 2.14.1

* Remove debugger

* Guard against null in aria-menu

* Fix undefined hash in validate addon

* Upgrade ember-on-resize-modifier

* Fix copy button import, missing import and array destructuring

---------

Co-authored-by: wenincode <tyler.wendlandt@hashicorp.com>
CE changes for multiple virtual hosts
…#19119)

* NET-5592 - update Nomad integration testing

* NET-4893: Ensure we're testing all the latest versions of Vault/Nomad
The control-plane-request-limit config entry does not support
specifying parameter names in snake case format.

This commit updates the HCL and JSON examples to use the supported
camel case key format.
When testing adding http probes to apps, I ran into some issues which I fixed here:
- The listener should be listening on the exposed listener port, updated that.
- The listener and route names were pointing to the path of the exposed path. In my test, the path was "/" resulting in an empty string path. Also, the path may not be unique across exposed path listeners, so I decided to use the path+exposed port as the unique identifier.
* Add sentence

* link text adjustment
* Update configure.mdx

Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com>
Ensure LB policy set for locality-aware routing (CE)

`overprovisioningFactor` should be overridden with the expected value
(100,000) when there are multiple endpoint groups. Update code and
tests to enforce this.

This is an Enterprise feature. This commit represents the CE portions of
the change; tests are added in the corresponding `consul-enterprise`
change.
* fix: allow snake case keys for ip based rate limit config entry

* chore: add changelog
@hc-github-team-consul-core hc-github-team-consul-core requested a review from a team November 20, 2023 14:48
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/dhiaayachi/fix_panic_policy_delete/publicly-pumped-tadpole branch from e9f77a3 to 51954d5 Compare November 20, 2023 14:48
@hc-github-team-consul-core hc-github-team-consul-core requested review from marianoasselborn and randyhdev and removed request for a team November 20, 2023 14:48
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/dhiaayachi/fix_panic_policy_delete/publicly-pumped-tadpole branch 2 times, most recently from adf8e2c to c433c99 Compare November 20, 2023 14:48
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

@github-actions github-actions bot added type/docs Documentation needs to be created/updated/clarified theme/api Relating to the HTTP API interface theme/acls ACL and token generation theme/cli Flags and documentation for the CLI interface theme/config Relating to Consul Agent configuration, including reloading theme/ui Anything related to the UI theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies theme/tls Using TLS (Transport Layer Security) or mTLS (mutual TLS) to secure communication type/ci Relating to continuous integration (CI) tooling for testing or releases pr/dependencies PR specifically updates dependencies of project theme/envoy/xds Related to Envoy support theme/contributing Additions and enhancements to community contributing materials theme/certificates Related to creating, distributing, and rotating certificates in Consul labels Nov 20, 2023
@dhiaayachi dhiaayachi disabled auto-merge November 20, 2023 14:50
@dhiaayachi dhiaayachi closed this Nov 20, 2023
@github-actions github-actions bot deleted the backport/dhiaayachi/fix_panic_policy_delete/publicly-pumped-tadpole branch August 29, 2025 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr/dependencies PR specifically updates dependencies of project theme/acls ACL and token generation theme/api Relating to the HTTP API interface theme/certificates Related to creating, distributing, and rotating certificates in Consul theme/cli Flags and documentation for the CLI interface theme/config Relating to Consul Agent configuration, including reloading theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies theme/contributing Additions and enhancements to community contributing materials theme/envoy/xds Related to Envoy support theme/tls Using TLS (Transport Layer Security) or mTLS (mutual TLS) to secure communication theme/ui Anything related to the UI type/ci Relating to continuous integration (CI) tooling for testing or releases type/docs Documentation needs to be created/updated/clarified

Projects

None yet

Development

Successfully merging this pull request may close these issues.