-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
CLI installation fails if table-prefix contains hyphen; Upgrade fails as well in CLI and browser #10214
Comments
GitMate.io thinks possibly related issues are #8963 (Alpine installation failed ), #4186 (installation fails due to "no app in context"), #2683 (Postgres installation with occ tool fails ), #631 (Ability to change Database prefix in Installation Process), and #7131 ( Sync fails when file/directory names contain commas ). |
I also get something similar on a fresh install. Docker container: nextcloud:latest Error: Error while trying to create admin user: An exception occurred while executing 'CREATE TABLE groups (gid VARCHAR(64) DEFAULT '' NOT NULL, PRIMARY KEY(gid)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB': SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups (gid VARCHAR(64) DEFAULT '' NOT NULL, PRIMARY KEY(gid)) DEFAULT CHARACTER' at line 1 |
Thanks for confirmation Kramins. I would like to add that this error appears as well, if I upgrade an instance from NC12 to NC13. The problem only seems to be the hyphen in tableprefix. |
cc @nickvergessen for DB checks |
Hyphens are not supported in table names I though. How did you manage to install in first place? |
With NC12 occ install worked fine with hyphens. I did not think I would run into problems with this process. Would be cool if occ had warned me :) Now I have about 5 customer instances with hyphens in DB-prefixes and would like to continue offering hyphens in new customer instances. If you cannot repair this in the install process, I have to migrate all tables to tablenames without hyphens and in my install routine I have to replace the hyphen with an underscore. Can I rename existing tables without running into problems with nextcloud (thinking about keys, uniques, indexes....)? Is there a best practice, maybe with a backup tool where I can set new DB prefix? Thank you for your efforts. |
The database prefix should not be visible to your customers at all 🙈 We do not recommend to change it, since it can lead to major troubles on various ends |
please don't get me wrong :) the prefix (e.g. in config.php) is not visible to my customers. The customers only get the web gui, nothing else, no sftp access or even admin-account. okay, thanks for pointing out that renaming tables is not recommended. My options are now:
no good way to go here.............. |
Do you have anything specific in mind? Just rename it and change also the prefix in the config.php should do the trick, right? |
Yeah that should work |
Nice, it worked :-) I tested a few features and apps and everything seems to run just fine. I renamed the tables with phpmyadmin, it has a feature for changing table prefixes. |
I'd like to remove this option for 15, what do you think @MorrisJobke |
Which option? The prefix? |
Yeah removing the possibility to enter it at all and hard-code |
But then we should add a setup check to 14 to already let people know about this and report to a ticket either here or in the forums. |
From a customers point of view: Table prefixes give me the opportunity for easyer testing and installing. This applies to Nextcloud, Owncloud and plenty of other Software. I understand that removing this feature takes away complexity and you consider it therefore a good step. In the process of NC-app development it is not hard to implement the prefix. Is it too hard in development of the NC core? |
Well the thing is some of the indexes are not using the prefix and indexes need to have unique names. That was one little oversight when prefixes were introduced back then. |
Steps to reproduce
Expected behaviour
Nextcloud 13 should be installed; install routine worked fine with Nextcloud 12
Actual behaviour
CLI error message appears:
"Error while trying to create admin user: An exception occurred while executing 'CREATE TABLE test-hyphen__migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin ENGINE = InnoDB ROW_FORMAT = compressed':
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-hyphen__migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, P' at line 1"
Nextcloud is not installed; no tables created; no data dir created (therefor no nextcloud log file)
Server configuration detail
Operating system: Linux 4.4.0-130-generic #156-Ubuntu SMP Thu Jun 14 08:53:28 UTC 2018 x86_64
Webserver: Apache/2.4.33 (Ubuntu) (apache2handler)
Database: mysql 5.7.22
PHP version: 7.0.30-0ubuntu0.16.04.1
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, apache2handler, mysqlnd, PDO, xml, apcu, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, igbinary, intl, json, exif, mcrypt, mysqli, pdo_mysql, pdo_sqlite, Phar, posix, readline, redis, shmop, SimpleXML, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, Zend OPcache
Nextcloud version: 13.0.4 - 13.0.4.0
Updated from an older Nextcloud/ownCloud or fresh install: no
Where did you install Nextcloud from: https://download.nextcloud.com/server/releases/nextcloud-13.0.4.tar.bz2
Signing status
Array
List of activated apps
Configuration (config/config.php)
Are you using external storage, if yes which one: no
Are you using encryption: no
Are you using an external user-backend, if yes which one: no
Client configuration
Browser: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:61.0) Gecko/20100101 Firefox/61.0
Operating system:
The text was updated successfully, but these errors were encountered: