The pgAdmin 4 server could not be contacted in Linux Mint 20.2 - postgresql

Folks i just installed pgAdmin 4 from here. But when i launch the application, it crashed, throwing me the following me error:
The pgAdmin 4 server could not be contacted:
pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "/usr/pgadmin4/venv/bin/python3"
Runtime Config File: "/home/toastedguy2/.config/pgadmin/runtime_config.json"
pgAdmin Config File: "/usr/pgadmin4/web/config.py"
Webapp Path: "/usr/pgadmin4/web/pgAdmin4.py"
pgAdmin Command: "/usr/pgadmin4/venv/bin/python3 -s /usr/pgadmin4/web/pgAdmin4.py"
Environment:
- GJS_DEBUG_TOPICS: JS ERROR;JS LOG
- LANGUAGE: en_US
- USER: toastedguy2
- XDG_SEAT: seat0
- XDG_SESSION_TYPE: x11
- SSH_AGENT_PID: 1388
- SHLVL: 0
- HOME: /home/toastedguy2
- DESKTOP_SESSION: cinnamon
- GIO_LAUNCHED_DESKTOP_FILE: /usr/share/applications/pgadmin4.desktop
- GTK_MODULES: gail:atk-bridge
- XDG_SEAT_PATH: /org/freedesktop/DisplayManager/Seat0
- LC_MONETARY: es_CR.UTF-8
- DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus
- CINNAMON_VERSION: 5.0.5
- GIO_LAUNCHED_DESKTOP_FILE_PID: 2430
- MANDATORY_PATH: /usr/share/gconf/cinnamon.mandatory.path
- QT_QPA_PLATFORMTHEME: qt5ct
- LOGNAME: toastedguy2
- XDG_SESSION_CLASS: user
- DEFAULTS_PATH: /usr/share/gconf/cinnamon.default.path
- XDG_SESSION_ID: c2
- GTK_OVERLAY_SCROLLING: 1
- GNOME_DESKTOP_SESSION_ID: this-is-deprecated
- PATH: /home/toastedguy2/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
- GDM_LANG: en_US
- GTK3_MODULES: xapp-gtk3-module
- SESSION_MANAGER: local/toastedguy2-MS-7A39:#/tmp/.ICE-unix/1316,unix/toastedguy2-MS-7A39:/tmp/.ICE-unix/1316
- XDG_SESSION_PATH: /org/freedesktop/DisplayManager/Session0
- LC_ADDRESS: es_CR.UTF-8
- XDG_RUNTIME_DIR: /run/user/1000
- DISPLAY: :0
- LANG: en_US.UTF-8
- LC_TELEPHONE: es_CR.UTF-8
- XDG_CURRENT_DESKTOP: X-Cinnamon
- XDG_SESSION_DESKTOP: cinnamon
- XAUTHORITY: /home/toastedguy2/.Xauthority
- XDG_GREETER_DATA_DIR: /var/lib/lightdm-data/toastedguy2
- SSH_AUTH_SOCK: /run/user/1000/keyring/ssh
- SHELL: /bin/bash
- LC_NAME: es_CR.UTF-8
- QT_ACCESSIBILITY: 1
- GDMSESSION: cinnamon
- LC_MEASUREMENT: es_CR.UTF-8
- GPG_AGENT_INFO: /run/user/1000/gnupg/S.gpg-agent:0:1
- LC_IDENTIFICATION: es_CR.UTF-8
- GJS_DEBUG_OUTPUT: stderr
- XDG_VTNR: 7
- PWD: /home/toastedguy2
- XDG_CONFIG_DIRS: /etc/xdg/xdg-cinnamon:/etc/xdg
- XDG_DATA_DIRS: /usr/share/cinnamon:/usr/share/gnome:/home/toastedguy2/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
- LC_NUMERIC: es_CR.UTF-8
- LC_PAPER: es_CR.UTF-8
- GDK_BACKEND: x11
- NO_AT_BRIDGE: 1
- PGADMIN_INT_PORT: 42741
- PGADMIN_INT_KEY: 06b1e235-ddd0-4070-9ac4-476a972202a2
- PGADMIN_SERVER_MODE: OFF
--------------------------------------------------------
Failed to launch pgAdmin4. Error:
Error: spawn /usr/pgadmin4/venv/bin/python3 ENOENT
How do i fixed it folks?
Notes:
My OS is: Linux Mint 20.2
PostgreSQL version: 12.8 (exact version by executing psql --version is: psql (PostgreSQL) 12.8 (Ubuntu 12.8-0ubuntu0.20.04.1).
PostgreSQL service is active.

After upgrading from Ubuntu 21.10 to Ubuntu 22.04 (and as a result upgrading Python 3.9 to 3.10), I had the same error. While at first it seemed the issue was that the python 3.9 symlinks inside /usr/pgadmin4 were no longer linking to the correct place - but fixing those was not enough to solve the issue. It turned out that there were more dependencies to take care of.
The proper solution was that I needed to update the apt source URI link inside "Ubuntu Software & Updates" to point to the newer Ubuntu jammy apt URI:
from https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/impish
to https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy
As soon as I did that, and reinstalled pgadmin4-desktop and pgadmin4-server using apt remove and apt install, it had all the required dependencies and all worked.

All I had to do was:
sudo apt remove pgadmin4-server
sudo apt install pgadmin4-server
sudo apt install pgadmin4-desktop

Related

Git, Conda - How can I "pip install git+git:<repo>" with the new Git policies in place?

I have this conda yml file for installing dependencies and creating a new conda env.
conda_env.yml forked from https://github.com/MishaLaskin/rad:
name: rad
channels:
- defaults
dependencies:
- python=3.6
- pytorch
- torchvision
- cudatoolkit=9.2
- absl-py
- pyparsing
- pillow=6.1
- pip:
- termcolor
- git+git://github.com/deepmind/dm_control.git
- git+git://github.com/1nadequacy/dmc2gym.git
- tb-nightly
- imageio
- imageio-ffmpeg
- torchvision
- scikit-image
- tabulate
I try to run conda env create --file conda_env.yml and here's the stack trace I get.
Collecting package metadata (repodata.json): done
Solving environment: done
Installing pip dependencies: - Ran pip subprocess with arguments:
['/home/dyung6/anaconda3/envs/rad/bin/python', '-m', 'pip', 'install', '-U', '-r', '/home/dyung6/rad/condaenv.835gcx7g.requirements.txt']
Pip subprocess output:
Collecting git+git://github.com/deepmind/dm_control.git (from -r /home/dyung6/rad/condaenv.835gcx7g.requirements.txt (line 2))
Cloning git://github.com/deepmind/dm_control.git to /tmp/pip-req-build-nc4w5hv8
Pip subprocess error:
Running command git clone -q git://github.com/deepmind/dm_control.git /tmp/pip-req-build-nc4w5hv8
fatal: remote error:
The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
WARNING: Discarding git+git://github.com/deepmind/dm_control.git. Command errored out with exit status 128: git clone -q git://github.com/deepmind/dm_control.git /tmp/pip-req-build-nc4w5hv8 Check the logs for full command output.
ERROR: Command errored out with exit status 128: git clone -q git://github.com/deepmind/dm_control.git /tmp/pip-req-build-nc4w5hv8 Check the logs for full command output.
failed
CondaEnvException: Pip failed
Seems like the new git policies block you from doing this. Is there anyway around this?
As #torek points out, and the documentation directed to in the error message explains, the git:// protocol has phased out on GitHub. Switch to using https://, i.e., in this case:
- pip:
- git+https://github.com/deepmind/dm_control.git
- git+https://github.com/1nadequacy/dmc2gym.git
...

Protractor tests are not running in gitlab-ci after Google Chrome updated to version 75 yesterday. It worked before the update. What happened?

I am running a scheduled job in gitlab to run protractor tests on an application on Google Chrome. These tests were working along nicely until yesterday June 04, 2019 where Google updated chrome from version 74 to version 75. Now I am getting a "W/launcher - Ignoring uncaught error WebDriverError: Unable to parse new session response" issue since the update.
This is run on the gitlab ci environment. I don't use webdriver-manager, my team really needs me to use docker-compose to create a selenium grid. I don't really know where to start fixing this issue.
test:
stage: test
before_script:
- apk add py-pip
- pip install --upgrade pip
- pip install docker-compose==1.23.2
- docker login -u $DOCKERHUB_REGISTRY_USER -p $DOCKERHUB_REGISTRY_PASSWORD
- echo "//registry.npmjs.org/:_authToken=\${NPM_HAVENBUILD_AUTH_TOKEN}" > .npmrc
- npm install
- npm config set unsafe-perm true
- npm install -g protractor
- npm install -g protractor-console
- npm config set unsafe-perm falsesh
- ./node_modules/.bin/gulp
script:
- docker-compose up -d
- docker-compose scale chrome=2
- ./node_modules/.bin/protractor TestFiles/HConf.js --suite client --testname Happy_Path --env uat
This is the error I am getting:
[19:53:28] I/hosted - Using the selenium server at http://docker-dind:4444/wd/hub
[19:53:28] W/launcher - Ignoring uncaught error WebDriverError: Unable to parse new session response: {
"value": {
"sessionId": "d8b6ab9a6e301a943203e8af49aec285",
"capabilities": {
"acceptInsecureCerts": false,
"browserName": "chrome",
"browserVersion": "75.0.3770.80",
"chrome": {
"chromedriverVersion": "75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd300-refs\u002fbranch-heads\u002f3770#{#40})",
"userDataDir": "\u002ftmp\u002f.com.google.Chrome.zQzfpf"
},
"goog:chromeOptions": {
"debuggerAddress": "localhost:46326"
},
"networkConnectionEnabled": false,
"pageLoadStrategy": "normal",
"platformName": "linux",
"proxy": {
},
"setWindowRect": true,
"strictFileInteractability": false,
"timeouts": {
"implicit": 0,
"pageLoad": 300000,
"script": 30000
},
"unhandledPromptBehavior": "dismiss and notify",
"webdriver.remote.sessionid": "d8b6ab9a6e301a943203e8af49aec285"
}
}
}
[19:53:28] E/launcher - BUG: launcher exited with 1 tasks remaining
I am suppose to have the protractor tests run insead of this after it starts using the selenium server.
Does anyone know what the issue is?

Salt Stack: Function: pkg.installed. Yum does not update installed package

My code is:
others:
pkg.installed:
- sources:
- epel-release: https://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/epel-release-6-5.noarch.rpm
- salt-latest: https://repo.saltstack.com/yum/redhat/salt-repo-latest-2.el6.noarch.rpm
and I'm getting error:
errors:
- Loaded plugins: fastestmirror, replace
Setting up Install Process
Examining /var/cache/salt/minion/extrn_files/base/repo.saltstack.com/yum/redhat/salt-repo-latest-2.el6.noarch.rpm: salt-repo-latest-2.el6.noarch
/var/cache/salt/minion/extrn_files/base/repo.saltstack.com/yum/redhat/salt-repo-latest-2.el6.noarch.rpm: does not update installed package.
Error: Nothing to do
I thinkt that may be a problem with salt-repo-latest-2.el6.noarch.rpm. When I manually run yum install for this RPM's I'm getting the same error but running in Salt Stack only getting this error.
It should end with:
ID: others
Function: pkg.installed
Result: True
Comment: All specified packages are already installed
Started: 10:45:33.171971
Duration: 595.672 ms
Changes:
but I'm getting:
ID: others
Function: pkg.installed
Result: False
Comment: Error occurred installing package(s). Additional info follows:
errors:
- Loaded plugins: fastestmirror, replace
Setting up Install Process
Examining /var/cache/salt/minion/extrn_files/base/repo.saltstack.com/yum/redhat/salt-repo-latest-2.el6.noarch.rpm: salt-repo-latest-2.el6.noarch
/var/cache/salt/minion/extrn_files/base/repo.saltstack.com/yum/redhat/salt-repo-latest-2.el6.noarch.rpm: does not update installed package.
Error: Nothing to do
Started: 10:46:13.906581
Duration: 8988.515 ms
Changes:
The package name is salt-repo not salt-latest.
Code should be:
others:
pkg.installed:
- sources:
- epel-release: https://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/epel-release-6-5.noarch.rpm
- salt-repo: https://repo.saltstack.com/yum/redhat/salt-repo-latest-2.el6.noarch.rpm

letsencrypt-auto certonly does'nt work

no matter which command I use with ./letsencypt-auto the result is always the same as blew, am I missing something here.
here is an output on ./letsencrypt-auto certonly.
[root#tipsycore letsencrypt]# ./letsencrypt-auto certonly
#Bootstrapping dependencies for RedHat-based OSes...
#yum is /usr/bin/yum
#Loaded plugins: fastestmirror, refresh-packagekit, security
#Setting up Install Process
#Loading mirror speeds from cached hostfile
# * base: mirror.zetup.net
# * epel: ftp.lysator.liu.se
# * extras: mirror.zetup.net
# * updates: mirror.zetup.net
#Package python-2.6.6-64.el6.x86_64 already installed and latest version
#Package python-devel-2.6.6-64.el6.x86_64 already installed and latest #version
#Package python-virtualenv-1.10.1-1.el6.noarch already installed and latest #version
#Nothing to do
#Loaded plugins: fastestmirror, refresh-packagekit, security
#Setting up Install Process
#Loading mirror speeds from cached hostfile
# * base: mirror.zetup.net
# * epel: ftp.lysator.liu.se
# * extras: mirror.zetup.net
# * updates: mirror.zetup.net
#Package gcc-4.4.7-16.el6.x86_64 already installed and latest version
#Package dialog-1.1-9.20080819.1.el6.x86_64 already installed and latest #version
#Package augeas-libs-1.0.0-10.el6.x86_64 already installed and latest version
#Package openssl-devel-1.0.1e-42.el6_7.2.x86_64 already installed and latest #version
#Package libffi-devel-3.0.5-3.2.el6.x86_64 already installed and latest #version
#Package redhat-rpm-config-9.0.3-44.el6.centos.noarch already installed and #latest version
#Package ca-certificates-2015.2.4-65.0.1.el6_6.noarch already installed and #latest version
#Nothing to do
#Loaded plugins: fastestmirror, refresh-packagekit, security
#Setting up Install Process
#Loading mirror speeds from cached hostfile
# * base: mirror.zetup.net
# * epel: ftp.lysator.liu.se
# * extras: mirror.zetup.net
# * updates: mirror.zetup.net
#Package 2:mod_ssl-2.2.15-47.el6.vm.x86_64 already installed and latest #version
#Nothing to do
#WARNING: Python 2.6 support is very experimental at present...
#if you would like to work on improving it, please ensure you have backups
#and then run this script again with the --debug flag!
#[root#tipsycore letsencrypt]#
Try this:
Lets encrypt Centos 6
# yum install centos-release-SCL
# yum install python27 python27-python-devel python27-python-setuptools python27-python-tools python27-python-virtualenv
# ln -s /opt/rh/python27/root/usr/lib64/libpython2.7.so.1.0 /usr/lib64/libpython2.7.so.1.0
# ln -s /opt/rh/python27/root/usr/lib64/libpython2.7.so.1.0 /usr/lib64/libpython2.7.so
# ll /usr/lib64/libpyt*
lrwxrwxrwx. 1 root root 19 Aug 22 2016 /usr/lib64/libpython2.6.so -> libpython2.6.so.1.0
-r-xr-xr-x. 1 root root 1669840 Aug 18 2016 /usr/lib64/libpython2.6.so.1.0
lrwxrwxrwx 1 root root 51 Mar 1 17:59 /usr/lib64/libpython2.7.so -> /opt/rh/python27/root/usr/lib64/libpython2.7.so.1.0
lrwxrwxrwx 1 root root 51 Mar 1 17:59 /usr/lib64/libpython2.7.so.1.0 -> /opt/rh/python27/root/usr/lib64/libpython2.7.so.1.0
# /opt/rh/python27/root/usr/bin/python2.7 -V
Python 2.7.8
# vim ~/.bash_profile
PATH=/opt/rh/python27/root/usr/bin/:$PATH:$HOME/bin
export PATH
# python -V
Python 2.6.6
# source ~/.bash_profile
# python -V
Python 2.7.8
# git clone https://github.com/letsencrypt/letsencrypt
# cd /opt/letsencrypt/
# service nginx stop
# ./letsencrypt-auto certonly --standalone -d <YOUR_DOMAIN.COM>
The problem is (somewhat confusingly) described by the last message you get in the output from letsencrypt-auto:
#WARNING: Python 2.6 support is very experimental at present...
#if you would like to work on improving it, please ensure you have backups
#and then run this script again with the --debug flag!
The LetsEncrypt client you are running requires Python 2.7 or above. You have Python 2.6 installed. I have a blog post describing the way I solved this problem: https://thelastcicada.com/solving-the-python-2-6-issue-for-letencrypt-on-centos-6. Below I will go into further detail and summarize my solution.
I'm going to assume from this issue and the output of your letsencrypt-auto that you are running CentOS 6 or a similar RHEL6-based operating system. This is important because systems tools on CentOS 6 are all based on Python 2.6 (yum in particular is) and your system can therefore not upgrade safely past Python 2.6. CentOS 7 doesn't have this problem and comes packaged with a newer version of Python.
To solve this on CentOS 6, you could run letsencrypt-auto --debug, as noted in the error message, but that just allows you to run the experimental Python 2.6 code that isn't yet well supported. Alternatively, you can use Software Collections to install Python 2.7 on CentOS 6 in it's own environment that can run alongside Python 2.6 and not mess up your system's default Python installation.
The basic steps are:
yum install centos-release-SCL to install the Software Collections package
yum install python27 to install Python 2.7
scl enable python27 "/root/letsencrypt/letsencrypt-auto certonly --agree-tos --webroot --webroot-path /var/www/html/mywebsite.com -d mywebsite.com" to run the LetsEncrypt client using the Python 2.7 version via Software Collections. The flags passed to letsencrypt-auto are typical ones I use when requesting an SSL certificate to install with Nginx - your configuration my vary.
Hope this helps and good luck!

Unable to run fastri on cygwin: uninitialized constant Gem::Version (NameError)

I'm trying to setup fastri (http://eigenclass.org/hiki/fastri) on emacs running on cygwin in windows. The ruby install is also from cygwin, not the windows version of ruby.
After downloading, unpacking the tarball and running setup.rb, when I attempt to run qri or fri, I get the following error message:
[/cygdrive/g]$qri
/usr/lib/ruby/1.8/rdoc/ri/ri_paths.rb:63: uninitialized constant Gem::Version (NameError)
from /usr/lib/ruby/1.8/rdoc/ri/ri_paths.rb:59:in `each'
from /usr/lib/ruby/1.8/rdoc/ri/ri_paths.rb:59
from /usr/lib/ruby/site_ruby/1.8/fastri/util.rb:38:in `require'
from /usr/lib/ruby/site_ruby/1.8/fastri/util.rb:38
from /usr/bin/qri:6:in `require'
from /usr/bin/qri:6
My ruby version and gem environment:
[/cygdrive/g]$ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
[/cygdrive/g]$gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.4
- RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby.exe
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-cygwin
- GEM PATHS:
- /usr/lib/ruby/gems/1.8
- /home/rrajagop/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/
I took a look at ri_paths.rb to figure out how Gem::Version should be included in the file, but I couldn't figure it out. I tried adding both require 'gem/version' and require 'version' in ri_paths.rb, but no joy. I get 'require': no such file to load -- version (LoadError)
Ok, I finally got it working.
Adding require 'rubygems/version' in ri_path.rb fixed it.
Basically, used puts $: to figure out the paths that require will search thru', found out where Gem::Version was defined (I already had a pre-built tags table for ruby and all my gems, so this was easy), and worked out the path to version from the closest component of the search path. Sounds simple, right? Of course, all this took me a couple of days, the ruby noob that I am.