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

Memory leak and panic in smbclient with 0.29.2 #1808

Open
dluxem opened this issue Dec 6, 2024 · 1 comment
Open

Memory leak and panic in smbclient with 0.29.2 #1808

dluxem opened this issue Dec 6, 2024 · 1 comment
Labels

Comments

@dluxem
Copy link

dluxem commented Dec 6, 2024

Current Behavior

After adding smbclient to our enabled collectors list, we noticed what appears to be a memory leak in the windows_exporter with version 0.29.2. Memory had been stable with this service until adding the smbclient connector. After removing the collector, it remains stable again.

Further more, we have some errors in the logs which may or may not be related:
panic in collector smbclient" panic="runtime error: index out of range [1] with length 1

image

Expected Behavior

When enabling the smbclient connector, I expect the memory usage to remain stable.

Steps To Reproduce

Running with this `config.yml`:

---
collectors:
  enabled: cpu,cpu_info,diskdrive,logical_disk,physical_disk,net,os,service,system,memory,scheduled_task,process,time,license,logon,update,iis,smbclient

collector:
  service:
    include:
      (IISADMIN|Spooler|W3SVC|adfssrv).*
  scheduled_task:
    exclude: (\/Microsoft\/.+|\/User_Feed_.+|\/Optimize Start Menu Cache Files.+|\/zzz\/Persistent zzz.+|\/Mozilla\/.+|\/GoogleUpdateTask.+|\/GoogleSystem\/.+|\/MicrosoftEdgeUpdate.+)
  process:
    iis: false
    include:
      (filebeat|Microsoft.IdentityServer.ServiceHost|FileSyncSvc|spoolsv|MonAgentCore|MonAgentHost|MonAgentLauncher|MonAgentManager).*
log:
  level: info
  file: C:\Program Files\windows_exporter\windows_exporter.log
telemetry:
  path: /metrics
  max-requests: 5
web:
  listen-address: ":9182"


### Environment

- windows_exporter Version: 0.29.2
- Windows Server Version: 2016 (1607 build 14393.7428)


### windows_exporter logs

```shell
ts=2024-11-15T13:35:12.725-06:00 level=warn caller=os.go:113 msg="The os collect holds a number of deprecated metrics and will be removed mid 2025. See https://github.com/prometheus-community/windows_exporter/pull/1596 for more information."
ts=2024-11-15T13:35:12.813-06:00 level=info caller=exporter.go:309 msg="Running as NT AUTHORITY\\SYSTEM"
ts=2024-11-15T13:35:12.813-06:00 level=info caller=exporter.go:218 msg="Enabled collectors: cpu, physical_disk, os, process, license, logon, iis, cpu_info, diskdrive, logical_disk, net, smbclient, update, memory, service, system, scheduled_task, time"
ts=2024-11-15T13:35:12.813-06:00 level=info caller=exporter.go:241 msg="Starting windows_exporter" version=0.29.2 branch=HEAD revision=622813343f930c121c8b1c061d6dd6f02d96015f goversion=go1.23.2 builddate=20241011-14:21:36 maxprocs=12
ts=2024-11-15T13:35:12.816-06:00 level=info caller=tls_config.go:347 msg="Listening on" address=[::]:9182
ts=2024-11-15T13:35:12.816-06:00 level=info caller=tls_config.go:350 msg="TLS is disabled." http2=false address=[::]:9182
ts=2024-11-15T13:35:18.725-06:00 level=error caller=prometheus.go:188 msg="panic in collector smbclient" panic="runtime error: index out of range [1] with length 1"
ts=2024-11-15T13:35:42.735-06:00 level=warn caller=prometheus.go:256 msg="collector smbclient timeouted after 24s, resulting in 0 metrics"
ts=2024-11-15T13:35:48.705-06:00 level=error caller=prometheus.go:188 msg="panic in collector smbclient" panic="runtime error: index out of range [1] with length 1"
ts=2024-11-15T13:36:12.707-06:00 level=warn caller=prometheus.go:256 msg="collector smbclient timeouted after 24s, resulting in 0 metrics"
ts=2024-11-15T13:36:18.745-06:00 level=error caller=prometheus.go:188 msg="panic in collector smbclient" panic="runtime error: index out of range [1] with length 1"
ts=2024-11-15T13:36:42.738-06:00 level=warn caller=prometheus.go:256 msg="collector smbclient timeouted after 24s, resulting in 0 metrics"
ts=2024-11-15T13:36:48.801-06:00 level=error caller=prometheus.go:188 msg="panic in collector smbclient" panic="runtime error: index out of range [1] with length 1"
ts=2024-11-15T13:37:12.821-06:00 level=warn caller=prometheus.go:256 msg="collector smbclient timeouted after 24s, resulting in 0 metrics"
ts=2024-11-15T13:37:18.960-06:00 level=error caller=prometheus.go:188 msg="panic in collector smbclient" panic="runtime error: index out of range [1] with length 1"
ts=2024-11-15T13:37:42.956-06:00 level=warn caller=prometheus.go:256 msg="collector smbclient timeouted after 24s, resulting in 0 metrics"
ts=2024-11-15T13:37:49.088-06:00 level=error caller=prometheus.go:188 msg="panic in collector smbclient" panic="runtime error: index out of range [1] with length 1"
ts=2024-11-15T13:38:13.071-06:00 level=warn caller=prometheus.go:256 msg="collector smbclient timeouted after 24s, resulting in 0 metrics"
ts=2024-11-15T13:38:19.165-06:00 level=error caller=prometheus.go:188 msg="panic in collector smbclient" panic="runtime error: index out of range [1] with length 1"
ts=2024-11-15T13:38:43.133-06:00 level=warn caller=prometheus.go:256 msg="collector smbclient timeouted after 24s, resulting in 0 metrics"
ts=2024-11-15T13:38:48.696-06:00 level=error caller=prometheus.go:188 msg="panic in collector smbclient" panic="runtime error: index out of range [1] with length 1"
ts=2024-11-15T13:39:12.705-06:00 level=warn caller=prometheus.go:256 msg="collector smbclient timeouted after 24s, resulting in 0 metrics"
ts=2024-11-15T13:39:18.803-06:00 level=error caller=prometheus.go:188 msg="panic in collector smbclient" panic="runtime error: index out of range [1] with length 1"
ts=2024-11-15T13:39:42.803-06:00 level=warn caller=prometheus.go:256 msg="collector smbclient timeouted after 24s, resulting in 0 metrics"
ts=2024-11-15T13:39:48.913-06:00 level=error caller=prometheus.go:188 msg="panic in collector smbclient" panic="runtime error: index out of range [1] with length 1"
ts=2024-11-15T13:40:12.915-06:00 level=warn caller=prometheus.go:256 msg="collector smbclient timeouted after 24s, resulting in 0 metrics"
ts=2024-11-15T13:40:18.693-06:00 level=error caller=prometheus.go:188 msg="panic in collector smbclient" panic="runtime error: index out of range [1] with length 1"
ts=2024-11-15T13:40:42.698-06:00 level=warn caller=prometheus.go:256 msg="collector smbclient timeouted after 24s, resulting in 0 metrics"
ts=2024-11-15T13:40:48.701-06:00 level=error caller=prometheus.go:188 msg="panic in collector smbclient" panic="runtime error: index out of range [1] with length 1"
ts=2024-11-15T13:41:12.703-06:00 level=warn caller=prometheus.go:256 msg="collector smbclient timeouted after 24s, resulting in 0 metrics"
ts=2024-11-15T13:41:18.706-06:00 level=error caller=prometheus.go:188 msg="panic in collector smbclient" panic="runtime error: index out of range [1] with length 1"
ts=2024-11-15T13:41:42.706-06:00 level=warn caller=prometheus.go:256 msg="collector smbclient timeouted after 24s, resulting in 0 metrics"

Anything else?

No response

@dluxem dluxem added the 🐞 bug label Dec 6, 2024
@jkroepke
Copy link
Member

jkroepke commented Dec 6, 2024

Try out 0.30.0-rc.2 first

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

No branches or pull requests

2 participants