oracledb_exporter
oracledb_exporter copied to clipboard
DATA_SOURCE_NAME EnvVar unparseable if password contains hash/pound/# symbol
I'm submitting a ...
- [x] bug report
- [ ] feature request
What is the current behavior?
Binary starts and throws an error "invalid port \":XxXxX\" after host" if password in URI string contains # symbol.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
$ export DATA_SOURCE_NAME=oracle://user:PaSs#wOrd@testora:1521/TEST1
$ echo $DATA_SOURCE_NAME
oracle://user:PaSs#wOrd@testora:1521/TEST1
$ /usr/local/bin/oracledb_exporter-0.5.2 --default.metrics "/etc/oracledb_exporter/default-metrics.toml" --log.level debug --web.listen-address 0.0.0.0:9161
ts=2023-11-21T22:36:57.951Z caller=collector.go:327 level=debug launchingconnection:=***@testora:1521/TEST1
ts=2023-11-21T22:36:57.951Z caller=collector.go:333 level=debug setmaxidleconnectionsto=0
ts=2023-11-21T22:36:57.951Z caller=collector.go:335 level=debug setmaxopenconnectionsto=10
ts=2023-11-21T22:36:57.951Z caller=collector.go:337 level=debug successfullyconnectedto:=***@testora:1521/TEST1
ts=2023-11-21T22:36:57.951Z caller=collector.go:262 level=error errorpingingoracle:="parse \"oracle://user:PaSs\": invalid port \":PaSs\" after host"
What is the expected behavior?
Parse URI correctly: port=1521, password=PaSs#wOrd
What is the motivation / use case for changing the behavior?
Fix it
Please tell us about your environment:
Oracle Linux 8.8 5.4.17-2136.324.5.3.el7uek.x86_64 Version: 0.5.1, 0.5.2-rc
Same problem ... i have problem with "#" in username as i'm connecting with a CDB User C## ...
The value is directly passed down to url.Parse (and treated as a URL).
Replacing "#" with its url encoded equivalent should fix the problem (i.e replace the # in your connection string with %23)