You are not logged in.

#1 2019-01-07 20:43:46

dasbrow
Member
Registered: 2019-01-07
Posts: 10

Pgadmin4 Password crypto issues

I am getting this error message when I enter a password for ssh tunneled connections.

Failed to decrypt the SSH tunnel password. Error: Object type <class 'str'> cannot be passed to C code remove ppycryptodomex

I had the message last month as well and found a solutions via installing a alternative package to pycryptodome. I cannot find the forum that gave the instruction now and don't recall which package I installed. Could anyone help with this.

Thanks!

Last edited by dasbrow (2019-01-08 20:41:32)

Offline

#2 2019-01-07 20:46:46

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Pgadmin4 Password crypto issues

Versions? Package names even?


Moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2019-01-07 20:51:35

dasbrow
Member
Registered: 2019-01-07
Posts: 10

Re: Pgadmin4 Password crypto issues

pgadmin4-3.6-1

Offline

#4 2019-01-07 20:52:55

dasbrow
Member
Registered: 2019-01-07
Posts: 10

Re: Pgadmin4 Password crypto issues

Someone else posted a Bug https://bugs.archlinux.org/task/61228

Offline

#5 2019-01-07 21:39:09

loqs
Member
Registered: 2014-03-06
Posts: 18,859

Re: Pgadmin4 Password crypto issues

Have you tried the building the package with the fix applied and testing it?  To check it does resolve the issue for you.

Offline

#6 2019-01-08 13:27:32

dasbrow
Member
Registered: 2019-01-07
Posts: 10

Re: Pgadmin4 Password crypto issues

Yes, I pulled the source to see if maybe it was not compiled against pycryptodome and the patch is applied. I get a completely different issue when I remove the patch from the build script.

Offline

#7 2019-01-08 14:22:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: Pgadmin4 Password crypto issues

dasbrow wrote:

I get a completely different issue when I remove the patch from the build script.

Please clarify this as it doesn't make much sense.  The package in the repos doesn't have the patch applied yet, so the error without the patch is what you posted in your first post, right?  If you get a different error with the patch applied, then post that error - we can't see what's happening on your computer, you need to tell us.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2019-01-08 16:05:18

loqs
Member
Registered: 2014-03-06
Posts: 18,859

Re: Pgadmin4 Password crypto issues

Please ensure the base-devel group is installed then the following generates and installs the patched package.

git clone git://git.archlinux.org/svntogit/community.git --single-branch --branch "packages/pgadmin4" #needs git
cd community/trunk/
curl -o pgadmin4-compatibility-with-python3-pycryptodome.patch "https://bugs.archlinux.org/task/61228?getfile=17111"
updpkgsums #needs pacman-contrib
gpg --recv-keys 8881B2A8210976F2
makepkg -rsi # or install devtools then use extra-x86_64-build followed by pacman -U pgadmin4-3.6-1-x86_64.pkg.tar.xz

Offline

#9 2019-01-08 16:37:06

dasbrow
Member
Registered: 2019-01-07
Posts: 10

Re: Pgadmin4 Password crypto issues

Trilby wrote:
dasbrow wrote:

I get a completely different issue when I remove the patch from the build script.

Please clarify this as it doesn't make much sense.  The package in the repos doesn't have the patch applied yet, so the error without the patch is what you posted in your first post, right?  If you get a different error with the patch applied, then post that error - we can't see what's happening on your computer, you need to tell us.

Edit: Ignore this reply -> The repo may not, but the source package from SVN (arch's build source) has the patch in the directory. I've rebuilt the package with said patch, which did not solve the issue.

Last edited by dasbrow (2019-01-08 16:41:16)

Offline

#10 2019-01-08 16:40:49

dasbrow
Member
Registered: 2019-01-07
Posts: 10

Re: Pgadmin4 Password crypto issues

Never mind, I believe I see where I have gone wrong. I will report back once I fixed my other screw up.

Offline

#11 2019-01-08 20:19:11

dasbrow
Member
Registered: 2019-01-07
Posts: 10

Re: Pgadmin4 Password crypto issues

loqs wrote:

Please ensure the base-devel group is installed then the following generates and installs the patched package.

git clone git://git.archlinux.org/svntogit/community.git --single-branch --branch "packages/pgadmin4" #needs git
cd community/trunk/
curl -o pgadmin4-compatibility-with-python3-pycryptodome.patch "https://bugs.archlinux.org/task/61228?getfile=17111"
updpkgsums #needs pacman-contrib
gpg --recv-keys 8881B2A8210976F2
makepkg -rsi # or install devtools then use extra-x86_64-build followed by pacman -U pgadmin4-3.6-1-x86_64.pkg.tar.xz

Thanks for the information

I now get this message.

"Failed to decrypt the saved password. Error: 'bytes' object has no attribute 'encode'"

Offline

#12 2019-01-08 20:37:55

dasbrow
Member
Registered: 2019-01-07
Posts: 10

Re: Pgadmin4 Password crypto issues

premature thoughts of it being solved.

Last edited by dasbrow (2019-01-08 20:42:07)

Offline

#13 2019-01-08 21:54:34

loqs
Member
Registered: 2014-03-06
Posts: 18,859

Re: Pgadmin4 Password crypto issues

What file and line number is the new error coming from?

Offline

#14 2019-01-09 14:55:14

dasbrow
Member
Registered: 2019-01-07
Posts: 10

Re: Pgadmin4 Password crypto issues

loqs wrote:

What file and line number is the new error coming from?

2019-01-09 09:54:24,328: ERROR	flask.app:	'bytes' object has no attribute 'encode'
Traceback (most recent call last):
  File "/usr/lib/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line 259, in connect
    password = decrypt(encpass, user.password.encode('utf-8'))
  File "/usr/lib/pgadmin4/web/pgadmin/utils/crypto.py", line 54, in decrypt
    cipher = AES.new(pad(key.encode('utf-8')), AES.MODE_CFB, iv)
AttributeError: 'bytes' object has no attribute 'encode'
2019-01-09 09:54:25,723: ERROR	flask.app:	'bytes' object has no attribute 'encode'
Traceback (most recent call last):
  File "/usr/lib/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line 259, in connect
    password = decrypt(encpass, user.password.encode('utf-8'))
  File "/usr/lib/pgadmin4/web/pgadmin/utils/crypto.py", line 54, in decrypt
    cipher = AES.new(pad(key.encode('utf-8')), AES.MODE_CFB, iv)
AttributeError: 'bytes' object has no attribute 'encode'
2019-01-09 09:54:25,728: ERROR	flask.app:	Could not connected to server(#2) - 'LOCAL'.
Error: Failed to decrypt the saved password.
Error: 'bytes' object has no attribute 'encode'

Edit pasted wrong error message, correct one is now above.

Last edited by dasbrow (2019-01-09 14:59:04)

Offline

#15 2019-01-09 17:03:29

loqs
Member
Registered: 2014-03-06
Posts: 18,859

Re: Pgadmin4 Password crypto issues

If you manually change /usr/lib/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py" line 259 from

    password = decrypt(encpass, user.password.encode('utf-8'))

to

    password = decrypt(encpass, user.password)

What is the output then?

Offline

#16 2019-01-09 17:43:18

dasbrow
Member
Registered: 2019-01-07
Posts: 10

Re: Pgadmin4 Password crypto issues

loqs wrote:

If you manually change /usr/lib/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py" line 259 from

    password = decrypt(encpass, user.password.encode('utf-8'))

to

    password = decrypt(encpass, user.password)

What is the output then?


Fixed! Will keep testing it.

Offline

Board footer

Powered by FluxBB