oracledb_exporter icon indicating copy to clipboard operation
oracledb_exporter copied to clipboard

error Errorpingingoracle:="address c: missing port in address"

Open yu-dot-code opened this issue 1 year ago • 11 comments

I run oracledb_exporter to report an error,How to solve it?

  • run: DATA_SOURCE_NAME='oracle://c##exporter:ora@[email protected]:1521/cms1' ./oracledb_exporter --default.metrics "/oracle/oracledb_exporter-0.5.1.linux-amd64/default-metrics.toml" --web.listen-address 0.0.0.0:9161

  • error: caller=collector.go:262 level=error Errorpingingoracle:="address c: missing port in address"

What is the current behavior?

yu-dot-code avatar Jul 18 '23 09:07 yu-dot-code

oracle版本: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production PL/SQL Release 11.2.0.1.0 - Production CORE 11.2.0.1.0 Production TNS for Linux: Version 11.2.0.1.0 - Production NLSRTL Version 11.2.0.1.0 - Production

配置: export DATA_SOURCE_NAME=oracle://system:[email protected]:1521/orcl 问题: ts=2023-07-20T04:16:41.049Z caller=collector.go:262 level=error Errorpingingoracle:="missing port in address"

遇到了一样的问题解决了吗

woniusnai avatar Jul 20 '23 05:07 woniusnai

export DATA_SOURCE_NAME=oracle://system:[email protected]:1521/orcl 将这个变量添加到/etc/profile 或者用户的.bash_profile中即可解决上述问题。 或者 vim /usr/lib/systemd/system/oracledb_exporter.service ... 启用环境变量 Environment="DATA_SOURCE_NAME=oracle://system:[email protected]:1521/orcl" ...

woniusnai avatar Jul 21 '23 05:07 woniusnai

https://github.com/iamseth/oracledb_exporter/issues/345#issuecomment-1651987462

Neurozone avatar Jul 26 '23 15:07 Neurozone

I have the same problem like original submitter, i.e. I get an error: address c: missing port in address but only when I connect using Oracle common user (i.e. user which name starts with "c##..." It seems like first "#" terminates the string and I can't figure out how to escape this :(

EDIT: I've made some tests and older versions (i.e. those using go-oci8 and instant client) - work fine. The problem is with newer versions which use pure Go client (go-ora)

wes-pro avatar Aug 13 '23 21:08 wes-pro

修改上述的的环境变量也不行吗?参考https://github.com/iamseth/oracledb_exporter/issues/352#issuecomment-1645008849

woniusnai avatar Aug 14 '23 00:08 woniusnai

This is also reproducible from my side: version 0.5.1 -> C##APP_PROMETHEUS user connection fails with "address c: missing port in address" version 0.4.3 -> C##APP_PROMETHEUS user can connect.

Please note that these user names are not some funny naming schema from my weird brain, but they are part of Oracles CDB/PDB architecture: Oracle common User Accounts

KayHude avatar Aug 17 '23 07:08 KayHude

我的问题解决结果是:用户名中'#'要使用转义,换成'%23'就好了

yu-dot-code avatar Aug 24 '23 07:08 yu-dot-code

I get this error too, connecting as dbsnmp, with 0.5.0 and 0.5.1, but working with 0.4.3.

FedeHAL avatar Sep 12 '23 12:09 FedeHAL

I am getting the same DATA_SOURCE_NAME="user/password@hostname:1521/dbname"

perkons avatar Sep 15 '23 09:09 perkons

Use format DATA_SOURCE_NAME=oracle://user:[email protected]:1521/dbname it is working for me

bomuva avatar Oct 26 '23 14:10 bomuva

Have the same issue. Not working when username is CDB C##... Also i'm trying to configure as Environment="DATA_SOURCE_NAME=...." in systemd service file and no combination works... i've tryied "%%23%%23" with no luck.

Switching down to previous version

ToMMy86 avatar Nov 22 '23 17:11 ToMMy86