Bug #90016 Missing lib error installing MEM agent on ubuntu 16.04 LTS
Submitted: 12 Mar 2018 10:13 Modified: 21 Mar 2018 12:11
Reporter: Dayo Lasode Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Enterprise Monitor: Installing Severity:S3 (Non-critical)
Version:MEM v4.0.3.5192 OS:Ubuntu (16.0.4 (LTS))
Assigned to: CPU Architecture:x86 (64 bit)

[12 Mar 2018 10:13] Dayo Lasode
Description:
While installing the monitoring agent on an ubuntu target, the following error is returned

Unable to create symbolic link /opt/mysql/enterprise/agent/java/lib/amd64/server/libjsig.so -> ../libjsig.so 
Abort 
There has been an error. 
Unable to create symbolic link /opt/mysql/enterprise/agent/java/lib/amd64/server/libjsig.so -> ../libjsig.so 

How to repeat:
root@dbbox1:~# ./agent.sh 
Unable to create symbolic link /opt/mysql/enterprise/agent/java/lib/amd64/server/libjsig.so -> ../libjsig.so 
Abort 
There has been an error. 
Unable to create symbolic link /opt/mysql/enterprise/agent/java/lib/amd64/server/libjsig.so -> ../libjsig.so 

Contents opf agent.sh are below:

root@dbbox1:~# cat agent.sh 
./mysqlmonitoragent-4.0.3.5192-linux-x86-64bit-installer.bin \ 
--agent_installtype database \ 
--agentpassword testpass \ 
--agentuser agentlogin \ 
--generalpassword pa55word \ 
--generaluser memGeneral \ 
--limitedpassword pa55word \ 
--limiteduser memLimited \ 
--managerhost memsrv \ 
--mode unattended \ 
--mysqlconnectiongroup lab \ 
--mysqlconnmethod socket \ 
--mysqlport 3306 \ 
--agent_autocreate 0 \ 
--mysqlhost localhost \ 
--mysqluser memAdmin \ 
--mysqlpassword pa55word \ 
--mysqlsocket /var/run/mysqld/mysqld.sock 

On further investigation, the missing library was actually located at:

root@dbbox1:~# ls -l /opt/mysql/enterprise/agent/java/lib/amd64/libjsig.so 
-rwxr-xr-x 1 root root 11052 Dec 20 05:24 /opt/mysql/enterprise/agent/java/lib/amd64/libjsig.so 
root@dbbox1:~#

Suggested fix:
Change location of library when linking
[12 Mar 2018 17:05] Andy Bang
Scanning the log, we can see the following failures when executing the "ln" command:

        Creating link /opt/mysql/enterprise/agent/java/lib/amd64/server/libjsig.so
        Failed to create link executing: 'ln -sf ../libjsig.so libjsig.so': couldn't fork child process: not enough memory.
        Failed to create link executing: '/usr/bin/ln -sf ../libjsig.so libjsig.so': couldn't fork child process: not enough memory.
        Failed to create link executing: '/usr/bin/xpg4/bin/ln -sf ../libjsig.so libjsig.so': couldn't fork child process: not enough memory.
        Unable to create symbolic link /opt/mysql/enterprise/agent/java/lib/amd64/server/libjsig.so -> ../libjsig.so

So it seems that the machine where the installer is being executed does not have enough memory available. Can the user monitor the available memory at installation time?
[13 Mar 2018 10:56] Dayo Lasode
Thanks Andy.

Started with a 512MB RAM test machine, re-tried the installation again (as root), got the same error and it is memory related as you concluded (see below during installation):

root@dbbox1:~# while true; do free -m; sleep 2; done
              total        used        free      shared  buff/cache   available
Mem:            476         196          63           3         216         244
Swap:             0           0           0
              total        used        free      shared  buff/cache   available
Mem:            476         213          41           3         221         228
Swap:             0           0           0
              total        used        free      shared  buff/cache   available
Mem:            476         297          29           3         149         144
Swap:             0           0           0
              total        used        free      shared  buff/cache   available
Mem:            476         300          19           3         155         140
Swap:             0           0           0
              total        used        free      shared  buff/cache   available
Mem:            476         301          18           3         156         140
Swap:             0           0           0
              total        used        free      shared  buff/cache   available
Mem:            476         320           6           3         150         125
Swap:             0           0           0
              total        used        free      shared  buff/cache   available
Mem:            476         328           5           3         142         117
Swap:             0           0           0
              total        used        free      shared  buff/cache   available
Mem:            476         330           5           3         140         115
Swap:             0           0           0
              total        used        free      shared  buff/cache   available
Mem:            476         329           5           3         140         115
Swap:             0           0           0
              total        used        free      shared  buff/cache   available
Mem:            476         330           5           3         141         115
Swap:             0           0           0
              total        used        free      shared  buff/cache   available
Mem:            476         330           5           3         140         115
Swap:             0           0           0
              total        used        free      shared  buff/cache   available
Mem:            476         196         140           3         139         249  <= After failure

After increasing RAM to 750MB, installation ran successfully:

root@dbbox1:~# ./agent.sh
root@dbbox1:~#

Thanks!

Dayo
[21 Mar 2018 12:11] MySQL Verification Team
Thank you, Dayo for confirming that after increasing memory to 750MB there were no issues in installing. Closing the issue for now.