Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Slimane2021 opened this issue Aug 1, 2023 · 7 comments

Comments

@Slimane2021
Copy link

Slimane2021 commented Aug 1, 2023

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

@pirlgon
Copy link
Contributor

pirlgon commented Aug 2, 2023

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?

@Slimane2021
Copy link
Author

Slimane2021 commented Aug 2, 2023

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
Copy link
Author

Hi,

Could you please tel me whether you need more informations ?

Best regards

@bersace
Copy link
Member

bersace commented Aug 16, 2023

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

@Slimane2021
Copy link
Author

Hello,

this is the output :

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

Best regards

@bersace
Copy link
Member

bersace commented Aug 18, 2023

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

@Hugues-Antoine
Copy link
Contributor

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.

@bersace bersace changed the title error launching /usr/share/temboard/auto_configure.sh UnicodeDecodeError in parse_dsn [was: error launching /usr/share/temboard/auto_configure.sh] Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants