ulranh / hana_sql_exporter

hana_sql_exporter - SAP Hana SQL Exporter for Prometheus
Apache License 2.0
28 stars 11 forks source link

Can't find or decrypt password for tenant - tenant removed! #2

Closed pipinstallyogi closed 4 years ago

pipinstallyogi commented 4 years ago

I have configured all the environment, password has been successfully added to toml file as Secret, however when I am running the command:

./hana_sql_exporter web -config ../hana_sql_exporter.toml -timeout 3

The following error has been presented:

time="28-05-2020 18:17:25" level=error msg="Can't find or decrypt password for tenant - tenant removed!" error="encrypted tenant pw info does not exist" tenant=HBA

I have tried all the configuration in two systems. Kindly help.

ulranh commented 4 years ago

Did you do it in the following order?

[[Tenants]]
  Name = "t01"
  Tags = []
  ConnStr = "host1.example.com:32041"
  User = "hanaread1"

[[Metrics]]
  Name = "hdb_active_connections"
  Help = "Active Hana connections per service"
  MetricType = "gauge"
  TagFilter = []
  SchemaFilter = ["sys"]
  SQL = "select COUNT(IFNULL(C.CONNECTION_STATUS, 'IDLE')) as connections, S.service_name as service FROM <SCHEMA>.M_CONNECTIONS C inner join <SCHEMA>.M_SERVICES S on C.PORT = S.PORT WHERE C.LOGICAL_CONNECTION_ID 
= C.CONNECTION_ID AND C.OWN = 'FALSE' group by S.service_name"
pipinstallyogi commented 4 years ago

Thanks for the quick reply: I have set up the password correctly as mentioned by you. Incidentally the .toml file get automatically a Secret field after password has been provided

Secret = [10, 45, 10, 9, 115, 101, 99, 114, 101, 116, 107, 101, 121, 18, 32, 18, 76, 41, 162, 139, 129, 184, 104, 72, 54, 131, 222, 91, 24, 234, 233, 203, 146, 100, 186, 110, 20, 175, 35, 250, 24, 247, 51, 35, 251, 237, 24, 10, 59, 10, 3, 104, 99, 101, 18, 52, 86, 58, 143, 178, 195, 28, 206, 77, 147, 107, 110, 77, 219, 205, 198, 148, 247, 65, 118, 82, 4, 170, 72, 118, 171, 35, 147, 186, 201, 225, 126, 252, 105, 9, 212, 150, 25, 194, 64, 24, 158, 97, 111, 134, 63, 85, 155, 132, 25, 11, 199, 125]

[[Tenants]] Name = "HBA" Tags = [] ConnStr = "18.190.3.95:30215" User = "dbuser"

[[Metrics]] Name = "hdb_active_connections" Help = "Active Hana connections per service" MetricType = "gauge" TagFilter = [] SchemaFilter = ["sys"] SQL = "select COUNT(IFNULL(C.CONNECTION_STATUS, 'IDLE')) as connections, S.service_name as service FROM .M_CONNECTIONS C inner join .M_SERVICES S on C.PORT = S.PORT WHERE C.LOGICAL_CONNECTION_ID = C.CONNECTION_ID AND C.OWN = 'FALSE' group by S.service_name"

After this when I enter the next command to start the exporter, ./hana_sql_exporter web -config ./hana_sql_exporter.toml

I receive the error: time="29-05-2020 11:15:13" level=error msg="Can't find or decrypt password for tenant - tenant removed!" error="encrypted tenant pw info does not exist" tenant=HBA

As a matter of fact, I am successful in running the 'sapnwrfc_exporter' provided by you in another repo . Almost all the steps are same and it runs successfully.

Note: The port is Connstr is where the host open the connection.

Your help is highly appreciated.

ulranh commented 4 years ago

Can you please check, if it's an upper, lower case problem. The tenant name entry HBA in your example configfile has been written in uppercase. Did the tenant name in the password command has been written in lower case:

./hana_sql_exporter pw -config ./hana_sql_exporter.toml -tenant hba?

pipinstallyogi commented 4 years ago

Thanks a lot for the reply. I guess it was the problem related with the uppercase. I have written the tenant database name in lowercase and also when assigning providing the command for the password in lowercase. It seem to be running now. Thanks again.