pgAdmin4: "can only concatenate str (not "NoneType") to str" - pgadmin-4

Using pgAdmin4, but whenever I choose to view the create script of available views I get the above error. Also, if I choose to see view's SELECT script, to only shows [object Object]
# View -> Scripts -> CREATE Script
can only concatenate str (not "NoneType") to str
# View -> Scripts -> SELECT Script
[object Object]
Any fix to this?
# version info
pgAmin4: version 6.15
# os
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy

It appears this issue was reported in pgadmin4 v4.12. Unfortunately, it resurfaced in v6.15. The workaround that work for me is to downgrade to v6.9
sudo apt -y remove pgadmin4
sudo apt -y autoremove pgadmin4*
sudo apt -y install pgadmin4*=6.9 pgadmin4-server*=6.9
# Configure the webserver, if you installed pgadmin4-web:
sudo /usr/pgadmin4/bin/setup-web.sh

Related

I got an illegal instruction when installing mongoDB when trying to check the version

Hey so I tried installing mongoDB and I can't get it to install correctly. I am installing it on wsl on a windows computer and I keep getting illegal instruction when I try to check the version and it won't let me finish installing it. Here are the instructions I used to install MongoDB (version 5.0) on WSL (Ubuntu 20.04):
Open your WSL terminal (ie. Ubuntu) and go to your home directory: cd ~
Update your Ubuntu packages: sudo apt update
Import the public key used by the MongoDB package management system: wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
Create a list file for MongoDB: echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
Reload local package database: sudo apt-get update
Install MongoDB packages: sudo apt-get install -y mongodb-org
Confirm installation and get the version number: mongod --version
Make a directory to store data: mkdir -p ~/data/db
Run a Mongo instance: sudo mongod --dbpath ~/data/db
Check to see that your MongoDB instance is running with: ps -e | grep 'mongod'
To exit the MongoDB Shell, use the shortcut keys: Ctrl + C

RHEL 8 Container MSSQL ODBC Driver e2fsprogs

I'm trying to build a custom docker container using the RHEL 8 UBI. As part of this I want to install the MSSQL 17 ODBC driver.
I've followed the steps outlined in Microsofts Documentation here:
https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#redhat17
And added the Microsoft repo to my yum.repos.d directory however when I try to build the container I get the following error: nothing provides e2fsprogs needed by msodbcsql17-17.6.1.1-1.x86_64
When I dug a bit further into this it looks as though it looks as though for RHEL-7 Microsoft suggest installing e2fsprogs manually you can see that here: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#offline-installation
This unfortunately isn't possible in RHEL-8 as e2fsprogs-static has been removed: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index#removed-packages_changes-to-packages
The full output from the build is:
$ docker build -f ./test.dockerfile -t daark:1 .
Sending build context to Docker daemon 25.77MB
Step 1/7 : FROM registry.redhat.io/ubi8/ubi
---> a1f8c9699786
Step 2/7 : RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
---> Using cache
---> 90b3e1514239
Step 3/7 : RUN yum search odbc
---> Using cache
---> b26f78d0da28
Step 4/7 : RUN yum search msodbcsql17
---> Using cache
---> c6f7751b97dc
Step 5/7 : ENV ACCEPT_EULA=Y
---> Using cache
---> 2b0003944673
Step 6/7 : RUN yum install -y unixODBC unixODBC-devel
---> Using cache
---> 1d0b8c594905
Step 7/7 : RUN yum install -y msodbcsql17
---> Running in 67c30e75fb42
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:08:11 ago on Wed Aug 5 09:36:32 2020.
Error:
Problem: cannot install the best candidate for the job
- nothing provides e2fsprogs needed by msodbcsql17-17.6.1.1-1.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
The command '/bin/sh -c yum install -y msodbcsql17' returned a non-zero code: 1
This error is pretty reproducible here is the test dockerfile i'm using to debug
FROM registry.redhat.io/ubi8/ubi
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
RUN yum search odbc
RUN yum search msodbcsql17
ENV ACCEPT_EULA=Y
RUN yum install -y unixODBC unixODBC-devel
RUN yum install -y msodbcsql17
Has anyone managed to get this ODBC driver installed on an RHEL 8 UBI based container?
I found a work around that I hope will help the next person to hit this.
Rather than running yum install -y msodbcsql17 I instead used yum to download the RPM
yum download -y msodbcsql17
then used rpm -Uvh --nodeps msodbcsql17*rpm to install it.
You can use this docker file:
FROM registry.redhat.io/ubi8/ubi
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
RUN yum search odbc
RUN yum search msodbcsql17
ENV ACCEPT_EULA=Y
RUN yum install -y unixODBC unixODBC-devel
RUN yum download -y msodbcsql17
RUN rpm -Uvh --nodeps msodbcsql17*rpm
#daark thank you for posting your solution. Your solution got me over the problem I was facing. I ended modifying your solution to the following (in case it helps anyone else):
FROM registry.access.redhat.com/ubi8/python-38
USER root
RUN yum update --assumeyes && \
yum install --assumeyes \
unixODBC-devel \
&& yum clean all
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
RUN yum download -y msodbcsql17
RUN ACCEPT_EULA=y rpm -Uvh --nodeps msodbcsql17*rpm
I tried to add this to the #daark's solution as a comment, but it was too difficult to display the code properly.
Good luck to anyone else facing this issue šŸ€
Latest msodbcsql17 release fixes this issue. The documentation steps work smooth once again. See docs issue
I can confirm that installation on redhat/ubi8 works with msodbcsql17-17.8.1.2-1.x86_64.rpm.
FROM redhat/ubi8
COPY msodbcsql17-17.8.1.2-1.x86_64.rpm /tmp
RUN MSSQL_PID=Developer ACCEPT_EULA=Y yum -y localinstall /tmp/msodbcsql17-17.8.1.2-1.x86_64.rpm; rm /tmp/msodbcsql17-17.8.1.2-1.x86_64.rpm

