You are not logged in.

#1 2018-08-06 20:37:54

gkrukar
Member
Registered: 2018-05-11
Posts: 7

Unable to start pgadmin4 after python and pgadmin update

Removing pgadmin cache do not help.
No info in log file.

Python path:  "/usr/lib/pgadmin4/venv/lib/python3.7/site-packages:/usr/lib/python3.7/site-packages:/usr/lib/python3.7"
Python Home:  "/usr/lib/pgadmin4/venv"
Webapp path:  "/usr/lib/pgadmin4/web/pgAdmin4.py"
NOTE: Configuring authentication for DESKTOP mode.

An error occurred initialising the application server:

An error occurred initialising the application server:

%1

Offline

#2 2018-08-07 02:11:07

saroshmk
Member
Registered: 2018-08-07
Posts: 2

Re: Unable to start pgadmin4 after python and pgadmin update

Me too! I see exactly the same issue as gkrukar.

Offline

#3 2018-08-07 03:13:55

rollenwiese
Member
Registered: 2008-02-24
Posts: 68

Re: Unable to start pgadmin4 after python and pgadmin update

Doesn't help resolve the issue with the package, but the docker image is a reliable alternative.

Offline

#4 2018-08-08 08:16:01

nylan
Member
Registered: 2009-01-30
Posts: 4

Re: Unable to start pgadmin4 after python and pgadmin update

Me too! Also with the aur/pgadmin4-systray-fix 3.1-2 version

Offline

#5 2018-08-08 10:29:20

saroshmk
Member
Registered: 2018-08-07
Posts: 2

Re: Unable to start pgadmin4 after python and pgadmin update

I've tried the docker image. Works for most part, but gets really complicated when I have to restore database backups. Seems like the image has a few packages missing: postgresql-common, postgresql-client

Any pointers as to what to look for to fix the original pgadmin4 issue? This issue has hit me hard.

Offline

#6 2018-08-08 14:40:43

Dinho
Member
Registered: 2018-08-08
Posts: 1

Re: Unable to start pgadmin4 after python and pgadmin update

Same problem after python and pgadmin update in 08/08/2018

Python path:  "/usr/lib/pgadmin4/venv/lib/python3.7/site-packages:/usr/lib/python3.7/site-packages:/usr/lib/python3.7"
Python Home:  "/usr/lib/pgadmin4/venv"
Webapp path:  "/usr/lib/pgadmin4/web/pgAdmin4.py"

An error occurred initialising the application server: %1

Offline

#7 2018-08-08 21:57:54

mach
Member
Registered: 2018-08-08
Posts: 1

Re: Unable to start pgadmin4 after python and pgadmin update

I also have the following problem when starting pgadmin4:

[mch@arch ~]$ pacman -Qi pgadmin4
Name            : pgadmin4
Version         : 3.0-3
Packager        : Evangelos Foutras <evangelos@foutrelis.com>
Build Date      : Mon 23 Jul 2018 06:11:20 PM CEST
Install Date    : Wed 08 Aug 2018 11:30:46 PM CEST

[mch@arch ~]$ pgadmin4
Python path:  "/usr/lib/pgadmin4/venv/lib/python3.7/site-packages:/usr/lib/python3.7/site-packages:/usr/lib/python3.7"
Python Home:  "/usr/lib/pgadmin4/venv"
Webapp path:  "/usr/lib/pgadmin4/web/pgAdmin4.py"
"Failed to launch the application server, server thread exiting.
<core dump>
Segmentation fault (core dumped)

If there is any information I could provide to solve the issue please let me know.

Last edited by mach (2018-08-08 22:00:57)

Offline

#8 2018-08-09 17:33:41

jmbull
Member
Registered: 2018-08-09
Posts: 2

Re: Unable to start pgadmin4 after python and pgadmin update

Same issue. I was in a bind so I tried modifying the PKGBUILD to install 3.2, which has a release date of today (2018-08-09).

# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Jerome Leclanche <jerome@leclan.ch>

pkgname=pgadmin4
pkgver=3.2
pkgrel=1
pkgdesc='Comprehensive design and management interface for PostgreSQL'
url='https://www.pgadmin.org/'
arch=('x86_64')
license=('custom')
depends=('qt5-base' 'python' 'python-psycopg2' 'postgresql-libs' 'hicolor-icon-theme')
makedepends=('python-setuptools' 'imagemagick')
source=(https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v${pkgver}/source/${pkgname}-${pkgver}.tar.gz
        pgAdmin4.desktop
        config_distro.py
        config_local.py)
sha512sums=('SKIP')

prepare() {
  cd "${pkgname}-${pkgver}"
  local PYTHONVERSION="$(python -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))')"
  sed 's|value("PythonPath")|value("PythonPath", "/usr/lib/pgadmin4/venv/lib/python'${PYTHONVERSION}'/site-packages:/usr/lib/python'${PYTHONVERSION}'/site-packages:/usr/lib/python'${PYTHONVERSION}'")|g' -i runtime/{pgAdmin4.cpp,Server.cpp,TrayIcon.cpp}
  sed -r 's|(venv/lib/python)|\1'${PYTHONVERSION}'|g' runtime/Server.cpp
}


