Hello Community, I am seeing an issue when instal...
# ask-community
a
Hello Community, I am seeing an issue when installing helm chart for prefect-server 2.19.3:
Copy code
Traceback (most recent call last):
  File "/usr/local/bin/prefect", line 5, in <module>
    from prefect.cli import app
  File "/usr/local/lib/python3.11/site-packages/prefect/__init__.py", line 79, in <module>
    prefect.logging.configuration.setup_logging()
  File "/usr/local/lib/python3.11/site-packages/prefect/logging/configuration.py", line 75, in setup_logging
    config = load_logging_config(
             ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/logging/configuration.py", line 40, in load_logging_config
    {
  File "/usr/local/lib/python3.11/site-packages/prefect/logging/configuration.py", line 43, in <dictcomp>
    if setting.value() is not None
       ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/settings.py", line 177, in value
    return self.value_from(get_current_settings(), bypass_callback=bypass_callback)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/settings.py", line 189, in value_from
    value = settings.value_of(self, bypass_callback=bypass_callback)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/settings.py", line 1828, in value_of
    value = setting.value_callback(self, value)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/settings.py", line 448, in default_database_connection_url
    return templater(settings, value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/settings.py", line 348, in templater
    return original_type(template.substitute(template_values))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/string.py", line 121, in substitute
    return self.pattern.sub(convert, self.template)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/string.py", line 114, in convert
    return str(mapping[named])
               ~~~~~~~^^^^^^^
KeyError: 'KRF'
The issue is odd, because I have a valid connection string defined for the database. I have inspected the connection-string and password and they are working, however, for some reason the server gives this error:
Copy code
[ec2-user@ip-172-31-5-171 terraform_eks]$ kubectl get secrets
NAME                                                                      TYPE                 DATA   AGE
prefect-api-key                                                           Opaque               1      25h
sh.helm.release.v1.prefect-server.v1                                      <http://helm.sh/release.v1|helm.sh/release.v1>   1      82m
sh.helm.release.v1.prefect-server.v2                                      <http://helm.sh/release.v1|helm.sh/release.v1>   1      81m
sh.helm.release.v1.prefect-server.v3                                      <http://helm.sh/release.v1|helm.sh/release.v1>   1      72m
sh.helm.release.v1.prefect-worker-default.v1                              <http://helm.sh/release.v1|helm.sh/release.v1>   1      82m
sh.helm.release.v1.prefect-worker-work-cpu-karpenter-nodepool-cpu-4x.v1   <http://helm.sh/release.v1|helm.sh/release.v1>   1      82m
sh.helm.release.v1.prefect-worker-work-gpu-karpenter-nodepool-gpu-2x.v1   <http://helm.sh/release.v1|helm.sh/release.v1>   1      82m
test-connection-string                                                    Opaque               2      25h
[ec2-user@ip-172-31-5-171 terraform_eks]$ kubectl describe secrets test-connection-string
Name:         test-connection-string
Namespace:    test-prefect
Labels:       <none>
Annotations:  <none>

Type:  Opaque

Data
====
connection-string:  144 bytes
password:           40 bytes
[ec2-user@ip-172-31-5-171 terraform_eks]$
How can I remedy this?
e
could you share the helm chart version and the values file as well?
a
chart version: 2024.5.31205053
Copy code
# Postgresql configuration
postgresql:
  enabled: true
  auth:
    # -- determines whether an admin user is created within postgres
    enablePostgresUser: false
    # -- name for a custom database
    database: server
    # -- name for a custom user
    username: prefect
    ## This is the password for `username` and will be set within the secret `{fullnameOverride}-postgresql` at the key `password`.
    ## This argument is only relevant when using the Postgres database included in the chart.
    ## For an external postgres connection, you must create and use `existingSecret` instead.
    # -- password for the custom user. Ignored if `auth.existingSecret` with key `password` is provided
    password: not-used

    ## This secret must contain two key-value pairs where the first key is `connection-string` and the value is the
    ## connection string containing your password (e.g. postgresql+asyncpg://{username}:{password}@{hostname}/{database}).
    ## The second key-value pair has the key `password` and the value is the {password} used in the connection string
    # -- Name of existing secret to use for PostgreSQL credentials.
    existingSecret: ${EXISTING_SECRET}

  # -- PostgreSQL container port
  containerPorts:
    postgresql: 5432

  # externalHostname defines the address to contact an externally
  # managed postgres database instance at. This is not required if
  # `internalPostgres` is `true`
  externalHostname: ""

  # -- enable use of bitnami/postgresql subchart
  useSubChart: false
👀 1
e
are you able to print out your connection string and see the raw value? I’m wondering if you might have a stray template reference that got in there that you didn’t mean to have
a
so i changed the password in the connection string to something without any special characters, and it worked
thing is, rds generates password that have special characters that threw it off
e
shoot, that’s right. for my understanding, do you remember which special characters caused the exception?
a
my guess is a colon ":"
rds autogenerates the passwords
and it threw in a colon
Copy code
w<:?yZSqZ.....
it was something like this