Danila Gavriliack
Danila Gavriliack

Reputation: 31

Table '/tmp/#sql_1_0.MAI' is read only

When I try to use SHOW FULL FIELDS FROM or some other SHOW COLUMNS syntax query I get this strange error message:

MariaDB [mysql]> show full fields from user;
ERROR 1036 (HY000): Table '/tmp/#sql_126_0.MAI' is read only

Tmp dir is present and has 777 permissions. Changing tmp dir in my.cnf doesn't help.

Chowning that dir to mysql user doesn't help either.

Steps to reproduce:

  1. Install CentOS 7 into VM (or any sufficiently old kernel)
  2. Install Docker on CentOS 7 (so that we can use alpine)
  3. Create alpine-based image with MariaDB 10.1.28 (apk add mysql mysql-client) or use readily available image
  4. Run mysql container docker run --name mariadb_container mariadb_image
  5. Connect to mysql using docker exec -ti mariadb_container mysql -A
  6. Run SHOW FULL FIELDS FROM some_table query

Any suggestions on how to trace that problem?

Upvotes: 3

Views: 2677

Answers (2)

Vanuan
Vanuan

Reputation: 33422

Warning: this is a working theory, not confirmed by any independent sources.

There are 3 points of failure that may explain why the bug is reproducible under the very specific conditions (CentOS 7, docker, alpine, mariadb 10.1.22+):

Links to discussions:

Links to code:

Approaches to fix:

  • upgrade to the latest kernel version (no new versions available in CentOS/RHEL, so switch to another OS or make a petition to RedHat to backport the fix)
  • investigate issues in musl realpath implementation
  • investigate issues in mariadb mi_open implementation (specifically changes to this file in 10.1.22)

Workarounds:

Upvotes: 4

Mykola Chornii
Mykola Chornii

Reputation: 1

You should try to downgrade your Mariadb to version 10.1.17 (worked for me)

Upvotes: 0

Related Questions