Link to home
Start Free TrialLog in
Avatar of Jasmin shahrzad
Jasmin shahrzad

asked on

upgrade to 18 from ubuntu 16

I upgrade successfully and start up all services but mysql show error:

mysql-systemd-start[14048]: ERROR: ld.so: object '/usr/lib/libtcmalloc_minimal.so.4' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

what should to do?
Avatar of David Favor
David Favor
Flag of United States of America image

1) Upgrade to Focal (20) rather than Bionic (18), as Focal has far longer support, so if you're upgrading, best to always target latest LTS... which today is Focal...

2) Likely this will fix the problem...

sudo apt-get install libtcmalloc-minimal4

Open in new window

Avatar of Jasmin shahrzad
Jasmin shahrzad

ASKER

i did:
same problem restart mysql. same problem.
Note: Be sure to check that Ubuntu 18 actually provides /usr/lib/libtcmalloc_minimal.so.4 as Focal appears to have deprecated this package.

Well... the package installs + it's appears to be a stub package for old packages, which incorrectly attempt to install this code.

On Focal, this package only contains...

# dpkg -S libtcmalloc-minimal4        
libtcmalloc-minimal4:amd64: /usr/share/doc/libtcmalloc-minimal4
libtcmalloc-minimal4:amd64: /usr/share/doc/libtcmalloc-minimal4/changelog.Debian.gz
libtcmalloc-minimal4:amd64: /usr/share/doc/libtcmalloc-minimal4/copyright

Open in new window


So no .so provided by this package anymore.
mysql-systemd-start[17395]: ERROR: ld.so: object '/usr/lib/libtcmalloc_minimal.so.4' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
dpkg -S libtcmalloc-minimal4
libtcmalloc-minimal4: /usr/share/doc/libtcmalloc-minimal4
libtcmalloc-minimal4: /usr/share/doc/libtcmalloc-minimal4/changelog.Debian.gz
libtcmalloc-minimal4: /usr/share/doc/libtcmalloc-minimal4/copyright
You mentioned "I upgrade successfully" which might provide a clue.

If you meant you did an "in place upgrade" where 18 over wrote 16... this is always troublesome.

Likely better to backup your data + do a "fresh install" of 18 + restore your data.

Guessing, I'd say you still have some old 16 code installed, which depends on libtcmalloc-minimal4 which was deprecated.

What you might try is to completely delete all mysql packages, then reinstall them.

Sometimes the package delete (be sure to keep your data) + reinstall trick fixes oddball problems like you're seeing.
Aha! So in Bionic libtcmalloc-minimal4 has also been deprecated, which means all /usr/lib/libtcmalloc_minimal.so.* libraries were deleted during the "in place" upgrade you did... as this type of problem will only occur on an "in place" upgrade, never a "fresh install".

Definitely try to package delete + reinstall trick, which usually fixes this type of problem.
a little bit confusing the file /usr/lib/libtcmalloc_minimal.so.4
is not in ubuntu
ok you mean i take a backup of database and apt remove --purge mysql
then install mysql and restore databases? 
Correct.

The package libtcmalloc-minimal4 still exists as an Ubuntu package + this is only a packaging stub, so no .so anymore.

Looking at the diagnostic message closely, it appears this is just a warning, so can likely be ignored.

Since mysqld seems to start correctly, just ignore this message.
Warning...

If you do this...

apt-get remove --purge mysql

Open in new window


1) If you've made no APT config changes (default as originally installed) you'll be prompted asking if your /var/lib/mysql databases should be deleted.

Likely you'll say no to this...

2) If you've modified your APT config... there's a chance /var/lib/mysql will automagically be deleted, so if you do this, best do a --dry-run first, to ensure your data survives.

3) Operations like this should always be preceded by a full database backup, just in case all your data is destroyed or for some reason, there's some other problem.
Sigh... I used the wrong command... The .so is still included... after I thought about this for a while...

Correct command is -L rather than -S...

# dpkg -L libtcmalloc-minimal4
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4.5.3
/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal_debug.so.4.5.3
/usr/share
/usr/share/doc
/usr/share/doc/libtcmalloc-minimal4
/usr/share/doc/libtcmalloc-minimal4/changelog.Debian.gz
/usr/share/doc/libtcmalloc-minimal4/copyright
/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4
/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal_debug.so.4
mtsql is started but i have failed in application maybe it's therefore. i don't no.
i have clone a server. and i can connect to databases and take backup.  
i don't understand your point to run --dry-ru. if i run remove --purge and say yes then all is removed or what. do you mean not to do this?
ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes:
dpkg -L libtcmalloc-minimal4
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4.3.0
/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal_debug.so.4.3.0
/usr/share
/usr/share/doc
/usr/share/doc/libtcmalloc-minimal4
/usr/share/doc/libtcmalloc-minimal4/changelog.Debian.gz
/usr/share/doc/libtcmalloc-minimal4/copyright
/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4
/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal_debug.so.4
When removing packages, you must be careful how you answer questions.

If you answer incorrectly, all your data will be nuked/destroyed.

This is why it's best to make a backup before attempting this type of repair.
Yes it's working now. Thank you. Can you please tel me what happend? i have many ubuntu 16 to upgrade to 18
What seems to have happened... all related to "in place" updates, which I avoid... as the residual fallout takes forever to fix...

Appears to be one of these possibilities...

1) The libtcmalloc-minimal packaging fails to provide a symlink to /usr/lib/libtcmalloc_minimal.so.4 (unlikely).

2) The mysql packaging is incorrect, where mysqld is linking to /usr/lib/libtcmalloc_minimal.so.4 rather than the newer /usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4 location (unlikely).

3) Somehow ld is failing to correctly change /usr/lib/* lookups to /usr/lib/x86_64-linux-gnu/* which is a complex conversation (likely).

This might be caused by many reasons... all are obscure...

The bigger problem is if the /usr/lib/* lookup fixups /usr/lib/x86_64-linux-gnu/* will fail with other code or just mysqld.

If you see other similar problems, consider a "fresh install" to fix them all, rather than attempting to fix them one by one.

4) Try the symlink trick above + if that does the trick, you'll be up + running in a few seconds.
1) Yes it's working now. Thank you.

You're welcome!

Be sure to add a comment about exactly what you did, as this might save someone much agony fixing a problem in the dead of night.

2) Can you please tel me what happened? i have many ubuntu 16 to upgrade to 18.

Difficult to say exactly.

I use to do "in place" upgrades + after losing many hours of my life fixing this type of problems, I only do "fresh installs" now, so haven't seen any problem like this in over a decade... as "fresh installs" don't produce this type of problem... at least that I've seen installing many 1000s of "fresh installs" across machines + containers.

If you hit this type of problem again, it likely means something quietly broke in your upgrade... which is buried deep inside some log file somewhere...
Hang in there.

These a tough to fix, so patience is required.
Note: Went back + corrected Xenial to Bionic, to avoid confusion when others read this in the future.