Skip to content

Enviroment Provider Fails on Special Characters #87858

Open
@iveelsm

Description

@iveelsm

What happened?

When using the env provider ($__env{EXAMPLE}) the resulting value is incorrectly parsed when some special characters are in use, namely: # and ;. This is highlighted in the database configuration as causing potential problems here:

# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""

I attempted with both:

password: $__env{ENV_PASSWORD}

and a triple quote:

password: """$__env{ENV_PASSWORD}"""

The triple quote seems to cause more issues as it won't actually recognize the value in that case it seems like. This is remedied by changing the value to something that does not contain those special characters.

What did you expect to happen?

I expected that I would either be able to use the env provider with the special characters, or work around it using the documented workaround. However, it seems that neither are the case.

Did this work before?

No.

How do we reproduce it?

  1. Set up a database user that has a password with special characters like # or ;
  2. Attempt to connect grafana to that database instance using the env provider for the password

Is the bug inside a dashboard panel?

No response

Environment (with versions)?

Grafana: 10.4.1
OS: N/A
Browser: N/A

Grafana platform?

Kubernetes

Datasource(s)?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions