Cannot build database on v10.0.10 2018/09/18 & MariaDB


#1

Hi,

I can’t get OwnCloud production 10.0.10 2018/09/18 to build a brand new database on MariaDB.

I have tried on these MariaDB Versions (mysql --version) output:

  • mysql Ver 15.1 Distrib 10.1.26-MariaDB, for Linux (armv8l) using readline 5.1
  • mysql Ver 15.1 Distrib 10.0.36-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

OwnCloud is on an Apache2 web server with PHP version: 7.2.13 installed, running in a Docker container.
Obviously the two MariaDBs are running on different machines:

  • The x86_x64 install runs directly on the PC’s hardware & Mint v18.03 OS.
  • The Armv81 instance is within a docker container based on Alpine Linux.

On the arm version of MariaDB, binlog_format=mixed, InnoDB is used on the OwnCloud tables and Transaction Isolation Level is as per the default for the installation.
On the x86_x64 version of MariaDB, InnoDB is used on the OwnCloud tables and everything else is as per the default for the installation.

Googling reveals a similar error where a string length value in a particular file in the Migrations folder was set to 256: I checked and this same value was set to 255.

Information in the standard form is below and your assistance and time is appreciated. Thanks.

##############################################################################################################

Steps to reproduce

  1. Download and uncompress the Production 10.0.10 2018/09/18 version of OwnCloud from the web site (the tarball).
  2. Navigate to the OwnCloud initial setup page.
  3. Complete the form on the initial setup page, choosing MariaDB and stating the correct usernames and passwords.
  4. Click ‘Finish Setup’ and the error appears shortly after.

Expected behaviour

The database build phase should complete without error

Actual behaviour

The following error appears:

Error while trying to create admin user: An exception occurred while executing ‘CREATE TABLE oc_mimetypes (id INT AUTO_INCREMENT NOT NULL, mimetype VARCHAR(255) DEFAULT ‘’ NOT NULL, UNIQUE INDEX mimetype_id_index (mimetype), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin ENGINE = InnoDB ROW_FORMAT = compressed’:

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Server configuration

Operating system:
Web Server: Alpine Linux: Linux 3.10.39 #1 SMP Fri Aug 17 18:23:06 CST 2018 2014T30p5 Build-git435df54 armv7l Linux

Database Server 1: Alpine Linux: Linux 3.10.39 #1 SMP Fri Aug 17 18:23:06 CST 2018 2014T30p5 Build-git435df54 armv7l Linux7
Database Server 2: Linux Mint 18.03: Linux 4.4.0-140-generic #166-Ubuntu SMP Wed Nov 14 20:09:47 UTC 2018 x86_64 GNU/Linux

**Web server:
Apache2 2.4.35

**Database: MariaDB
I have tried on these MariaDB Versions (mysql --version) output:

  • mysql Ver 15.1 Distrib 10.1.26-MariaDB, for Linux (armv8l) using readline 5.1
  • mysql Ver 15.1 Distrib 10.0.36-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

PHP version:
7.2.13

ownCloud version: (see ownCloud admin page)
Production 10.0.10 2018/09/18 (You don’t get as far as the admin page here)

Updated from an older ownCloud or fresh install:
Fresh install

Where did you install ownCloud from:
Downloads page of OwnCloud web site, tarball downloaded.

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

N/A - system has not yet built & configured

The content of config/config.php:
N/A - system has not yet built & configured

List of activated apps:
N/A - system has not yet built & configured

Are you using external storage, if yes which one: local/smb/sftp/…
N/A - system has not yet built & configured

Are you using encryption: yes/no
N/A - system has not yet built & configured

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/…
N/A - system has not yet built & configured

Client configuration

Browser:
Chrome 71.0.3578.98 (64-bit)

Operating system:
Windows 10, 1809

Logs

Web server error log

No errors were in the log

ownCloud log (data/owncloud.log)

`{"reqId":"7pfL5CW6JzUgLxrw80YY","level":3,"time":"2019-01-22T19:16:02+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"--","app":"mysql.setup","method":"POST","url":"\/index.php","message":"Specific user creation failed: An exception occurred while executing 'SELECT user FROM mysql.user WHERE user=?' with params [\"oc_cloudadmin\"]:\n\nSQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'owncloudadminuser'@'xxx.xxx.xxx.xxx' for table 'user'"}`

#2

Works for me with “mysql Ver 15.1 Distrib 10.1.28-MariaDB, for Linux (x86_64) using readline 5.1”

You might want to check your DB configuration (probably in /etc/mysql/my.cnf), specially the “innodb_large_prefix = ON” and “innodb_file_format = Barracuda”

[client]
port = 3306
socket = /run/mysqld/mysqld.sock

default-character-set = utf8

[mysqld]
port = 3306
socket = /run/mysqld/mysqld.sock

character-set-server = utf8
collation-server = utf8_general_ci

skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 128M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

tmpdir = /tmp

log-bin = mysql-bin
binlog_format = mixed

server-id = 1

innodb_data_home_dir = /var/lib/mysql
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /var/lib/mysql
innodb_buffer_pool_size = 16M
innodb_log_file_size = 64M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
innodb_use_native_aio = 1

innodb_large_prefix = ON
innodb_file_format = Barracuda
innodb_file_per_table = ON

[mysqldump]
quick
quote-names
max_allowed_packet = 128M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 16M
sort_buffer_size = 512K
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

!includedir /etc/mysql/conf.d/


#3

Hi @jvillafanez,

Thanks for your answer. I simply cut and pasted the lines beginning ‘innodb’ that you so kindly provided and the database creation process worked.

Thanks again,

Steven