Re: pgAdmin4 - V3 - Problems managing passwords - Mailing list pgadmin-support

From Khushboo Vashi
Subject Re: pgAdmin4 - V3 - Problems managing passwords
Date
Msg-id CAFOhELdczoOkuF4mdgJfU=Kynj_cgon+Q6=3L_=p3nTd-6Wf1Q@mail.gmail.com
Whole thread Raw
In response to pgAdmin4 - V3 - Problems managing passwords  (Douglas Reed <douglas@fsbtech.com>)
List pgadmin-support
[Looping pgadmin-support list.......]

On Fri, May 4, 2018 at 7:40 PM, Douglas Reed <douglas@fsbtech.com> wrote:
Hi

It seems to have worked

Good to hear that your problem is solved. 
Many thanks

The following enclosed;

Input and responses when applying your fix;

source ~/py3-venv-pgadmin4v3/bin/activate

(py3-venv-pgadmin4v3) douglas@xxxx:~$ pip uninstall pycryptodome

    Uninstalling pycryptodome-3.6.1:
      Would remove:
        /home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/Crypto/*
        /home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/pycryptodome-3.6.1.dist-info/*
    Proceed (y/n)? y
      Successfully uninstalled pycryptodome-3.6.1

(py3-venv-pgadmin4v3) douglas@xxxx:~$ pip install pycrypto

    Requirement already satisfied: pycrypto in /usr/lib/python3/dist-packages (2.6.1)
    pgadmin4 3.0 requires pycryptodome; python_version >= "2.7", which is not installed.
    launchpadlib 1.10.4 requires testresources, which is not installed.
    You are using pip version 10.0.0, however version 10.0.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.


(py3-venv-pgadmin4v3) douglas@xxxx:~$ pip install --upgrade pip

    Collecting pip
        100% |████████████████████████████████| 1.3MB 4.8MB/s 
    launchpadlib 1.10.4 requires testresources, which is not installed.
    pgadmin4 3.0 requires pycryptodome; python_version >= "2.7", which is not installed.
    Installing collected packages: pip
      Found existing installation: pip 10.0.0
        Uninstalling pip-10.0.0:
          Successfully uninstalled pip-10.0.0
    Successfully installed pip-10.0.1


(py3-venv-pgadmin4v3) douglas@xxxx:~$ pip3 install pycrypto

    Requirement already satisfied: pycrypto in /usr/lib/python3/dist-packages (2.6.1)
    pgadmin4 3.0 requires pycryptodome; python_version >= "2.7", which is not installed.
    launchpadlib 1.10.4 requires testresources, which is not installed.

deactivate


Input (sorry no responses here) for when I installed pgAdmin4 v3 (I have been running earlier versions but started with a fresh virtualenv);

---- Started here -----------

Create virtualenv in dir ~/py3-venv-pgadmin4v3

    virtualenv --system-site-packages --no-setuptools --python=python3.5 ~/py3-venv-pgadmin4v3

Activate virtualenv

    cd ~/py3-venv-pgadmin4v3/bin     OR     source ~/py3-venv-pgadmin4v3/bin/activate
    source activate

Check pip3

    which pip3
    ~/py3-venv-pgadmin4v3/bin/pip3 --version



Install pgAdmin4

    pip3 install ~/Downloads/pgadmin4-3.0-py2.py3-none-any.whl


You are using pip version 8.1.2, however version 10.0.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.



For desktop deployment

    cd ~/py3-venv-pgadmin4v3/lib/python3.5/site-packages/pgadmin4
    touch config_local.py
    nano config_local.py

write:

    import os
    SERVER_MODE = False
    DATA_DIR = os.path.realpath(os.path.expanduser(u'~/.pgadmin/'))
    LOG_FILE = os.path.join(DATA_DIR, 'pgadmin4.log')
    SQLITE_PATH = os.path.join(DATA_DIR, 'pgadmin4.db')
    SESSION_DB_PATH = os.path.join(DATA_DIR, 'sessions')
    STORAGE_DIR = os.path.join(DATA_DIR, 'storage')

run:

    python3 ~/py3-venv-pgadmin4v3/lib/python3.5/site-packages/pgadmin4/setup.py

Run pgAdmin4

    python3 ~/py3-venv-pgadmin4v3/lib/python3.5/site-packages/pgadmin4/pgAdmin4.py

Exit virtualenv

    deactivate

Done

Regards


On 3 May 2018 at 06:40, Support <support@rt-reisen.de> wrote:
Hi,

Please follow below instructions to resolve this issue:

pip uninstall pycryptodome
pip install pycrypto


Also, please provide the steps you have followed to install the pgAdmin 4 and when you have installed?

Thanks,
Khushboo

>>>




On Wed, May 2, 2018 at 2:07 PM, Douglas Reed <douglas@fsbtech.com> wrote:

Hi I recently installed v3 of pgAdmin4 When setting up the passwords for each of the databases, I kept getting the message; "Object type <class 'str'> cannot be passed to C code" Although it appeared to save the password A server reboot later, when I try to to the databases, it prompts for the password, when I input the password and click the OK button, I get the response "Internal Server Error - click for details" Clicking to view the errors shows the following in a message box which cannot be dismissed The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. The platform is Ubuntu v16.10 The log on the server window reported /home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: < http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>. """) Starting pgAdmin 4. Please navigate to http://127.0.0.1:5050 in your browser. 2018-05-02 09:28:17,685: ERROR pgadmin: Object type <class 'str'> cannot be passed to C code Traceback (most recent call last): File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/__init__.py", line 962, in connect if password is not None else server.password File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/pgadmin4/pgadmin/utils/crypto.py", line 31, in encrypt cipher = AES.new(pad(key), AES.MODE_CFB, iv) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/Crypto/Cipher/AES.py", line 200, in new return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/Crypto/Cipher/__init__.py", line 55, in _create_cipher return modes[mode](factory, **kwargs) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/Crypto/Cipher/_mode_cfb.py", line 230, in _create_cfb_cipher cipher_state = factory._create_base_cipher(kwargs) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/Crypto/Cipher/AES.py", line 100, in _create_base_cipher result = start_operation(c_uint8_ptr(key), File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/Crypto/Util/_raw_api.py", line 196, in c_uint8_ptr raise TypeError("Object type %s cannot be passed to C code" % type(data)) TypeError: Object type <class 'str'> cannot be passed to C code 2018-05-02 09:28:17,698: ERROR werkzeug: Error on request: Traceback (most recent call last): File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/werkzeug/serving.py", line 270, in run_wsgi execute(self.server.app) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/werkzeug/serving.py", line 258, in execute application_iter = app(environ, start_response) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1997, in __call__ return self.wsgi_app(environ, start_response) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1985, in wsgi_app response = self.handle_exception(e) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1540, in handle_exception reraise(exc_type, exc_value, tb) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise raise value File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise raise value File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/views.py", line 84, in view return self.dispatch_request(*args, **kwargs) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/pgadmin4/pgadmin/browser/utils.py", line 254, in dispatch_request return method(*args, **kwargs) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/__init__.py", line 965, in connect return internal_server_error(errormsg
=e.message) AttributeError: 'TypeError' object has no attribute 'message' Python pip freeze alembic==0.9.9 Babel==2.5.3 blinker==1.4 click==6.7 extras==1.0.0 fixtures==3.0.0 Flask==0.12.2 Flask-BabelEx==0.9.3 Flask-Gravatar==0.5.0 Flask-HTMLmin==1.3.2 Flask-Login==0.3.2 Flask-Mail==0.9.1 Flask-Migrate==2.1.1 Flask-Paranoid==0.2.0 Flask-Principal==0.4.0 Flask-Security==3.0.0 Flask-SQLAlchemy==2.3.2 Flask-WTF==0.14.2 html5lib==1.0.1 htmlmin==0.1.12 itsdangerous==0.24 linecache2==1.0.0 passlib==1.7.1 pbr==3.1.1 pgadmin4==3.0 psycopg2==2.7.4 pycryptodome==3.6.1 pyrsistent==0.14.2 python-dateutil==2.7.2 python-editor==1.0.3 python-mimeparse==1.6.0 pytz==2018.3 simplejson==3.13.2 six==1.11.0 speaklater==1.3 SQLAlchemy==1.2.6 sqlparse==0.2.4 testtools==2.3.0 traceback2==1.4.0 unittest2==1.1.0 webencodings==0.5.1 Werkzeug==0.14.1 WTForms==2.1 Many thanks –



____________________________

Douglas Reed (DBA)
FSB Technology (UK) Ltd



Sie erhalten diese Nachricht da es eine Aktualisierung Ihres Tickets SUPPORT-3569 gibt.

Wenn Sie uns zu diesem Vorgang weitere Informationen geben möchten, Antworten Sie bitte direkt auf diese Email.

Viele Grüße
rtk online

Ursprüngliche Nachricht:


Hi I recently installed v3 of pgAdmin4 When setting up the passwords for each of the databases, I kept getting the message; "Object type <class 'str'> cannot be passed to C code" Although it appeared to save the password A server reboot later, when I try to to the databases, it prompts for the password, when I input the password and click the OK button, I get the response "Internal Server Error - click for details" Clicking to view the errors shows the following in a message box which cannot be dismissed The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. The platform is Ubuntu v16.10 The log on the server window reported /home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: < http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>. """) Starting pgAdmin 4. Please navigate to http://127.0.0.1:5050 in your browser. 2018-05-02 09:28:17,685: ERROR pgadmin: Object type <class 'str'> cannot be passed to C code Traceback (most recent call last): File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/__init__.py", line 962, in connect if password is not None else server.password File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/pgadmin4/pgadmin/utils/crypto.py", line 31, in encrypt cipher = AES.new(pad(key), AES.MODE_CFB, iv) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/Crypto/Cipher/AES.py", line 200, in new return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/Crypto/Cipher/__init__.py", line 55, in _create_cipher return modes[mode](factory, **kwargs) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/Crypto/Cipher/_mode_cfb.py", line 230, in _create_cfb_cipher cipher_state = factory._create_base_cipher(kwargs) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/Crypto/Cipher/AES.py", line 100, in _create_base_cipher result = start_operation(c_uint8_ptr(key), File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/Crypto/Util/_raw_api.py", line 196, in c_uint8_ptr raise TypeError("Object type %s cannot be passed to C code" % type(data)) TypeError: Object type <class 'str'> cannot be passed to C code 2018-05-02 09:28:17,698: ERROR werkzeug: Error on request: Traceback (most recent call last): File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/werkzeug/serving.py", line 270, in run_wsgi execute(self.server.app) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/werkzeug/serving.py", line 258, in execute application_iter = app(environ, start_response) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1997, in __call__ return self.wsgi_app(environ, start_response) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1985, in wsgi_app response = self.handle_exception(e) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1540, in handle_exception reraise(exc_type, exc_value, tb) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise raise value File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise raise value File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/flask/views.py", line 84, in view return self.dispatch_request(*args, **kwargs) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/pgadmin4/pgadmin/browser/utils.py", line 254, in dispatch_request return method(*args, **kwargs) File "/home/douglas/py3-venv-pgadmin4v3/lib/python3.5/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/__init__.py", line 965, in connect return internal_server_error(
errormsg=e.message) AttributeError: 'TypeError' object has no attribute 'message' Python pip freeze alembic==0.9.9 Babel==2.5.3 blinker==1.4 click==6.7 extras==1.0.0 fixtures==3.0.0 Flask==0.12.2 Flask-BabelEx==0.9.3 Flask-Gravatar==0.5.0 Flask-HTMLmin==1.3.2 Flask-Login==0.3.2 Flask-Mail==0.9.1 Flask-Migrate==2.1.1 Flask-Paranoid==0.2.0 Flask-Principal==0.4.0 Flask-Security==3.0.0 Flask-SQLAlchemy==2.3.2 Flask-WTF==0.14.2 html5lib==1.0.1 htmlmin==0.1.12 itsdangerous==0.24 linecache2==1.0.0 passlib==1.7.1 pbr==3.1.1 pgadmin4==3.0 psycopg2==2.7.4 pycryptodome==3.6.1 pyrsistent==0.14.2 python-dateutil==2.7.2 python-editor==1.0.3 python-mimeparse==1.6.0 pytz==2018.3 simplejson==3.13.2 six==1.11.0 speaklater==1.3 SQLAlchemy==1.2.6 sqlparse==0.2.4 testtools==2.3.0 traceback2==1.4.0 unittest2==1.1.0 webencodings==0.5.1 Werkzeug==0.14.1 WTForms==2.1 Many thanks –



____________________________

Douglas Reed (DBA)
FSB Technology (UK) Ltd




--
____________________________

Douglas Reed (DBA)
FSB Technology (UK) Ltd


pgadmin-support by date:

Previous
From: Peter Palka
Date:
Subject: Re: User account and settings storage in other database than SQLite
Next
From: Khushboo Vashi
Date:
Subject: Re: The sqlite database