build() {
  export LANG=en_US.UTF-8
  export LC_ALL=en_US.UTF-8

  cd ${pkgname}-${pkgver}
  convert runtime/pgAdmin4.{ico,png}

  python -m venv "${srcdir}/${pkgname}-${pkgver}/venv"
  "${srcdir}/${pkgname}-${pkgver}/venv/bin/python" -m pip install -r "${srcdir}/${pkgname}-${pkgver}/requirements.txt"

  python -m venv "${srcdir}/${pkgname}-${pkgver}/venv-docs"
  "${srcdir}/${pkgname}-${pkgver}/venv-docs/bin/python" -m pip install -r "${srcdir}/${pkgname}-${pkgver}/requirements.txt"
  "${srcdir}/${pkgname}-${pkgver}/venv-docs/bin/python" -m pip install sphinx

  PATH="${srcdir}/${pkgname}-${pkgver}/venv-docs/bin:${PATH}" make docs

  cd runtime
  qmake CONFIG+=release
  make
}

package() {
  cd "${pkgname}-${pkgver}"

  install -D runtime/pgAdmin4 "${pkgdir}/usr/lib/pgadmin4/runtime/pgAdmin4"

  cp -a docs web "${pkgdir}/usr/lib/pgadmin4"
  cp -a venv "${pkgdir}/usr/lib/pgadmin4/venv"

  install -Dm 644 "${srcdir}"/config_{distro,local}.py -t "${pkgdir}/usr/lib/pgadmin4/web"

  ### fixup some python wonkyness
  local PYTHONVERSION="$(python -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))')"
  rm -r "${pkgdir}/usr/lib/pgadmin4/venv/lib/python${PYTHONVERSION}/site-packages/psycopg2"
  ln -s /usr/lib/python3.6/lib-dynload "${pkgdir}/usr/lib/pgadmin4/venv/lib/python${PYTHONVERSION}/lib-dynload"

  ### Launcher

  install -Dm 644 runtime/pgAdmin4-0.png "${pkgdir}/usr/share/icons/hicolor/256x256/apps/pgAdmin4.png"
  install -Dm 644 runtime/pgAdmin4-1.png "${pkgdir}/usr/share/icons/hicolor/48x48/apps/pgAdmin4.png"
  install -Dm 644 runtime/pgAdmin4-2.png "${pkgdir}/usr/share/icons/hicolor/32x32/apps/pgAdmin4.png"
  install -Dm 644 runtime/pgAdmin4-3.png "${pkgdir}/usr/share/icons/hicolor/16x16/apps/pgAdmin4.png"

  install -Dm 644 "${srcdir}/pgAdmin4.desktop" -t "${pkgdir}/usr/share/applications"

  install -D /dev/stdin "${pkgdir}/usr/bin/pgadmin4" <<END
#!/bin/sh
cd /usr/lib/pgadmin4
exec runtime/pgAdmin4 "\$@"
END
  install -D /dev/stdin "${pkgdir}/usr/bin/pgadmin4-server" <<END
#!/bin/sh
cd /usr/lib/pgadmin4
PYTHONPATH="/usr/lib/pgadmin4/venv/lib/python${PYTHONVERSION}/site-packages" python web/pgAdmin4.py "\$@"
END

  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:

In your build directory, you'll need to create config_distro.py:

SERVER_MODE = False
HELP_PATH = "/usr/lib/pgadmin4/docs/en_US/_build/html/"

config_local.py

$touch config_local.py

... and pgAdmin4.desktop:

[Desktop Entry]
Encoding=UTF-8
Name=pgAdmin 4
Exec=/usr/lib/pgadmin4/runtime/pgAdmin4
Icon=pgAdmin4
Type=Application
Categories=Application;Development;
MimeType=text/html
DocPath=/usr/lib/pgadmin4/docs/en_US/_build/html/index.html
Comment=PostgreSQL Tools
Keywords=database;db;sql;query;administration;development;

I'm also foolhardy enough to skip the integrity checks.

makepkg -si --skipchecksums --skippgpcheck

Still no luck.

$pgadmin4-server
"Failed to launch the application server, server thread exiting."

It appears that some directories aren't available to my user account. So...

$sudo chown -R jb:root /var/lib/pgadmin
$sudo chown -R jb:root /var/log/pgadmin

$pgadmin4-server
Starting pgAdmin 4. Please navigate to http://127.0.0.1:5050 in your browser.

Score! Running the pgAdmin4 startup script still gives me the dialog window asking for paths but maybe this will do until the package maintainer gets around to updating. Until then, I'm running pgadmin4-server and navigating directly to http://127.0.0.1:5050/browser.

Last edited by jmbull (2018-08-20 19:29:12)

Offline

#9 2018-08-10 17:30:21

risto3
Member
Registered: 2016-09-27
Posts: 32

Re: Unable to start pgadmin4 after python and pgadmin update

I'm seeing this in pgadmin4's icon server log:

Traceback (most recent call last):
  File "/usr/lib/pgadmin4/web/pgAdmin4.py", line 70, in <module>
    app = create_app()
  File "/usr/lib/pgadmin4/web/pgadmin/__init__.py", line 367, in create_app
    driver.init_app(app)
  File "/usr/lib/pgadmin4/web/pgadmin/utils/driver/__init__.py", line 40, in init_app
    DriverRegistry.load_drivers()
  File "/usr/lib/pgadmin4/web/pgadmin/utils/driver/registry.py", line 88, in load_drivers
    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/lib/pgadmin4/web/pgadmin/utils/driver/psycopg2/__init__.py", line 26, in <module>
    from .connection import Connection
  File "/usr/lib/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line 141
    def __init__(self, manager, conn_id, db, auto_reconnect=True, async=0,
                                                                      ^
SyntaxError: invalid syntax

Offline

#10 2018-08-11 10:00:13

risto3
Member
Registered: 2016-09-27
Posts: 32

Re: Unable to start pgadmin4 after python and pgadmin update

BTW I don't know about pgadmin4 4.3, but building/installing manually the recently released 3.2
by adapting the current PKGBUILD worked fine (no .sig file though) at least on my machine, which is
running 'Linux sarchx64 4.17.13-arch1-1-ARCH #1 SMP PREEMPT Mon Aug 6 23:06:31 UTC 2018 x86_64 GNU/Linux'
with latest python and postgresql

So please update pgadmin4 to 3.2

Offline

#11 2018-08-20 09:05:32

marksievers
Member
Registered: 2017-08-22
Posts: 10

Re: Unable to start pgadmin4 after python and pgadmin update

Note this is being tracked on the packages bug reports.

https://bugs.archlinux.org/task/59575?p … g=pgadmin4

Offline

#12 2018-08-20 19:31:04

jmbull
Member
Registered: 2018-08-09
Posts: 2

Re: Unable to start pgadmin4 after python and pgadmin update

BTW I don't know about pgadmin4 4.3,

Ha! pgadmin4 3.2... Thanks, I corrected that above.

Offline

#13 2018-08-28 22:38:28

marksievers
Member
Registered: 2017-08-22
Posts: 10

Re: Unable to start pgadmin4 after python and pgadmin update

Resolved in the latest release, pgadmin4 3.2-1

Offline

#14 2018-08-30 11:59:26

Quatro
Member
From: Portugal
Registered: 2013-06-14
Posts: 24

Re: Unable to start pgadmin4 after python and pgadmin update

Tray icon issue is solved, but I'm having another issue that a user also reported on the package bug report page: https://bugs.archlinux.org/task/59575#comment172627

I'm guessing it has something to do with the setup of the virtualenv.

Pasting the issue here:
```
$ pgadmin4
Python path: "/usr/lib/pgadmin4/venv/lib/python3.6/site-packages:/usr/lib/python3.6/site-packages:/usr/lib/python3.6"
Python Home: "/usr/lib/pgadmin4/venv"
Fatal Python error: initfsencoding: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f6e5a5ddc80 (most recent call first):
Aborted (core dumped)
```

Offline

#15 2018-09-14 15:22:02

Yaa101
Member
Registered: 2018-09-14
Posts: 1

Re: Unable to start pgadmin4 after python and pgadmin update

@Quatro:

I had the same issue, check your ~/.config/pgadmin/pgadmin4.conf
Under [General] you have a PythonPath= entry

Change:
PythonPath=/usr/lib/pgadmin4/venv/lib/python3.6/site-packages:/usr/lib/python3.6/site-packages:/usr/lib/python3.6
into:
PythonPath=/usr/lib/pgadmin4/venv/lib/python3.7/site-packages:/usr/lib/python3.7/site-packages:/usr/lib/python3.7

For me this worked, I first tried removing this configuration file altogether, it then writes no new file and defaults on python2.7

Hope this helped.

Offline

#16 2021-08-06 07:10:36

rahulnegi20
Member
Registered: 2021-08-06
Posts: 1

Re: Unable to start pgadmin4 after python and pgadmin update

Downgrading not working for me either sad,
tried DBeaver too its crashing without any log too
someone help please.

Thanks in Advance.

EDIT :

As someone mentioned above we can create our own web based pgadmin4 server it worked big_smile

source : https://www.pgadmin.org/download/pgadmin-4-python/

Last edited by rahulnegi20 (2021-08-06 07:23:42)

Offline

#17 2021-08-06 14:32:01

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 17,999

Re: Unable to start pgadmin4 after python and pgadmin update

rahulnegi20:
This is two year old thread, and I cannot tell if you solved your problem after the edit.  Regardless, I am going to invite you to open a your own thread (if you need to) and I will close this one.   If you think this thread relevant, you can refer back to this thread with a link.  Thanks.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB