Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 794460 - dev-db/pgadmin4-6.3 version bump
Summary: dev-db/pgadmin4-6.3 version bump
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 3 votes (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords: PMASKED
Depends on:
Blocks: 774348 817350 836282
  Show dependency tree
 
Reported: 2021-06-05 14:31 UTC by Jonas Stein
Modified: 2022-10-24 05:26 UTC (History)
20 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
draft ebuild (pgadmin4-5.6.ebuild,4.93 KB, text/plain)
2021-08-22 22:39 UTC, Jack
Details
updated proposed ebuild (pgadmin4-5.6.ebuild,5.89 KB, text/plain)
2021-08-27 23:57 UTC, Jack
Details
Updated ebuild for 5.7 (pgadmin4-5.7.ebuild,6.04 KB, text/plain)
2021-09-17 20:19 UTC, Jack
Details
working ebuild for 6.3 (pgadmin4-6.3.ebuild,5.87 KB, text/plain)
2022-02-17 22:27 UTC, Jack
Details
ebuild for 6.5 - doesn't run (pgadmin4-6.5.ebuild,4.96 KB, text/plain)
2022-02-17 22:36 UTC, Jack
Details
pgadmin4-6.5.ebuild (pgadmin4-6.5.ebuild,6.60 KB, text/plain)
2022-02-23 12:10 UTC, Fat-Zer
Details
preliminary ebuild for pgadmin4-bin-6.8 (pgadmin4-bin-6.8.ebuild,3.51 KB, text/plain)
2022-04-27 17:25 UTC, Jack
Details
Working 6.9 ebuild (pgadmin4-6.9.ebuild,4.52 KB, text/plain)
2022-05-15 13:28 UTC, EFI
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Stein gentoo-dev 2021-06-05 14:31:47 UTC
https://www.pgadmin.org/docs/pgadmin4/latest/release_notes.html
please bump

Reproducible: Always
Comment 1 Andriy Utkin (RETIRED) gentoo-dev 2021-08-03 14:01:37 UTC
Yes please.
Mechanic verbumping doesn't work.
Trying to install 5.5 or 5.3 fails this way:

>>> Configuring source in /var/tmp/portage/dev-db/pgadmin4-5.3/work/pgadmin4-5.3/runtime ...
 * Running qmake ...
Usage: /usr/lib64/qt5/bin/qmake [mode] [options] [files]

QMake has two modes, one mode for generating project files based on
some heuristics, and the other for generating makefiles. Normally you
shouldn't need to specify a mode, as makefile generation is the default
mode for qmake, but you may use this to test qmake on an existing project
...
Comment 2 Andriy Utkin (RETIRED) gentoo-dev 2021-08-07 09:32:29 UTC
Seems like the cause of that is that all the stuff under runtime/ has been replaced with a new JS-based codebase, so its treatment has to be different, but I don't yet understand how it has to be treated.
Comment 3 Jack 2021-08-22 17:43:27 UTC
I'm trying on 5.6.  README.md says you need nodejs 12+ and yarn, and need to "cd runtime" and "yarn install," which doesn't work in the sandbox.
Comment 4 Jack 2021-08-22 21:21:53 UTC
I've got partial success, although I'm sure I'm breaking many ebuild rules.  I'll attach a potential ebuild once I actually have it running - I'm currently stuck getting the python socketio working.
Comment 5 Jack 2021-08-22 22:39:46 UTC
Created attachment 735184 [details]
draft ebuild

I'm about to give up for a while.  The attached ebuild does build and install something that almost works.  The basic changes from old ebuilds were following the README.md on using yarn.  I then modified the src_install to install both the web and runtime folders, as well as some other needed files.
My big problem is that this version seems to have a lot of new dependencies, many of which are not packaged for Gentoo.  I managed to create ebuilds for flask-socketio and python-socketio. and the next one seems to be bidict.  I would probably also install the README as an initial doc.
Comment 6 Jack 2021-08-27 23:57:36 UTC
Created attachment 736318 [details]
updated proposed ebuild

It was quite an adventure, but I attach an ebuild that installs something that actually seems to run correctly.

I had to create ebuilds for authlib, bidict, flask-socketio, httpagentparser, python-socketio, socketio, ua-parser, and user-agents (all in dev-python.)  I'll be glad to post them, but all are pretty trivial, using the pypi.org project page as home page, and their specific download line as SRC_URI.  Most also have a github presence, which I mostly ignored.  I think one needed a MY_P to handle capitalization differing between the package name and the actual source dir name from the tarball.

I had hoped to use >dev-python/flask-2.0 but at some point needed to revert to <=.

The old issue of an error related to psycopg came back - but it turns out the requirements.txt calls for 2.8, and gentoo currently has 2.9, so I manually edited /usr/share/pgadmin4/web/pgamin/utils/driver/psycopge/cursor.py (line 97) to explicitly refer to 2.9 instead of 2.8.  I know it should be done prior to installation - but I would hope there is a way to make it resiliant to further version upgrades.

One last oddity - it launches in it's own window - not in a browser.  I have no idea if that is configurable or not, although I assume it is.
Comment 7 François Valenduc 2021-08-30 17:11:17 UTC
This ebuild doesn't seems to work. First, yarn is missing in the dependencies. I have installed it but then I get this problem:

yarn install v1.22.10
[1/4] Resolving packages...
info There appears to be trouble with your network connection. Retrying...
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz: getaddrinfo ENOTFOUND registry.yarnpkg.com".
info If you think this is a bug, please open a bug report with the information provided in "/var/tmp/portage/dev-db/pgadmin4-5.6/work/pgadmin4-5.6/runtime/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...

However, my internet connection is working perfectly.
Any ideas on what is happening ?
Comment 8 Jack 2021-08-30 18:34:57 UTC
Yes, yarn needs to be added as BDEPEND.  Many of the dependencies will not prevent installation, but will end up showing an error when you launch.

I have no idea what the yarn problem could be, as it still works fine for me.  Is there anything interesting in the yarn-error.log file (if there is one?)  Do you have any sort of firewall in place which might affect outgoing connections?
Comment 9 François Valenduc 2021-08-30 19:32:56 UTC
I found that in the yarn.log file:

Trace: 
  Error: getaddrinfo ENOTFOUND registry.yarnpkg.com
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:69:26)
Comment 10 Jack 2021-08-30 22:44:05 UTC
Can you ping that address?  I have no problems.  Are you behind some sort of corporate firewall which might be filtering?
Comment 11 Jack 2021-09-17 20:19:59 UTC
Created attachment 739731 [details]
Updated ebuild for 5.7

Updated ebuild for 5.7.  I've added BDEPEND with yarn, and added some additional RDEPENDS mentioned in requirements.txt, but which probably got pulled in previously as indirect dependencies.
Comment 12 Aurelien Minet 2021-10-06 12:37:31 UTC
(In reply to François Valenduc from comment #7)
> This ebuild doesn't seems to work. First, yarn is missing in the
> dependencies. I have installed it but then I get this problem:
> 
> yarn install v1.22.10
> [1/4] Resolving packages...
> info There appears to be trouble with your network connection. Retrying...
> [2/4] Fetching packages...
> info There appears to be trouble with your network connection. Retrying...
> info There appears to be trouble with your network connection. Retrying...
> info There appears to be trouble with your network connection. Retrying...
> info There appears to be trouble with your network connection. Retrying...
> error An unexpected error occurred:
> "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz: getaddrinfo
> ENOTFOUND registry.yarnpkg.com".
> info If you think this is a bug, please open a bug report with the
> information provided in
> "/var/tmp/portage/dev-db/pgadmin4-5.6/work/pgadmin4-5.6/runtime/yarn-error.
> log".
> info Visit https://yarnpkg.com/en/docs/cli/install for documentation about
> this command.
> info There appears to be trouble with your network connection. Retrying...
> info There appears to be trouble with your network connection. Retrying...
> info There appears to be trouble with your network connection. Retrying...
> 
> However, my internet connection is working perfectly.
> Any ideas on what is happening ?

Hello Francois,

I tested the last version of the build and got the same problem.
For security reason, ebuild/portage doesn't allow to download anything except at the fetch phase (SRC_URI stuff). The build is done in a sandbox that prevent IP communication (even DNS resolution).
All must be downloaded before (in  src_unpack() it maybe possible to do some git call).

A tool like https://github.com/zaufi/npm2ebuild but for yarn would help.
A yarn eclass would be great (like the ones for npm https://github.com/Jannis234/jm-overlay/blob/master/eclass/node.eclass https://github.com/Alessandro-Barbieri/node-overlay/blob/main/eclass/node.eclass).

The workaround at the moment is to disable in make.conf the network-sandbox FEATURES = "sandbox  ... -network-sandbox" , but only for this emerge (as it's not good for security)

Regards

Aurélien
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-24 07:37:52 UTC
ping pgsql-bugs@
Comment 14 Jaak Ristioja 2022-01-27 13:14:03 UTC
pgAdmin 4 v6.4 was also released on January 13.
Comment 15 Fat-Zer 2022-02-14 04:34:59 UTC
pgAdmin 4 v6.5 was released on February 11.
Comment 16 Jack 2022-02-17 22:27:40 UTC
Created attachment 765325 [details]
working ebuild for 6.3

This is the most recent version which actually works for me.
Comment 17 Jack 2022-02-17 22:36:04 UTC
Created attachment 765326 [details]
ebuild for 6.5 - doesn't run

This ebuild emerges without complaint, but on trying to run, gives an error pointing to line 32 of /usr/share/pgadmin4/web/pgadmin/utils/csrf.py.  That is in the middle of
     exempt_views = [
            'pgadmin.tools.translations',
            app.blueprints['redirects'],
            'pgadmin.tools.psql.panel',
        ]
with a KeyError on redirects.  I've removed several lines like the first and last.

/usr/share/pgadmin4/web/pgadmin/redirects/__init__.py seems to be where that blueprint is set up, but I don't know enough python to really follow what's going on.  Version 6.4 failed for me in exactly the same way.

Note that this does require FEATURES="-network-sandbox" to emerge.  I don't know any way around this potential security risk, other than packaging the result as an essentially "binary" package.
Comment 18 Fat-Zer 2022-02-23 12:10:09 UTC
Created attachment 765708 [details]
pgadmin4-6.5.ebuild

A working ebuild for pgadmin4-6.5. Note that it doesn't actually differs a lot from the one provided by Jack. But It has a lot of python dependencies that are not currently in portage. I've created a small repository with all required dependencies for testing purposes: https://github.com/Fat-Zer/gentoo-pgadmin4-test

I can confirm that the pgAdmin4 installs, runs and connects to a postgres server and is able to execute simple queries, though I haven't performed any extensive testing.

As for now it still requires the FEATURES="-network-sandbox". But it can be somewhat overcome. It actually uses the network for 2 reasons:
* to download yarn packages
* to download nwjs binary

The first one can be pretty easily overcome by tar'ing the yarn-cache and providing it among distfiles.

The second one is actually a bit of a problem: [nwjs][1] is a js framework for creating desktop apps in html/javascript based on Chromium. Support its build from sources will probably be a bit of a hassle (as I suspect it would require efforts comparable to chromium)... On the other hand we can just supply a binary blob either as a separate package or as a part of pgadmin4.

I'm looking forward to here an opinion on this issue from experienced gentoo devs.

[1]: https://github.com/nwjs/nw.js
Comment 19 Jaak Ristioja 2022-03-17 08:46:23 UTC
pgAdmin 6.7 was released on March 14, and includes a security fix for CVE-2022-0959.
Comment 20 Aaron W. Swenson gentoo-dev 2022-03-17 16:24:34 UTC
(In reply to Fat-Zer from comment #18)
> Created attachment 765708 [details]
> pgadmin4-6.5.ebuild
> 
> A working ebuild for pgadmin4-6.5. Note that it doesn't actually differs a
> lot from the one provided by Jack. But It has a lot of python dependencies
> that are not currently in portage. I've created a small repository with all
> required dependencies for testing purposes:
> https://github.com/Fat-Zer/gentoo-pgadmin4-test
> 
> I can confirm that the pgAdmin4 installs, runs and connects to a postgres
> server and is able to execute simple queries, though I haven't performed any
> extensive testing.
> 
> As for now it still requires the FEATURES="-network-sandbox". But it can be
> somewhat overcome. It actually uses the network for 2 reasons:
> * to download yarn packages
> * to download nwjs binary
> 
> The first one can be pretty easily overcome by tar'ing the yarn-cache and
> providing it among distfiles.
> 
> The second one is actually a bit of a problem: [nwjs][1] is a js framework
> for creating desktop apps in html/javascript based on Chromium. Support its
> build from sources will probably be a bit of a hassle (as I suspect it would
> require efforts comparable to chromium)... On the other hand we can just
> supply a binary blob either as a separate package or as a part of pgadmin4.
> 
> I'm looking forward to here an opinion on this issue from experienced gentoo
> devs.
> 
> [1]: https://github.com/nwjs/nw.js

Without something like the cargo.eclass, I think the FEATURES="-network-sandbox" is a bit of a deal breaker. If we add it as is, it would be the only package in ::gentoo that needs -network-sandbox to install.

Given the direction upstream is going, I think it's best to remove pgAdmin from the tree, or change how we support it.

Rather than eliminate it altogether, it could be moved to ::guru where the policies/practices are a little more lenient. I'm not involved in ::guru, so someone else will need to ask.

Alternatively, we could modify it into a meta ebuild that will pull most of the system dependencies in. It would avoid the need for -network-sandbox, but would then need to direct users to install it themselves.

Either way, at this time, I'm leaning towards masking for removal fairly soon.
Comment 21 Jack 2022-03-18 23:16:36 UTC
What alternatives are there?  I've tried playing with installing with pip, but have not gotten it to run yet, due to various permissions issues, and not yet finding the right config files to change.  Even that doesn't lead (that I can tell) to a safe way to create an ebuild.  Is there any (reasonable) way to create an ebuild that uses the rpm or deb (or whatever) file from some other distro?
Comment 22 Ludwid Reyes 2022-04-06 01:31:47 UTC
(In reply to Jack from comment #21)
> What alternatives are there?  I've tried playing with installing with pip,
> but have not gotten it to run yet, due to various permissions issues, and
> not yet finding the right config files to change.  Even that doesn't lead
> (that I can tell) to a safe way to create an ebuild.  Is there any
> (reasonable) way to create an ebuild that uses the rpm or deb (or whatever)
> file from some other distro?

I installed, and it works using the Anaconda distribution of Python. At least it did for me.

Anaconda Installation:
https://docs.anaconda.com/anaconda/install/linux/


upgraded anaconda:
conda update --all

downgrade Jinja2 to 3.0.0
pip install jinja2==3.0.0

Install pgadmin4:
pip install pgadmin4==6.7

edit config file:
~/anaconda3/lib/python3.9/site-packages/pgadmin4/

Change the paths for LOG_FILE,SQLITE_PATH,SESSION_DB_PATH, and STORAGE_DIR to somewhere in your home directory.

Then when you launch pgadmin4 it will prompt you for a username and password.

To uninstall Anaconda:
https://docs.anaconda.com/anaconda/install/uninstall/

In my opinion, I would always prefer a solution that works with portage, but if they do decide to remove it, at least this works (at least it did for me).
Comment 23 Ludwid Reyes 2022-04-06 01:34:00 UTC
(In reply to Ludwid Reyes from comment #22)
> (In reply to Jack from comment #21)
> > What alternatives are there?  I've tried playing with installing with pip,
> > but have not gotten it to run yet, due to various permissions issues, and
> > not yet finding the right config files to change.  Even that doesn't lead
> > (that I can tell) to a safe way to create an ebuild.  Is there any
> > (reasonable) way to create an ebuild that uses the rpm or deb (or whatever)
> > file from some other distro?
> 
> I installed, and it works using the Anaconda distribution of Python. At
> least it did for me.
> 
> Anaconda Installation:
> https://docs.anaconda.com/anaconda/install/linux/
> 
> 
> upgraded anaconda:
> conda update --all
> 
> downgrade Jinja2 to 3.0.0
> pip install jinja2==3.0.0
> 
> Install pgadmin4:
> pip install pgadmin4==6.7
> 
> edit config file:
> ~/anaconda3/lib/python3.9/site-packages/pgadmin4/
> 
> Change the paths for LOG_FILE,SQLITE_PATH,SESSION_DB_PATH, and STORAGE_DIR
> to somewhere in your home directory.
> 
> Then when you launch pgadmin4 it will prompt you for a username and password.
> 
> To uninstall Anaconda:
> https://docs.anaconda.com/anaconda/install/uninstall/
> 
> In my opinion, I would always prefer a solution that works with portage, but
> if they do decide to remove it, at least this works (at least it did for me).

The config file will be located at ~/anaconda3/lib/python3.9/site-packages/pgadmin4/config.py
Comment 24 Ludwid Reyes 2022-04-27 17:03:03 UTC
https://community.rstudio.com/t/rstudio-does-not-start-in-ubuntu-21-10/115852

It looks like rstudio also needs the --no-sandbox flag as well, so pgadmin4 wouldn't be the only package that needs it.
Comment 25 Jack 2022-04-27 17:25:39 UTC
Created attachment 775065 [details]
preliminary ebuild for pgadmin4-bin-6.8

I've attached a preliminary ebuild for 6.8 using the rpm files from the pgadmin4 site.  It's based on a previous version which used the fedora rpms.
It seems to run, but requires a login which I have not yet gotten to work.  I have depends from the earlier ebuild, as I don't see the various python dependencies listed in the new rpms I'm using.  This version needs python-3.10, and my current profile seems to set things to 3.9, so I had to add python_targets_python3_10 to several packages - this is not referenced in the ebuild itself.

Does anyone think this approach is even worth pursuing?
Comment 26 EFI 2022-05-15 13:28:21 UTC
Created attachment 779099 [details]
Working 6.9 ebuild
Comment 27 EFI 2022-05-15 13:29:18 UTC
Attached a working ebuild for 6.9.

I cannot get it work using system python packages because a issue in flask. So tried another aproach, treating it as binary package and fix symlinks and binary packages to use installed python version.

Works for me with python 3.9 and a up to date system. The only minor issue I found is when uninstall, that emerge show a warning about symlinks protection.

I hope it can help someone.
Comment 28 EFI 2022-05-15 13:46:56 UTC
An advice, for some reason it cannot upgrade existing config. So you need to remove ~/.pgadmin folder or rename the file ~/.pgadmin/pgadmin4.db

My previous version was 4.30.
Comment 29 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-12 09:44:54 UTC
(In reply to EFI from comment #27)
> Attached a working ebuild for 6.9.
> 
> I cannot get it work using system python packages because a issue in flask.
> So tried another aproach, treating it as binary package and fix symlinks and
> binary packages to use installed python version.
> 
> Works for me with python 3.9 and a up to date system. The only minor issue I
> found is when uninstall, that emerge show a warning about symlinks
> protection.
> 
> I hope it can help someone.

It's a bit gross (which is not your fault at all, it's the nature of the changes made upstream), but I think it could work.
Comment 30 Larry the Git Cow gentoo-dev 2022-06-19 09:06:33 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b0fa104cddcbb9dd7bca9351c2de58703939fcf

commit 8b0fa104cddcbb9dd7bca9351c2de58703939fcf
Author:     Jakov Smolić <jsmolic@gentoo.org>
AuthorDate: 2022-06-19 08:51:37 +0000
Commit:     Jakov Smolić <jsmolic@gentoo.org>
CommitDate: 2022-06-19 08:51:53 +0000

    dev-db/pgadmin4: treeclean
    
    Closes: https://bugs.gentoo.org/794460
    Closes: https://bugs.gentoo.org/836282
    Closes: https://bugs.gentoo.org/774348
    Closes: https://bugs.gentoo.org/766378
    Closes: https://bugs.gentoo.org/817350
    Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>

 dev-db/pgadmin4/Manifest                |   2 -
 dev-db/pgadmin4/files/pgadmin4.desktop  |  11 ---
 dev-db/pgadmin4/metadata.xml            |   8 --
 dev-db/pgadmin4/pgadmin4-4.29-r3.ebuild | 130 -------------------------------
 dev-db/pgadmin4/pgadmin4-4.30-r3.ebuild | 132 --------------------------------
 profiles/package.mask                   |   6 --
 6 files changed, 289 deletions(-)