Fails trying to add existing row to database
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Grafana Charm |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
The grafana charm fails trying to insert a row that already exists:
2018-02-24 00:34:03 INFO juju-log Invoking reactive handler: reactive/
2018-02-24 00:34:04 INFO juju-log Found datasource: {'type': 'prometheus',
'description': 'Juju generated source', 'service_name': 'prometheus',
'url': 'http://
2018-02-24 00:34:04 INFO juju-log Adding new datasource: prometheus - Juju generated source
2018-02-24 00:34:04 INFO juju-log Statement is:
INSERT INTO DATA_SOURCE (org_id, version, type, name, access, url, is_default, created, updated, basic_auth)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2018-02-24 00:34:04 INFO juju-log [1, 0, 'prometheus', 'prometheus - Juju generated source', 'proxy',
'http://
2018-02-24 00:34:04 INFO config-changed Traceback (most recent call last):
2018-02-24 00:34:04 INFO config-changed File "/var/lib/
2018-02-24 00:34:04 INFO config-changed main()
2018-02-24 00:34:04 INFO config-changed File "/usr/local/
2018-02-24 00:34:04 INFO config-changed bus.dispatch(
2018-02-24 00:34:04 INFO config-changed File "/usr/local/
2018-02-24 00:34:04 INFO config-changed _invoke(
2018-02-24 00:34:04 INFO config-changed File "/usr/local/
2018-02-24 00:34:04 INFO config-changed handler.invoke()
2018-02-24 00:34:04 INFO config-changed File "/usr/local/
2018-02-24 00:34:04 INFO config-changed self._action(*args)
2018-02-24 00:34:04 INFO config-changed File "/var/lib/
2018-02-24 00:34:04 INFO config-changed check_datasourc
2018-02-24 00:34:04 INFO config-changed File "/var/lib/
2018-02-24 00:34:04 INFO config-changed cur.execute(stmt, values)
2018-02-24 00:34:04 INFO config-changed sqlite3.
2018-02-24 00:34:04 ERROR juju.worker.
description: | updated |
Changed in charm-grafana: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in charm-grafana: | |
status: | Confirmed → Won't Fix |
There is indeed a duplicate row - what I found is that the address for prometheus had changed from IP address to name, and because the entire row doesn't match the charm tries to add a fresh row with the same id.
cur.execute('DELETE from DATA_SOURCE where url="http:// n.n.n.n: 9090"')