Subject: Startup error on RHEL 7

From: Devrim Gündüz <[email-masked]>
Date: Sun, 11 Sep 2016 11:33:26 +0300

Hi,

Just saw this on my RHEL 7 test box. This is pgadmin4 1.0rc1, Python 2.7,
python-flask-babel-0.11.1:

# /usr/bin/python2 /usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.py
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.py", line 58, in <module>
    app = create_app()
  File "/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/__init__.py", line 226, in create_app
    driver.init_app(app)
  File "/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/utils/driver/__init__.py", line 40, in init_app
    DriverRegistry.load_drivers()
  File "/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/utils/driver/registry.py", line 88, in load_drivers
    module = import_module(module_name)
  File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/utils/driver/psycopg2/__init__.py", line 33, in <module>
    from pgadmin.utils.exception import ConnectionLost
  File "/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/utils/exception.py", line 15, in <module>
    from pgadmin.utils.ajax import service_unavailable
  File "/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/utils/ajax.py", line 124, in <module>
    def not_implemented(errormsg=_('Not implemented.'), info='', result=None, data=None):
  File "/usr/lib/python2.7/site-packages/flask_babel/__init__.py", line 539, in gettext
    t = get_translations()
  File "/usr/lib/python2.7/site-packages/flask_babel/__init__.py", line 208, in get_translations
    return support.NullTranslations()
AttributeError: 'module' object has no attribute 'NullTranslations'

What am I missing here?

Regards,
-- 
Devrim GÜNDÜZ
EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR

---

From: Dave Page <[email-masked]>
Date: Mon, 12 Sep 2016 10:05:22 +0100

> AttributeError: 'module' object has no attribute 'NullTranslations'

Hmm, not sure. Questions:

- What version of Babel?
- I assume (hope) you haven't changed config.py, but what's in
config_distro.py and config_local.py?
- Is the web/pgadmin/translations/ directory present and containing
files (a test French message catalog)?
- Is babel.cfg present?

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

-- 
Sent via pgadmin-hackers mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

---

From: Devrim Gündüz <[email-masked]>
Date: Mon, 12 Sep 2016 13:50:22 +0300

Hi Dave,

> Hmm, not sure. Questions:

python-babel-0.9.6

> config_distro.py and config_local.py?

$ cat /usr/lib/python2.7/site-packages/pgadmin4-web/config_local.py
SERVER_MODE = False
HTML_HELP = '/usr/share/doc/pgadmin4-docs/en_US/html/'

I don't have config_distro.py

> files (a test French message catalog)?

Yes:

/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/translations
/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/translations/fr
/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/translations/fr/LC_MESSAGES
/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/translations/fr/LC_MESSAGES/messages.mo
/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/translations/fr/LC_MESSAGES/messages.po

> - Is babel.cfg present?

Yes:
$ cat /usr/lib/python2.7/site-packages/pgadmin4-web/babel.cfg
[python: **.py]
[jinja2: **/templates/**.html]
[jinja2: **/templates/**.js]
extensions=jinja2.ext.autoescape,jinja2.ext.with_

Cheers,

---

From: Devrim Gündüz <[email-masked]>
Date: Mon, 12 Sep 2016 13:53:41 +0300

Hi Dave,

> python-babel-0.9.6

Argh. Upgrading it to 1.3 fixed the issue. Sorry for the noise.

Cheers,

---

From: Dave Page <[email-masked]>
Date: Mon, 12 Sep 2016 12:07:56 +0100

>> Hmm, not sure. Questions:

That's really old - I have 2.3.4.

> I don't have config_distro.py

Please move those two lines into config_distro.py - that's intended
for distro-specific configuration, whilst config_loca.py is for
user-specific.

Thanks.

---

From: Dave Page <[email-masked]>
Date: Mon, 12 Sep 2016 12:08:08 +0100

> Argh. Upgrading it to 1.3 fixed the issue. Sorry for the noise.

:-)

---

From: Devrim Gündüz <[email-masked]>
Date: Mon, 12 Sep 2016 14:12:53 +0300

Hi Dave,

> for distro-specific configuration, whilst config_loca.py is for

Done.

Cheers,