mysql-server fails to install if it cannot start due to not enough memory

Bug #1584234 reported by Simos Xenitellis 
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
mysql-5.7 (Ubuntu)
Triaged
Medium
Lars Tangvald

Bug Description

The default installation of mysql-server is completed successfully if it manages to start at the same time. If for some reason mysql-server cannot start, then the installation fails without giving a comprehensive error message. The user has no clue as to why the installation failed. The only file with information is /var/log/mysql/error.log.

Users run Ubuntu on affordable servers with little memory (Amazon EC2 600MB RAM, or DigitalOcean 512MB RAM). In addition, users may use containers like LXD which means that mysql-server may not get as much memory as required. Therefore, the installation may or may not fail. In addition, mysql-server may crash latter if not enough memory is available.
The default requirement for memory for mysql-server is 128MB (InnoDB).

There should be a way to inform the user that mysql-server does not install if there is not enough memory.

Revision history for this message
Simos Xenitellis  (simosx) wrote :

Attempt for installation of mysql-server, which fails due to not enough memory.
The messages do not give a clue that the problem is memory-related.

The commands (systemctl, journalctl) that are mentioned, do not provide a hint.

Robie Basak (racb)
Changed in mysql-5.7 (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

FYI - We discussed if that would be a dup to bug 1571865.
While a fix to the former one will help the situation a bit (by hopefully providing a better error message right away) it is intentionally not flagged as duplicate.

Revision history for this message
Simos Xenitellis  (simosx) wrote :

I had a look at the other bug report.

I think the significance in this report is that the mysql-server package can fail to install altogether (if the installation misjudges how much memory to assign to mysql), requiring the administrator to use package management commands in order to fix.

I got this problem when trying out Juju on the LXD provider.
The server had 2GB RAM, shared among the containers.
The installed mysql-server package got (auto?)configured to allocate 1.6GB of memory, thus failing to start, and failing to complete the installation. This is my recollection of what happened.
I had a look at the packaging of "mysql-server" and did not see any "autoconfiguration" for the memory. Therefore, it might just be Juju that configured the 1.6GB.
I'll try again to install Juju and get a better picture of what is happening.

Revision history for this message
Robie Basak (racb) wrote :

Perhaps we could have mysql-server.postinst follow some heuristic to determine if the system has lower-than-will-work-by-default memory, and if so, then enable a (/etc/mysql/mysql.conf.d/lowmem.cnf -> /usr/share/mysql/lowmem.cnf) symlink or something. We could have a low priority debconf option to permit (no heuristic/always lowmem/never lowmem/use heuristic) overrides.

Robie Basak (racb)
Changed in mysql-5.7 (Ubuntu):
assignee: nobody → Lars Tangvald (lars-tangvald)
Robie Basak (racb)
Changed in mysql-5.7 (Ubuntu):
milestone: none → ubuntu-16.09
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.