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

0.27.0 crashing after startup #1565

Closed
aa-matthias opened this issue Aug 12, 2024 · 8 comments · Fixed by #1570
Closed

0.27.0 crashing after startup #1565

aa-matthias opened this issue Aug 12, 2024 · 8 comments · Fixed by #1570
Labels

Comments

@aa-matthias
Copy link

Current Behavior

After updating to 0.27.0 windows_exporter service keeps crashing.

Expected Behavior

Should run just fine

Steps To Reproduce

No response

Environment

  • windows_exporter Version: 0.27.0
  • Windows Server Version: 2019

windows_exporter logs

Der Dienst "windows_exporter" wurde unerwartet beendet. Dies ist bereits 1 Mal vorgekommen. Folgende Korrekturmaßnahmen werden in 60000 Millisekunden durchgeführt: Neustart des Diensts.

Anything else?

No response

@cmallory183
Copy link

Mine failed as well with an error pointing to the mssql collector. The event log did not show the details but if you start it from the command line with the same options as defined in the service and add --log.level=debug, it showed the error about the mssql collector and a nil pointer dereference.
This was on Windows Server 2012 R2 with SQL Server 2017. Rolling back to v0.26.2 works fine.

@jkroepke
Copy link
Member

jkroepke commented Aug 13, 2024

I need the error log. (from event log). Otherwise, I'm unable to provide support.

@cmallory183
Copy link

cmallory183 commented Aug 13, 2024

I set the --log.file to stderr and got the following:

PS C:\Program Files\windows_exporter> .\windows_exporter.exe --log.file stderr --config.file="c:\monitoring\windows_exporter\windows_exporter.yml" --config.file.insecure-skip-verify --log.level=debug
ts=2024-08-13T17:37:53.350Z caller=exporter.go:147 level=debug msg="Logging has Started"
ts=2024-08-13T17:37:53.351Z caller=config.go:75 level=info msg="Loading configuration file: c:\\monitoring\\windows_exporter\\windows_exporter.yml"
ts=2024-08-13T17:37:53.355Z caller=wmi.go:16 level=debug msg="Initializing SWbemServices"
ts=2024-08-13T17:37:53.393Z caller=iis.go:925 level=debug collector=iis msg="Detected IIS 8.5\n"
ts=2024-08-13T17:37:53.396Z caller=service.go:102 level=warn collector=service msg="No where-clause specified for service collector. This will generate a very large number of metrics!"
ts=2024-08-13T17:37:53.399Z caller=mssql.go:81 level=debug collector=mssql msg="Detected MSSQL Instances: mssql.mssqlInstancesType{\"MSSQLSERVER\":\"MSSQL14.MSSQLSERVER\"}\n"
ts=2024-08-13T17:37:53.671Z caller=exporter.go:222 level=info msg="Running as #########"
ts=2024-08-13T17:37:53.672Z caller=exporter.go:229 level=info msg="Enabled collectors: memory, process, cpu, cpu_info, physical_disk, cs, mssql, os, system, diskdrive, logical_disk, iis, net, service"
ts=2024-08-13T17:37:53.674Z caller=exporter.go:264 level=info msg="Starting windows_exporter" version="(version=0.27.0, branch=HEAD, revision=ca4ad46e2df498e0317d09bc2c037922cd879898)"
ts=2024-08-13T17:37:53.676Z caller=exporter.go:265 level=info msg="Build context" build_context="(go=go1.22.6, platform=windows/amd64, user=runneradmin@fv-az1495-484, date=20240811-13:54:18, tags=unknown)"
ts=2024-08-13T17:37:53.678Z caller=exporter.go:266 level=debug msg="Go MAXPROCS" procs=16
ts=2024-08-13T17:37:53.681Z caller=tls_config.go:313 level=info msg="Listening on" address=[::]:9182
ts=2024-08-13T17:37:53.682Z caller=tls_config.go:316 level=info msg="TLS is disabled." http2=false address=[::]:9182
ts=2024-08-13T17:38:18.715Z caller=prometheus.go:189 level=debug msg="collector memory succeeded after 0.000000s."
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x97fa2b]

goroutine 83 [running]:
github.com/prometheus-community/windows_exporter/pkg/collector/mssql.(*Collector).execute(0xc000249008, 0xc00038e0b0, {0xc000048e00, 0x75}, 0x0, 0xc00004a480, {0xc00039bbb0, 0xb}, 0x0?)
        D:/a/windows_exporter/windows_exporter/pkg/collector/mssql/mssql.go:1979 +0xcb
created by github.com/prometheus-community/windows_exporter/pkg/collector/mssql.(*Collector).Collect in goroutine 67
        D:/a/windows_exporter/windows_exporter/pkg/collector/mssql/mssql.go:2020 +0x1dc
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x97fa2b]

goroutine 82 [running]:
github.com/prometheus-community/windows_exporter/pkg/collector/mssql.(*Collector).execute(0xc000249008, 0xc00038e0b0, {0x0, 0x0}, 0x0, 0xc00004a480, {0xc00039bbb0, 0xb}, 0xc000098ff0?)
        D:/a/windows_exporter/windows_exporter/pkg/collector/mssql/mssql.go:1979 +0xcb
created by github.com/prometheus-community/windows_exporter/pkg/collector/mssql.(*Collector).Collect in goroutine 67
        D:/a/windows_exporter/windows_exporter/pkg/collector/mssql/mssql.go:2020 +0x1dc
PS C:\Program Files\windows_exporter>

Here is my config file:

---
collectors:
  enabled: cpu,cpu_info,cs,diskdrive,logical_disk,iis,memory,mssql,net,os,physical_disk,process,service,system
  collector:
    mssql:
      classes-enabled:
        - accessmethods
        - availreplica
        - bufman
        - databases
        - dbreplica
        - genstats
        - locks
        - memmgr
        - sqlstats
        - sqlerrors
        - transactions
        - waitstats
scrape:
  timeout-margin: 0.5
telemetry:
  path: /metrics
  max-requests: 5
web:
  listen-address: ":9182"
process:
  priority: normal

@jkroepke
Copy link
Member

Okay, thats fair. I cleanup the configuration interface under the hood, but I never test yaml files as configuration source. I will look into it.

@jkroepke
Copy link
Member

Could you please check, if https://github.com/prometheus-community/windows_exporter/actions/runs/10376982647/artifacts/1808559184 solves the issue?

@aa-matthias
Copy link
Author

working for me, thanks!

@jkroepke
Copy link
Member

Released as 0.27.1

@cmallory183
Copy link

Issue appears to be resolved. MSSQL collector is functioning normal again. Thank you

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

Successfully merging a pull request may close this issue.

3 participants