Environment Operations Fail With "bash: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory" (KBA5622)
KBA
KBA# 5622
Issue
During various operations, such as "Refresh" or "Add Dataset", for a new or existing environment the operation may fail with a message similar to:
/home/<Delphix OS User>/toolkit/Delphix_COMMON_<Engine UUID>_<Delphix OS user>_host/scripts/bash/linux_x86/bin64/bash: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
Prerequisites
This problem will only affect UNIX or Linux hosts.
Applicable Delphix Versions
- Click here to view the versions of the Delphix engine to which this article applies
-
Major Release All Sub Releases 6.0 6.0.0.0, 6.0.1.0 5.3
5.3.0.0, 5.3.0.1, 5.3.0.2, 5.3.0.3, 5.3.1.0, 5.3.1.1, 5.3.1.2, 5.3.2.0, 5.3.3.0, 5.3.3.1, 5.3.4.0, 5.3.5.0 5.3.6.0, 5.3.7.0, 5.3.7.1, 5.3.8.0, 5.3.8.1
Troubleshooting
Check the current installation for presence of libncurses:
Example 1: ncurses 6.1 library is installed:
[root@examplehost ~]# rpm -qi ncurses Name : ncurses Version : 6.1 Release : 7.20180224.el8 Architecture: x86_64 Install Date: Tue 18 Jun 2019 05:04:41 PM UTC Group : System Environment/Base Size : 600396 License : MIT <output truncated>
Example 2: No ncurses library is installed:
root@examplehost:/-> rpm -qi ncurses package ncurses is not installed
Example 3: ncurses 6.1 library is installed, but no libncurses.so.5 is present:
[root@examplehost ~]# ls -l /usr/lib64/libncurses* lrwxrwxrwx. 1 root root 17 Jan 16 2019 /usr/lib64/libncurses.so.6 -> libncurses.so.6.1 -rwxr-xr-x. 1 root root 216912 Jan 16 2019 /usr/lib64/libncurses.so.6.1 lrwxrwxrwx. 1 root root 18 Jan 16 2019 /usr/lib64/libncursesw.so.6 -> libncursesw.so.6.1 -rwxr-xr-x. 1 root root 300104 Jan 16 2019 /usr/lib64/libncursesw.so.6.1
Example 4: libncurses.so.5 is present but cannot be read by other users:
[root@examplehost ~]# ls -la /usr/lib64/libncurses* lrwx------. 1 root root 17 Oct 18 2017 /usr/lib64/libncurses.so.5 -> libncurses.so.5.9 lrwx------. 1 root root 19 Oct 18 2017 /usr/lib64/libncurses++.so.5 -> libncurses++.so.5.9 -rwx------. 1 root root 163680 Jan 26 2014 /usr/lib64/libncurses.so.5.9 -rwx------. 1 root root 78512 Jan 26 2014 /usr/lib64/libncurses++.so.5.9 lrwx------. 1 root root 20 Oct 18 2017 /usr/lib64/libncurses++w.so.5 -> libncurses++w.so.5.9 lrwx------. 1 root root 18 Oct 18 2017 /usr/lib64/libncursesw.so.5 -> libncursesw.so.5.9 -rwx------. 1 root root 78512 Jan 26 2014 /usr/lib64/libncurses++w.so.5.9 -rwx------. 1 root root 234680 Jan 26 2014 /usr/lib64/libncursesw.so.5.9
The dependencies of the Delphix provided bash can always be manually verified by using ldd. This will indicate the required libraries, as well as confirmation if any cannot be resolved.
Example 1: All required libraries are resolved:
[root@examplehost toolkit]$ ldd ./Delphix_COMMON_<Engine UUID>_<Delphix OS user>_host/scripts/bash/linux_x86/bin64/bash linux-vdso.so.1 => (0x00007ffe2d1ae000) libncurses.so.5 => /lib64/libncurses.so.5 (0x00007f794fe10000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f794fc0c000) libc.so.6 => /lib64/libc.so.6 (0x00007f794f83f000) libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f794f615000) /lib64/ld-linux-x86-64.so.2 (0x00007f7950037000)
Example 2: libncurses.so.5 cannot be resolved:
[root@examplehost toolkit]$ ldd ./Delphix_COMMON_<Engine UUID>_<Delphix OS user>_host/scripts/bash/linux_x86/bin64/bash linux-vdso.so.1 => (0x00007ffe2d1ae000) libncurses.so.5 => not found libdl.so.2 => /lib64/libdl.so.2 (0x00007f794fc0c000) libc.so.6 => /lib64/libc.so.6 (0x00007f794f83f000) libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f794f615000) /lib64/ld-linux-x86-64.so.2 (0x00007f7950037000)
Resolution
The Delphix bash shell deployed with the Toolkit, which is installed on each environment Delphix manages, has a dependency on libncurses v5 for some operations. As such, if the environment user permissions are incorrect for shared libraries, or if libncurses is not installed, the error will be encountered.
As they are backward compatible, if libncurses6 is present, a symlink can be created for libncurses.so.5 to libncurses.so.6 (the specific version may vary depending on installation.
Example:
root@examplehost ~]# ln -s /usr/lib64/libncurses.so.6.1 /usr/lib64/libncurses.so.5
root@examplehost ~]# ls -l /usr/lib64/libncurses* lrwxrwxrwx. 1 root root 17 Apr 3 2020 /usr/lib64/libncurses.so.5 -> libncurses.so.6.1 lrwxrwxrwx. 1 root root 17 Jan 16 2019 /usr/lib64/libncurses.so.6 -> libncurses.so.6.1 -rwxr-xr-x. 1 root root 216912 Jan 16 2019 /usr/lib64/libncurses.so.6.1 lrwxrwxrwx. 1 root root 18 Jan 16 2019 /usr/lib64/libncursesw.so.6 -> libncursesw.so.6.1 -rwxr-xr-x. 1 root root 300104 Jan 16 2019 /usr/lib64/libncursesw.so.6.1
If no libncurses package is installed, the system administrator should be consulted to install as needed, and any requisite symlink also added as referenced above.
Related Articles
The following articles may provide more information or related information to this article: