chirpstack-fuota-server icon indicating copy to clipboard operation
chirpstack-fuota-server copied to clipboard

Parsing error if double quote (") character is present in postgreSQL user password

Open nicolas-juteau opened this issue 1 year ago • 2 comments

ChirpStack FUOTA server will fail to start if double quote (") character is present in postgreSQL user password.

Dec 11 18:00:25 dev-chirpstack chirpstack-fuota-server[76143]: time="2023-12-11T18:00:25Z" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="parse "postgres://user:XXXXXX*{\"NY+": invalid port ":XXXXXX*{\"NY+" after host"

Escaping the double quote using a \ does not help. Using englobing single quote and leave the double quote character unescaped does not work either.

NOTE: this issue does not occur in chirpstack (latest version). We use the same escaped password and the connection to postgresql database establishes correctly.

nicolas-juteau avatar Dec 11 '23 18:12 nicolas-juteau

Used DSN format:

postgres://user:password@server/db?sslmode=require

nicolas-juteau avatar Dec 11 '23 18:12 nicolas-juteau

Just in case others stumble on this issue, a workaround is to use the dsn string format 'user=chirpstack_ns dbname=chirpstack_ns sslmode=disable'.

nicolas-juteau avatar Jul 25 '24 13:07 nicolas-juteau