AMS unit ended up to error status when specifying the prometheus_extra_labels config item

Bug #2105468 reported by Gary.Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Anbox Cloud
Fix Released
Medium
Gary.Wang

Bug Description

When deploying the ams with the
```
 prometheus_extra_labels: region=subcluster-1
```

config item, we saw the following error from the ams/0 unit
```
File "/var/lib/juju/agents/unit-ams-0/charm/./src/charm.py", line 546, in _on_config_changed
    self.ams.configure(cfg)
  File "/var/lib/juju/agents/unit-ams-0/charm/src/ams.py", line 231, in configure
    rendered_content = template.render(content)
  File "/var/lib/juju/agents/unit-ams-0/charm/venv/jinja2/environment.py", line 1295, in render
    self.environment.handle_exception()
  File "/var/lib/juju/agents/unit-ams-0/charm/venv/jinja2/environment.py", line 942, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "templates/settings.yaml.j2", line 32, in top-level template code
    {%- for key, value in metrics.extra_labels.items() %}
  File "/var/lib/juju/agents/unit-ams-0/charm/venv/jinja2/utils.py", line 92, in from_obj
    if hasattr(obj, "jinja_pass_arg"):
jinja2.exceptions.UndefinedError: 'str object' has no attribute 'items'
2025-03-29 07:40:05 ERROR juju.worker.uniter.operation runhook.go:180 hook "etcd-relation-changed" (via hook dispatching script: dispatch) failed: exit status 1
```

Gary.Wang (gary-wzl77)
Changed in anbox-cloud:
status: In Progress → Fix Committed
Gary.Wang (gary-wzl77)
summary: - AMS unit ended up to error statu when specifying the
+ AMS unit ended up to error status when specifying the
prometheus_extra_labels config item
Changed in anbox-cloud:
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.