How to install ROS on Ubuntu 18.04?

Im running Ubuntu 18.04 and trying to install ROS for the first time on my machine. I have tried to follow the instructions at: http://wiki.ros.org/melodic/Installation/Ubuntu
I get stuck at this part.
sudo apt-get install ros-melodic-desktop-full
My attempts:
sudo apt -f install
sudo apt update --fix-missing
sudo dpkg --configure -a
sudo dpkg --remove --force-remove--reinstreq
sudo apt clean
sudo apt update
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
Nothing has worked so far.
Terminal commands:
$sudo apt-get install ros-melodic-desktop-full
Reading package listsā€¦ Finished
Builds dependency trees
Reading state information ... Finished
Some packages could not be installed. It may mean that you have requested
an impossible situation or, if you use the unstable distribution
that some necessary packages have not yet been created or moved
from "Incoming".
The following information may help to resolve the situation:
The following packages have dependencies that cannot be satisfied:
rose-melodic-desktop-full: Dependent on: rose-melodic-desktop but it will not be installed
Depending on: rose-melodic-perception but it will not be installed
Depending on: rose-melodic-simulators but it will not be installed
Depending on: ros-melodic-urdf-sim-tutorial but it will not be installed
E: Could not correct the problems, you have withheld broken packages.
Please help me install ROS
1 - After following ROS melodic Installation first steps (see link below), Try to install it with the link "click here" below the "sudo apt install ros-melodic-desktop-full" line
ROS melodic Installation page
If it's doesn't work
2 - check, "Software & Update" parameters
(if you cannot find it: launch "Ubuntu Software Center" and in the menu bar, on top, select "Software & Update")
In "Other Sofware" tab, the link
"http://pacckage.ros.org/ros/ubuntu bionic main"
is printed, and in "Autentication" tab a key from Open Robotics is printed
3 - Try to do 1- again, if it doesn't work, follow 4-
4 - In "Updates" tab, check "recommanded Updates", launch "Update Manager" and install updates (I don't do it properly on my PC)
5 - And finally you need to install manually rosdep with:
"sudo apt-get install python-rosdep"
Ubuntu (apt) does NOT allow packages with the same name but different versions to be installed.
Remove other versions first. For example: apt remove ros-desktop*
first of all install program on ubuntu.
sudo apt-get update
sudo apt-get upgrade
after update packet try follow the instructions at: enter link description here again
I got it working like so:
Install deps:
sudo apt install gazebo9-common libgazebo9-dev gazebo9 ros-melodic-gazebo-ros-pkgs ros-melodic-gazebo-dev ros-melodic-gazebo-ros-control ros-melodic-gazebo-ros ros-melodic-urdf-sim-tutorial ros-melodic-simulators
Install ros melodic
sudo apt-get install ros-melodic-desktop-full

Installing TinyTeX in a Singularity container

I'm writing a paper in RMarkdown and for better reproducibility, I want to containerize all required software in a singularity container. Unfortunately, when I try to install TinyTeX (which is recommended for Rmarkdown and I would prefer over TeXLive to not inflate the container more than needed), it fails with the following error message (the full build log is pasted here):
Can't locate TeXLive/TLConfig.pm in #INC (you may need to install the TeXLive::TLConfig module) (#INC contains: /~/.TinyTeX/texmf-dist/scripts/texlive /~/.TinyTeX/tlpkg /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at ~/.TinyTeX/bin/x86_64-linux/tlmgr line 100.
BEGIN failed--compilation aborted at ~/.TinyTeX/bin/x86_64-linux/tlmgr line 100.
This is the build definition file, basically it uses a very slimmed down ubuntu 18.04 and then executes the %post section to install software
BootStrap: library
From: ubuntu:18.04
%post
# Add universe repository
echo "deb http://us.archive.ubuntu.com/ubuntu bionic universe" >> /etc/apt/sources.list
apt -y update
# Install utilites
apt install -y wget
# Install R
apt install -y r-base-core
## Install RMarkdown and TinyTeX
R --slave -e 'install.packages(c("rmarkdown","tinytex")); tinytex::install_tinytex()'
# Clean
apt-get clean
%environment
export LC_ALL="en_US.UTF-8"
%labels
Author DP
I have also tried tinytex::install_tinytex(dir="/opt/tinytex") but that didn't seem to change anything. Does anyone have an idea what's wrong?
That error message is complaining that your image (or, more likely, your path) is missing the TeXLive::TLConfig perl module.
My guess is that the path contents are not being rehashed with the installed modules after the install. The simplest solution is to break it into two commands:
R --slave -e 'install.packages(c("rmarkdown","tinytex"))'
R --slave -e 'tinytex::install_tinytex()'
Installation succeeds when I try that locally.
A potentially useful alternative, if the image is just for document generation, could be converting a docker image with rmarkdown and tex (e.g. https://hub.docker.com/r/rocker/verse) to a singularity one.
With singularity pull docker://rocker/verse you can do that for the latest version, or for a specific version with verse:version_number.

How do I install/update to Postgres 9.4?

I just installeed Postgres, but it seems to have installed 9.3 and I'd like to start with 9.4
I simply did apt-get install postgresql from a new Ubuntu 14.04.1 machine.
http://www.postgresql.org/download/linux/ubuntu/
says you can do:
apt-get install postgresql-9.4
but when I try that I get:
E: Couldn't find any package by regex 'postgresql-9.4
Okay, so I try the section below where you add the PostgreSQL Apt Repository but that can't find anything either.
Is 9.4 not in the package managers yet? Am I doing something horribly wrong?
You can add it from the instructions in the page
http://www.postgresql.org/download/linux/ubuntu/
Create the file /etc/apt/sources.list.d/pgdg.list, and add a line for the repository
deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main
Import the repository signing key, and update the package lists
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update && sudo apt-get install postgresql-9.4
postgresql-9.4 is not available in 14.04 "Trusty". It was added in 14.10 "Utopic". It may be back ported in the future.
The directions on the PostgreSQL Ubuntu Download page are missing a command. Their wiki guide has the correct procedure. You must run apt-get update before trying to install. This will cause the system to read changes to the sources.
If you're trying to install on Ubuntu 14.04 "Trusty", you can follow these steps:
To check your version:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
1) Create new apt repo file for postgres
$ echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list
2) Import repository signing key and update packages list
$ sudo wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-get update
3) Install Postgres
$ sudo apt-get install postgresql-9.4
credit: http://ubuntuhandbook.org/index.php/2014/02/install-postgresql-ubuntu-14-04/
Below are steps to install PostgreSQL 9.4 on Ubuntu 14.04.
Reference taken from this Article:
First, check the version of Ubuntu:
lsb_release -sc
You need to add the latest PostgreSQL repository for the latest version, otherwise It will install PostgreSQL 9.3. This is for trusty version.
sudo add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main"
Update and Install PostgreSQL 9.4:
sudo apt-get update
sudo apt-get install postgresql-9.4
Default postgres super user and postgres database is created. You need to set a password for the postgres super user.
ubuntu#:~$ sudo passwd postgres
Enter new UNIX password:****
Retype new UNIX password:****
passwd: password updated successfully
If service is not started, you can start the PostgreSQL service.
sudo service postgresql start
Connect PostgreSQL server using postgres user:
ubuntu#:~$ su postgres
Password:****
Create a sample database:
createdb database_name
Connect to that database:
psql -d database_name
Follow these steps to install postgresql. Open the terminal (Ctrl + Alt + t) and then write down the following command line
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.6
If postgresql installed successfully then it will return this after writing this command
psql --version
psql (PostgreSQL) 9.6.3
PostgreSQL is an open source object-relational database system. It is one of leading database server used for production servers. PostgreSQL allows us to execute stored procedures in various programming languages, like PHP, C/C++, Python, Java, Perl, Ruby and its own PL/pgSQL, which is similar to Oracleā€™s PL/SQL.
Postgres database is used the persistent store of data
Install Postgres
yum install postgres
(Note : remember the password for the postgres user ā€“ you need it later)
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install postgresql-9.6
Setting up Postgres
Launch pgAdmin.
Connect to the local server. Use localhost for the server name, postgres for the username and the password you used when you installed Postgres.
You need to be root to perform this command.Note: If you did not set password during installation (sudo apt-get install postgresql), then you can set it as follows:
ļæ¼
sudo -u postgres psql postgres
On the postgres client prompt, use the following command to set the password.
alter user postgres with password 'postgres';
Connect to PostgreSQL
After installing PostgreSQL database server, by default,, it creates a user ā€˜postgresā€™ with role ā€˜postgresā€™. It also creates a system account with same name ā€˜postgresā€™. So to connect to postgres server, log in to your system as user postgres and connect database.
$ sudo su - postgres
$ psql
Now you are logged in to PostgreSQL database server. To check login info use following command from database command prompt.
postgres-# \conninfo
To disconnect from PostgreSQL database command prompt just type below command and press enter. It will return you back to Ubuntu command prompt.
postgres-# \q

Resources