temboard icon indicating copy to clipboard operation
temboard copied to clipboard

UnicodeDecodeError in parse_dsn [was: error launching /usr/share/temboard/auto_configure.sh]

Open Slimane2021 opened this issue 1 year ago • 7 comments

Hello,

i had launched this script, /usr/share/temboard/auto_configure.sh, with the folowing parameters :

export PGHOST=/home/project/postgres/ export PGPORT=54321 export PGUSER=dbaspidr4 export TEMBOARD_PASSWORD="*******"

i had receive the folwing errors :

mesg: ttyname failed: Inappropriate ioctl for device
INFO:  app: Using config file /etc/temboard/temboard.conf.
ERROR:  app: Unhandled error:
        Traceback (most recent call last):
          File "/usr/lib/python3.6/site-packages/temboardui/toolkit/app.py", line 351, in entrypoint
            retcode = self.main(argv, environ)
          File "/usr/lib/python3.6/site-packages/temboardui/cli/app.py", line 145, in main
            return command.main(args)
          File "/usr/lib/python3.6/site-packages/temboardui/cli/migratedb.py", line 39, in main
            with self.parent.make_conn() as conn:
          File "/usr/lib/python3.6/site-packages/temboardui/cli/migratedb.py", line 29, in make_conn
            return closing(connect(format_dsn(self.app.config.repository)))
          File "/usr/lib64/python3.6/site-packages/psycopg2/__init__.py", line 126, in connect
            dsn = _ext.make_dsn(dsn, **kwargs)
          File "/usr/lib64/python3.6/site-packages/psycopg2/extensions.py", line 153, in make_dsn
            parse_dsn(dsn)
        UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd3 in position 3: invalid continuation byte
ERROR:  app: temboardui version is 8.0.
ERROR:  app: This is a bug!
ERROR:  app: Please report traceback to https://github.com/dalibo/temboard/issues/new! Thanks!
+ log etape51
+ echo etape51
+ tee -a /dev/fd/3
etape51
+ sudo -inu temboard /usr/bin/temboard --config=/etc/temboard/temboard.conf migratedb upgrade
mesg: ttyname failed: Inappropriate ioctl for device
INFO:  app: Using config file /etc/temboard/temboard.conf.
ERROR:  app: Unhandled error:
        Traceback (most recent call last):
          File "/usr/lib/python3.6/site-packages/temboardui/toolkit/app.py", line 351, in entrypoint
            retcode = self.main(argv, environ)
          File "/usr/lib/python3.6/site-packages/temboardui/cli/app.py", line 145, in main
            return command.main(args)
          File "/usr/lib/python3.6/site-packages/temboardui/cli/migratedb.py", line 51, in main
            with self.parent.make_conn() as conn:
          File "/usr/lib/python3.6/site-packages/temboardui/cli/migratedb.py", line 29, in make_conn
            return closing(connect(format_dsn(self.app.config.repository)))
          File "/usr/lib64/python3.6/site-packages/psycopg2/__init__.py", line 126, in connect
            dsn = _ext.make_dsn(dsn, **kwargs)
          File "/usr/lib64/python3.6/site-packages/psycopg2/extensions.py", line 153, in make_dsn
            parse_dsn(dsn)
        UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd3 in position 3: invalid continuation byte
ERROR:  app: temboardui version is 8.0.
ERROR:  app: This is a bug!
ERROR:  app: Please report traceback to https://github.com/dalibo/temboard/issues/new! Thanks!
+ catchall
+ local rc=1
+ trap - INT EXIT TERM
+ set +x

Could you advise please,

Regards, Slimane MRABTI

Slimane2021 avatar Aug 01 '23 15:08 Slimane2021

Hi, please don't post your password here (I've updated your comment). It looks like you have a problem with the encoding in the temboard.conf file. Can you give us the contents?

pirlgon avatar Aug 02 '23 07:08 pirlgon

Hi,

Please find below the contents :

cat /etc/temboard/temboard.conf

# Configuration initiated by /usr/share/temboard/auto_configure.sh on Wed Aug  2 11:08:29 CEST 2023
#
# See https://temboard.rtfd.io/ for details on configuration
# possibilities.

[temboard]
port = 8888
ssl_cert_file = /etc/pki/tls/certs/temboard-auto.pem
ssl_key_file = /etc/pki/tls/private/temboard-auto.key
cookie_secret = *******
home = /var/lib/temboard

[repository]
host = /home/spidr4/data/14/run/postgres/
port = 54321
user = temboard
password = *****
dbname = temboard

[logging]
method = stderr
level = INFO

[monitoring]
# purge_after = 730

[statements]
# purge_after = 7

Best regards

Slimane2021 avatar Aug 02 '23 09:08 Slimane2021

Hi,

Could you please tel me whether you need more informations ?

Best regards

Slimane2021 avatar Aug 04 '23 07:08 Slimane2021

@Slimane2021 what is the output of file -i /etc/temboard/temboard.conf ?

bersace avatar Aug 16 '23 09:08 bersace

Hello,

this is the output :

/etc/temboard/temboard.conf: text/plain; charset=us-ascii

Best regards

Slimane2021 avatar Aug 18 '23 07:08 Slimane2021

You have a non ascii char in your password or something like that.

bersace avatar Aug 18 '23 09:08 bersace

Hello,

You can get this error if the password stored in the temboard.conf file is not correct. This can happen if the auto_configure.sh script is run a second time, as it will not change the password at database level.

Hugues-Antoine avatar Sep 20 '23 20:09 Hugues-Antoine