debian – Why MariaDB does not start after upgrade (NO_NEW_PRIVILEGES)

After upgrading my debian server (testing, jessie to stretch) on DigitalOcean, MariaDB does not start with mariadb start service.

I've tried to purge all the mariadb- * and mysql- * packages, remove the configs and data and reinstall them, but mariadb-server-10.1.21-5 refuses to be configured:

Configuration of mariadb-server-10.1 (10.1.21-5) ...
The job for mariadb.service failed because the check process has ended with an error code.
See "systemctl status mariadb.service" and "journalctl -xe" for more details.
invoke-rc.d: mysql initscript, the action "start" failed.
‚óŹ mariadb.service - MariaDB database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: failed (result: exit code) since Thu 2017-02-09 21:25:27 CET; 10ms ago
Process: 1696 ExecStart = / usr / sbin / mysqld $ MYSQLD_OPTS $ _WSREP_NEW_CLUSTER $ _WSREP_START_POSITION (code = left, state = 227 / NO_NEW_PRIVILEGES)
Process: 1589 ExecStartPre = / bin / sh -c [ ! -e /usr/bin/galera_recovery ] && VAR = || VAR = `/ usr / bin / galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION = $ VAR || exit 1 (code = left, status = 0 / SUCCESS)
Process: 1584 ExecStartPre = / bin / sh -c systemctl undefined environment _WSREP_START_POSITION (code = left, state = 0 / SUCCESS)
Process: 1582 ExecStartPre = / usr / bin / install -m 755 -o mysql -g root -d / var / run / mysqld (code = left, status = 0 / SUCCESS)
Main PID: 1696 (code = left, status = 227 / NO_NEW_PRIVILEGES)

Feb 09 21:25:27 cddssh systemd[1]: Starting the MariaDB database server ...
Feb 09 21:25:27 cddssh systemd[1696]: mariadb.service: Failure at step NO_NEW_PRIVILEGES Generating / usr / sbin / mysqld: Invalid argument
Feb 09 21:25:27 cddssh systemd[1]: mariadb.service: main process aborted, code = aborted, status = 227 / NO_NEW_PRIVILEGES
Feb 09 21:25:27 cddssh systemd[1]: Could not start the MariaDB database server.
Feb 09 21:25:27 cddssh systemd[1]: mariadb.service: The unit has entered into a state of failure.
Feb 09 21:25:27 cddssh systemd[1]: mariadb.service: Result Failed "Exit Code".
dpkg: mariadb-server-10.1 (--configure) error-handling package:
the installed post-installation script of the subprocess returned the error output status 1
dpkg: dependency problems prevent mariadb-server configuration:
mariadb-server depends on mariadb-server-10.1 (> = 10.1.21-5); however:
The mariadb-server-10.1 package is not configured yet.

dpkg: mariadb-server (--configure) error-handling package:
dependency issues - leave unconfigured
Errors were encountered during treatment:
MariaDB-server-10.1
MariaDB-server
E: The / usr / bin / dpkg subprocess returned an error code (1)

it's the output of journalctl -xe after trying to start the service:

Feb 09 05:10:52 cddssh systemd[1]: mariadb.service: Can not set the call ID on the /system.slice/mariadb.service control group, ignoring: unsupported operation
Feb 09 05:10:52 cddssh systemd[1]: Starting the MariaDB database server ...
- Topic: The mariadb.service unit has started
- Defined by: systemd
- Support: https://www.debian.org/support
-
- The unit mariadb.service started to start.
Feb 09 05:10:52 cddssh systemd[7114]: mariadb.service: Failure at step NO_NEW_PRIVILEGES Generating / usr / sbin / mysqld: Invalid argument
- Topic: The / usr / sbin / mysqld process could not be executed
- Defined by: systemd
- Support: https://www.debian.org/support
-
- The / usr / sbin / mysqld process could not be executed and failed.
-
- The error number returned by this process is 22.
Feb 09 05:10:52 cddssh systemd[1]: mariadb.service: main process aborted, code = aborted, status = 227 / NO_NEW_PRIVILEGES
Feb 09 05:10:52 cddssh systemd[1]: Could not start the MariaDB database server.
- Subject: The mariadb.service unit failed
- Defined by: systemd
- Support: https://www.debian.org/support
-
- The unit mariadb.service failed.
-
- The result is failed.
Feb 09 05:10:52 cddssh systemd[1]: mariadb.service: The unit has entered into a state of failure.
Feb 09 05:10:52 cddssh systemd[1]: mariadb.service: Result Failed "Exit Code".

The mysql error log contains no errors or warnings.

I can start the mysqld binary very well by itself.

I have tried to follow the instructions on https://mariadb.com/kb/en/mariadb/upgrade-10116maria-1jessie-broke-system/ but I have an error.

mariadb.service: failed at step NO_NEW_PRIVILEGES generating / usr / sbin / mysqld: incorrect argument

It seems like it has something to do with selinux because I found these lines in /lib/systemd/system/mariadb.service

# Still not working properly with SELinux enabled
# NoNewPrivileges = true

Someone asked a very similar question about the superuser but I do not understand what he did to solve it: https://superuser.com/questions/1103321/mariadb-server-broken-after-failed -failed-package-update