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

Crash SIGSEGV from vault.(*PolicyStore).getACLView when fetching metrics #26415

Open
ebuildy opened this issue Apr 15, 2024 · 0 comments
Open
Labels
bug Used to indicate a potential bug core/policy

Comments

@ebuildy
Copy link
Contributor

ebuildy commented Apr 15, 2024

Describe the bug

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x3410a44]
failed to find message
goroutine 13121591 [running]:
github.com/hashicorp/vault/vault.(*PolicyStore).getACLView(...)
	/home/runner/work/vault/vault/vault/policy_store_util.go:23
github.com/hashicorp/vault/vault.(*PolicyStore).policiesByNamespace(0x10fc6830?, {0xb8c5270?, 0xc01d05f0b0?}, 0x8422760?, 0x10ff06e0?)
	/home/runner/work/vault/vault/vault/policy_store.go:688 +0x24
github.com/hashicorp/vault/vault.(*PolicyStore).policiesByNamespaces(0xb8c5318?, {0xb8c5270, 0xc01d05f0b0}, 0x1d55ce00?, {0xc01d55ce20, 0x1, 0xc01b8da1e0?})
	/home/runner/work/vault/vault/vault/policy_store.go:722 +0xf6
github.com/hashicorp/vault/vault.(*Core).configuredPoliciesGaugeCollector(0xc003454800, {0xb8c5318, 0xc01bbc61c0})
	/home/runner/work/vault/vault/vault/core_metrics.go:596 +0x193
github.com/hashicorp/vault/helper/metricsutil.(*GaugeCollectionProcess).collectAndFilterGauges(0xc01de41e00)
	/home/runner/work/vault/vault/helper/metricsutil/gauge_process.go:186 +0x155
github.com/hashicorp/vault/helper/metricsutil.(*GaugeCollectionProcess).Run(0xc01de41e00)
	/home/runner/work/vault/vault/helper/metricsutil/gauge_process.go:270 +0x8a
created by github.com/hashicorp/vault/vault.(*Core).emitMetricsActiveNode in goroutine 13121571
	/home/runner/work/vault/vault/vault/core_metrics.go:335 +0xdf6

To Reproduce

Dont find how to reproduce it, vault runs during a few days then crash.

Expected behavior
Dont crash

Environment:

  • Vault Server Version (retrieve with vault status): 1.15.4
  • Vault CLI Version (retrieve with vault version): 1.15.4
  • Server Operating System/Architecture: Azure Kubernetes Service, official Helm chart
  • Backend: mysql

Vault server configuration file(s):

ui = true
disable_mlock = true
default_lease_ttl = "24h"
max_lease_ttl = "24h"

listener "tcp" {
  tls_disable = "true"
  address = "[::]:8200"
  cluster_address = "[::]:8201"
  # Enable unauthenticated metrics access (necessary for Prometheus Operator)
  telemetry {
    unauthenticated_metrics_access = true
  }
}
storage "mysql" {
  address = "XXXX.mysql.database.azure.com"
  database = "vault"
  username = "XXXX"
  password = "XXXXX"
  tls_ca_file = "/trust-bundles/all/trust-bundle.pem"
  ha_enabled = "true"
}

service_registration "kubernetes" {}

telemetry {
  prometheus_retention_time = "74h"
  disable_hostname = true
}

Additional context
Add any other context about the problem here.

@hsimon-hashicorp hsimon-hashicorp added bug Used to indicate a potential bug core/policy labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug core/policy
Projects
None yet
Development

No branches or pull requests

2 participants