-
Notifications
You must be signed in to change notification settings - Fork 533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't run a drush sql-dump - Database dump failed because Table '/tmp/#sql_1_0.MAI' is read only #148
Comments
I'm having the exact same issue. I am running a project on my Mac and exported the database to a 'production' environment on a CentOS 7 server. I can do all sorts of selects but in a few cases i get issues with a 'read only' tmp table. I have checked if i can write to the /tmp directory within the mariadb container when logging in as the mysql user (uid 100). One of the queries that gives me the error is:
I am clueless at this point. |
Ignore that. I was using wodby/mariadb and now replaced it with wodby/drupal-mariadb. Solved my problem for now. |
Rolling back to wodby/mariadb:2.0.0 does fix it - the wodby/drupal-mariadb repo seems like it's an old one that isn't updated any more? |
I didn't have time to look closely into this issue but try to use the latest non-tagged image |
My first guess would be that is has something to do with updating mariadb to 10.1.22-r0. I'll try to compare the versions and see if it changes anything. |
Going to the non-tagged version doesn't help, rolling back to wodby/mariadb:10.1:2.0.0 does. |
I've just rebuilt a non-tagger version to 10.1.22-r1 (alpine 3.6). Try it out. Also, we had a lot of changes in mariadb config (performance tuning) in the last versions but I think it was after 2.1.0. |
Tried with the latest non-tagged version, but the error remains: |
Could you please attach the SQL file that can be used to reproduce the issue. Perhaps we should post a bug report to mariadb or alpine team. |
It happens even on a basic Drupal installation like this one: |
The issue isn't specific to drupal, it looks to be specific to some combination of kernel options and alpine package. I can only reproduce it in alpine package of mariadb. Host OS: CentOS 7.4
Install commands:
This query fails consistently:
Also Here's strace of a failing query:
Here's an output:
|
Found a bug report in Alpine: https://bugs.alpinelinux.org/issues/7345 |
Since 2.5.0 we use new mariadb image compiled from sources instead of the alpine package. |
@csandanov Is that still alpine based? Does it use |
Here are my findings: |
Yes, it's still alpine-based, does anyone have the issue with |
@csandanov the issue is reproducible since mariadb 10.1.22 on kernels below 4.4 So either upgrade kernel or downgrade mariadb. Or don't use alpine/musl |
What is your docker storage driver? If it's reproducible with a certain version of kernel there's a good chance it could be fixed by changing the driver, overlay2 proved itself as quite stable with kernel 4.x |
I'm using the docker4drupal resources to build me a labserver for drupal-sites, with the site-files residing outside of the docker-containers.
I've tried this for both Drupal 7 & Drupal 8 and get the same issue in both - inside a running site, I can modify data without any problems, using drush sqlc I can do things like "truncate table XXX;" but when I execute "show fields from XXX;" from drush sqlc I get this same error:
I'm trying to get a database-dump (or a drush ard) through drush using
docker-compose exec --user 82 php drush -r ./web/ sql-dump
but I get the error at the bottom - I'm including my current docker-compose.yml, I have similar setups for Drupal 7 site (with PHP5.6) and I've tried it with externally hosted db-datafiles and in-container db-datafiles, always the same result.
`version: "2"
services:
mariadbrefsite:
image: wodby/mariadb:10.1-2.1.0
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: siterefsite
MYSQL_USER: siterefsite
MYSQL_PASSWORD: drupal
networks:
- backend
volumes:
- /home/fedict/db/refsite/mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.
php:
image: wodby/drupal-php:7.1-2.1.0
environment:
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
DB_HOST: mariadbrefsite
DB_USER: siterefsite
DB_PASSWORD: drupal
DB_NAME: siterefsite
DB_DRIVER: mysql
networks:
- backend
volumes:
- /home/fedict/www/refsite/:/var/www/html
nginx:
image: wodby/drupal-nginx:8-1.10-2.1.0
depends_on:
- php
environment:
NGINX_STATIC_CONTENT_OPEN_FILE_CACHE: "off"
NGINX_ERROR_LOG_LEVEL: debug
NGINX_BACKEND_HOST: php
NGINX_SERVER_ROOT: /var/www/html/web
networks:
- web
- backend
volumes:
- /home/fedict/www/refsite/:/var/www/html/
labels:
- 'traefik.port=80'
- 'traefik.frontend.rule=Host:refsite.drulab.bosa.be'
- 'traefik.docker.network=traefik_webgateway'
volumes:
codebase:
networks:
web:
external:
name: traefik_webgateway
backend:
driver: bridge
`
` docker-compose exec --user 82 php drush -r ./web/ sql-dump
-- MySQL dump 10.16 Distrib 10.1.21-MariaDB, for Linux (x86_64)
--
mysqldump: Error: 'Table '/tmp/#sql_1_2.MAI' is read only' when trying to dump tablespaces
-- Host: mariadbrefsite Database: mariadbrefsite
-- Server version 10.1.22-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT /;
/!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS /;
/!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION /;
/!40101 SET NAMES utf8 /;
/!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE /;
/!40103 SET TIME_ZONE='+00:00' /;
/!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 /;
/!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 /;
/!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' /;
/!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table
batch
DROP TABLE IF EXISTS
batch
;/*!40101 SET @saved_cs_client = @@character_set_client /;
/!40101 SET character_set_client = utf8 /;
CREATE TABLE
batch
(bid
int(10) unsigned NOT NULL COMMENT 'Primary Key: Unique batch ID.',token
varchar(64) CHARACTER SET ascii NOT NULL COMMENT 'A string token generated against the current user''s session id and the batch id, used to ensure that only the user who submitted the batch can effectively access it.',timestamp
int(11) NOT NULL COMMENT 'A Unix timestamp indicating when this batch was submitted for processing. Stale batches are purged at cron time.',batch
longblob COMMENT 'A serialized array containing the processing data for the batch.',PRIMARY KEY (
bid
),KEY
token
(token
)mysqldump: Couldn't execute 'show fields from
batch
': Table '/tmp/#sql_1_0.MAI' is read only (1036)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Stores details about batches (processes that run in…';
/!40101 SET character_set_client = @saved_cs_client */;
Database dump failed `
The text was updated successfully, but these errors were encountered: