Re: Dashboard graphs are not drawn with 4.20 or 4.21 - Mailing list pgadmin-support

From Murtuza Zabuawala
Subject Re: Dashboard graphs are not drawn with 4.20 or 4.21
Date
Msg-id CAKKotZSwrgkPFBEZFFsXgEqMcHXmoVRYW3EHP8UT74Xf3bbwvw@mail.gmail.com
Whole thread Raw
In response to Re: Dashboard graphs are not drawn with 4.20 or 4.21  (Shaheed Haque <shaheedhaque@gmail.com>)
Responses Re: Dashboard graphs are not drawn with 4.20 or 4.21  (Shaheed Haque <shaheedhaque@gmail.com>)
List pgadmin-support
Hello,

Could you please provide additional information like, 
What is your platform?
How did you install/upgrade pgAdmin4?
What's the DB server version on which graphs are not displaying?
What browser/version are you using?

Also provide pgAdmin4 logs (Ref:  https://www.pgadmin.org/faq/ on how to enable logging) & attach screenshot of browser console error if any.


Regards,
Murtuza

On Thu, 30 Apr 2020, 20:41 Shaheed Haque, <shaheedhaque@gmail.com> wrote:
I resolved the wrkzeug issue by updating Flask-BabelEx, but the graphs are still not drawn.

Also, after restarting pgadmin, the SQL messages are no longer emitted.

On Thu, 30 Apr 2020 at 15:44, Shaheed Haque <shaheedhaque@gmail.com> wrote:
I forgot to add: I also tried 4.20 in case it was any better, but it had the same lack of graph drawing, so went back to 4.21 pending advice.

On Thu, 30 Apr 2020 at 15:43, Shaheed Haque <shaheedhaque@gmail.com> wrote:
Hi,

I have been running 4.14 for a while, and today in order to get to a newer version of werkzeug, I tried upgrading to 4.21 only to find that the Dashboard graphs are not being drawn. All else seems fine (I can navigate down to tables, and view data for example), but none of the graphs a re drawn.

I notice that on the console from where I am running pgAdmin 4.21, I see messages like this every few seconds:

SQL:flask.app:Execute (dict) for server #1 - DB:foo (Query-id: 8996147):
/*pga4dash*/
SELECT 'session_stats' AS chart_name, row_to_json(t) AS chart_data
FROM (SELECT
   (SELECT count(*) FROM pg_stat_activity WHERE datname = (SELECT datname FROM pg_database WHERE oid = 1680798)) AS "Total",
   (SELECT count(*) FROM pg_stat_activity WHERE state = 'active' AND datname = (SELECT datname FROM pg_database WHERE oid = 1680798))  AS "Active",
   (SELECT count(*) FROM pg_stat_activity WHERE state = 'idle' AND datname = (SELECT datname FROM pg_database WHERE oid = 1680798))  AS "Idle"
) t
UNION ALL
...
more like this
...

which suggests something is trying to fetch the needed data. I tried restarting the browser, to no avail.

I did also notice:

- A dependency on pyasn1.error which I resolved by updating from pyasn1-0.4.5 to pyasn1-0.4.8:
 
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/pgadmin4/pgAdmin4.py", line 109, in <module>
    app = create_app()
  File "/usr/local/lib/python3.7/dist-packages/pgadmin4/pgadmin/__init__.py", line 401, in create_app
    authenticate.init_app(app)
  File "/usr/local/lib/python3.7/dist-packages/pgadmin4/pgadmin/authenticate/__init__.py", line 154, in init_app
    AuthSourceRegistry.load_auth_sources()
  File "/usr/local/lib/python3.7/dist-packages/pgadmin4/pgadmin/authenticate/registry.py", line 65, in load_auth_sources
    module = import_module(module_name)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.7/dist-packages/pgadmin4/pgadmin/authenticate/ldap.py", line 14, in <module>
    from ldap3 import Connection, Server, Tls, ALL, ALL_ATTRIBUTES
  File "/usr/local/lib/python3.7/dist-packages/ldap3/__init__.py", line 139, in <module>
    from .core.connection import Connection
  File "/usr/local/lib/python3.7/dist-packages/ldap3/core/connection.py", line 44, in <module>
    from ..operation.compare import compare_operation, compare_request_to_dict
  File "/usr/local/lib/python3.7/dist-packages/ldap3/operation/compare.py", line 28, in <module>
    from ..operation.search import ava_to_dict
  File "/usr/local/lib/python3.7/dist-packages/ldap3/operation/search.py", line 41, in <module>
    from pyasn1.error import PyAsn1UnicodeDecodeError
ImportError: cannot import name 'PyAsn1UnicodeDecodeError' from 'pyasn1.error' (/usr/local/lib/python3.7/dist-packages/pyasn1/error.py)

- A compatibility problem with werkzeug. I had been running 0.15.2, and tried upgrading to 1.0.1 to address some long standing issues (I believe you guys were also hit by changes in legacy API support too) only to get this:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/pgadmin4/pgAdmin4.py", line 40, in <module>
    import config
  File "/usr/local/lib/python3.7/dist-packages/pgadmin4/config.py", line 30, in <module>
    from pgadmin.utils import env, IS_PY2, IS_WIN, fs_short_path
  File "/usr/local/lib/python3.7/dist-packages/pgadmin4/pgadmin/__init__.py", line 21, in <module>
    from flask_babelex import Babel, gettext
  File "/usr/local/lib/python3.7/dist-packages/flask_babelex/__init__.py", line 23, in <module>
    from werkzeug import ImmutableDict
ImportError: cannot import name 'ImmutableDict' from 'werkzeug' (/usr/local/lib/python3.7/dist-packages/werkzeug/__init__.py)

I downgraded to werkzeug 0.16.1 to address this.

The results I noted were AFTER these fixes were applied. FWIW, I am running on a recent Ubuntu desktop.

Any advice welcome.

Thanks, Shaheed


pgadmin-support by date:

Previous
From: Dave Page
Date:
Subject: Re: Pgadmin4 Debian
Next
From: Mark Murawski
Date:
Subject: Re: Pgadmin4 Debian