You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using an older version (e.g. 0.41.0) with the same arguments results in an error that logs the mongodb connection string.
Are passwords with special characters even supported?
To Reproduce
($PASSWORDS contains special characters, in my tests I used ? and !)
Start the exporter with the following arguments: mongodb_exporter --mongodb.uri "mongodb://localhost:27017/?authSource=admin" --mongodb.user $USER --mongodb.password $PASSWORD
Describe the bug
When starting the exporter (from version 0.42.0 on) and providing a password that contains special characters the exporter crashes during the call here:
https://github.com/percona/mongodb_exporter/blob/v0.42.0/main.go#L147
Using an older version (e.g. 0.41.0) with the same arguments results in an error that logs the mongodb connection string.
Are passwords with special characters even supported?
To Reproduce
($PASSWORDS contains special characters, in my tests I used ? and !)
Expected behavior
I expect it not to crash.
Logs
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xcea293]
goroutine 1 [running]:
net/url.(*URL).Port(...)
/opt/bitnami/go/src/net/url/url.go:1196
main.buildExporter({{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0xc0006026f0, 0x1, ...}, ...}, ...)
/bitnami/blacksmith-sandox/mongodb-exporter-0.42.0/src/github.com/percona/mongodb_exporter/main.go:147 +0xd3
main.buildServers({{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0xc0006026f0, 0x1, ...}, ...}, ...)
/bitnami/blacksmith-sandox/mongodb-exporter-0.42.0/src/github.com/percona/mongodb_exporter/main.go:197 +0x105
main.main()
/bitnami/blacksmith-sandox/mongodb-exporter-0.42.0/src/github.com/percona/mongodb_exporter/main.go:138 +0x725
Environment
Additional context
The text was updated successfully, but these errors were encountered: