grafana machine charm is not handling boolean config for ldap

Bug #1975622 reported by Erik Lönroth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Grafana Charm
Fix Released
High
Alvaro Uria

Bug Description

Charm: grafana
Store: charmhub
Channel: stable
Revision: 56
Series: ubuntu/focal

https://discourse.charmhub.io/t/grafana-machine-charm-is-not-handling-boolean-config-for-ldap/6455

I’m configuring grafana with a yaml like this to connect it to the company LDAP where I configure using a boolean value for start_tls (among other things):

cat grafana-config.yaml
grafana:
  ...
  ...
  ldap_config_flags: "{start_tls: false}"

I’m then configuring grafana:

    juju config grafana --file grafana-config.yaml

It all seems to be OK, but, in the resulting config on the grafana/0 unit:

    juju ssh grafana/0 sudo cat /etc/grafana/ldap.toml
    [[servers]]
    host = "example.com"
    port = 363
    start_tls = "False"

Which causes an error for grafana since “False” is a string, where the value should be a false (boolean)

   juju ssh grafana/0 sudo tail /var/log/grafana/grafana.log

logger=ldap t=2022-05-24T17:35:22.34+0000 lvl=info msg="LDAP enabled, reading config file" file=/etc/grafana/ldap.toml
logger=context traceID=00000000000000000000000000000000 userId=0 orgId=0 uname= t=2022-05-24T17:35:22.34+0000 lvl=eror msg="Error while trying to authenticate user" error="Failed to get LDAP config: Failed to load LDAP config file: toml: cannot load TOML value of type string into a Go boolean" remote_addr=10.201.46.102 traceID=00000000000000000000000000000000

Clearly, this is an error which prevents me from deploying this with LDAP connection.

I’m following the docs from https://charmhub.io/grafana

Tags: bseng-131

Related branches

Alvaro Uria (aluria)
Changed in charm-grafana:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Alvaro Uria (aluria)
Alvaro Uria (aluria)
Changed in charm-grafana:
status: Confirmed → In Progress
Alvaro Uria (aluria)
tags: added: bseng-131
Alvaro Uria (aluria)
Changed in charm-grafana:
status: In Progress → Fix Committed
Changed in charm-grafana:
milestone: none → 21.10
milestone: 21.10 → 22.10
Changed in charm-grafana:
status: Fix Committed → Fix Released
Changed in charm-grafana:
status: Fix Released → Fix Committed
Changed in charm-grafana:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.