# MariaDB not working after upgrade to mariadb101-server-10.1.30



## nforced (Dec 28, 2017)

So after upgrading MariaDB 10.1.29 - 10.1.30 it won't start again.
Rolling back to 10.1.29 and it works...
Any suggestions?


```
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
Checking for upgrades (14 candidates): 100%
Processing candidates (14 candidates): 100%
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
        mariadb101-server: 10.1.29 -> 10.1.30

Number of packages to be upgraded: 1                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                            
The process will require 2 MiB more space.                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                            
Proceed with this action? [y/N]: y                                                                                                                                                                                                                                                                                          
[www] [1/1] Upgrading mariadb101-server from 10.1.29 to 10.1.30...                                                                                                                                                                                                                                                          
===> Creating groups.                                                                                                                                                                                                                                                                                                      
Using existing group 'mysql'.
===> Creating users
Using existing user 'mysql'.
[www] [1/1] Extracting mariadb101-server-10.1.30: 100%
Message from mariadb101-server-10.1.30:

************************************************************************

Remember to run mysql_upgrade (with the optional --datadir=<dbdir> flag)
the first time you start the MySQL server after an upgrade from an
earlier version.

MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for
my.cnf. Please move existing my.cnf files from those paths to
/usr/local/etc and /usr/local/etc/mysql.

This port does NOT include the mytop perl script, this is included in
the MariaDB tarball but the most recent version can be found in the
databases/mytop port

************************************************************************
vulnxml file up-to-date
0 problem(s) in the installed packages found.
root@www:~ # service mysql-server restart
Stopping mysql.
Waiting for PIDS: 1321.
Starting mysql.
root@www:~ # cd /var/cache/pkg/
root@www:/var/cache/pkg # service mysql-server restart
root@www:/var/cache/pkg # pkg remove mariadb101-server
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        mariadb101-server-10.1.30

Number of packages to be removed: 1

The operation will free 189 MiB.

Proceed with deinstalling packages? [y/N]: y
[www] [1/1] Deinstalling mariadb101-server-10.1.30...
[www] [1/1] Deleting files for mariadb101-server-10.1.30: 100%
==> You should manually remove the "mysql" user.
==> You should manually remove the "mysql" group
root@www:/var/cache/pkg # service mysql-server restart
root@www:/var/cache/pkg # pkg add mariadb101-server-10.1.29.txz
[www] Installing mariadb101-server-10.1.29...
===> Creating groups.
Using existing group 'mysql'.
===> Creating users
Using existing user 'mysql'.
[www] Extracting mariadb101-server-10.1.29: 100%
Message from mariadb101-server-10.1.29:

************************************************************************

Remember to run mysql_upgrade (with the optional --datadir=<dbdir> flag)
the first time you start the MySQL server after an upgrade from an
earlier version.

MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for
my.cnf. Please move existing my.cnf files from those paths to
/usr/local/etc and /usr/local/etc/mysql.

This port does NOT include the mytop perl script, this is included in
the MariaDB tarball but the most recent version can be found in the
databases/mytop port

************************************************************************
root@www:/var/cache/pkg # service mysql-server restart
mysql not running? (check /var/db/mysql/www.pid).
Starting mysql.
```


```
root@www:/var/cache/pkg # mysql_upgrade -u root -p
Enter password:
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2 "No such file or directory")
FATAL ERROR: Upgrade failed

root@www:/var/cache/pkg # tail /var/db/mysql/www.err
171228 19:39:29 mysqld_safe mysqld from pid file /var/db/mysql/www.pid ended
171228 19:39:29 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
2017-12-28 19:39:29 34422743040 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
2017-12-28 19:39:29 34422743040 [Note] /usr/local/libexec/mysqld (mysqld 10.1.30-MariaDB) starting as process 3051 ...
/usr/local/libexec/mysqld: Undefined symbol "fdatasync"
171228 19:39:29 mysqld_safe mysqld from pid file /var/db/mysql/www.pid ended
```


----------



## tobik@ (Dec 28, 2017)

nforced said:


> /usr/local/libexec/mysqld: Undefined symbol "fdatasync"


Upgrade to 11.1-RELEASE. 11.0-RELEASE is not supported anymore since 2017-11-30 and packages are now built for 11.1 and are not compatible with 11.0 anymore.


----------



## nforced (Dec 28, 2017)

Running in Jail

```
root@www:/var/cache/pkg # uname -a
FreeBSD www 11.1-RELEASE-p4 FreeBSD 11.1-RELEASE-p4 #0: Tue Nov 14 06:12:40 UTC 2017     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
```


----------



## tobik@ (Dec 28, 2017)

`uname -a` shows the version of the host kernel and not the userland version installed in the jail. What does `freebsd-version` return in the jail?


----------



## nforced (Dec 28, 2017)

```
root@www:/var/cache/pkg #  freebsd-version
11.1-RELEASE-p6
```


----------



## nforced (Dec 30, 2017)

Any toughs?


----------



## tobik@ (Dec 31, 2017)

Something must have gone wrong with the update to 11.1-RELEASE. Does /lib/libc.so.7 export the fdatasync symbol?

`objdump -T /lib/libc.so.7 | grep fdatasync`


----------



## SirDice (Jan 3, 2018)

As this is apparently in a jail, what did you use to build and upgrade the jail? Did you "roll your own" or did you use one of the jail managers like EZJail?


----------



## nforced (Jan 3, 2018)

tobik@ said:


> Something must have gone wrong with the update to 11.1-RELEASE. Does /lib/libc.so.7 export the fdatasync symbol?
> 
> `objdump -T /lib/libc.so.7 | grep fdatasync`



Looks like it's not there, see the attached libc.so.7.txt (taken inside the jail), but I do have it on the host!

```
objdump -T /lib/libc.so.7 | grep fdatasync
00000000000e99e0 g    DF .text  0000000000000011  FBSDprivate_1.0 __sys_fdatasync
00000000000e99e0  w   DF .text  0000000000000011  FBSDprivate_1.0 _fdatasync
000000000004ca20 g    DF .text  000000000000000b  FBSD_1.5    fdatasync
```


----------



## nforced (Jan 3, 2018)

SirDice said:


> As this is apparently in a jail, what did you use to build and upgrade the jail? Did you "roll your own" or did you use one of the jail managers like EZJail?



`ezjail-admin` is what I use for years


```
root@xxx:~ # /usr/local/bin/ezjail-admin update -u
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... none found.
Fetching metadata signature for 11.1-RELEASE from update.FreeBSD.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.

No updates needed to update system to 11.1-RELEASE-p6.
No updates are available to install.
```


----------



## nforced (Feb 17, 2018)

I forgot to wrote back but at the end I had to reinstall the basejail...
Btw I saw other people having the same issue on different instances (Dovecot giving the same error, etc), so I would take this covers a lot of cases.


----------

