Skip to content
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

Error: this app cannot be enabled because it makes the server unstable #14

Closed
spsantos03 opened this issue May 30, 2017 · 9 comments
Closed

Comments

@spsantos03
Copy link

Error while trying to enable Workin2Gether in Ubuntu Server 16.04 LTS, owncloud 9.1.5
Below log entry:

Exception: {"Exception":"Doctrine\DBAL\Exception\DriverException","Message":"An exception occurred while executing 'CREATE table oc_locks_w2g(name varchar(255) PRIMARY KEY,created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,locked_by varchar(255))':\n\nSQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes","Code":0,"Trace":"#0 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(116): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))\n#1 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(174): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'CREATE table oc...', Array)\n#2 /var/www/owncloud/lib/private/legacy/db/statementwrapper.php(75): Doctrine\DBAL\Statement->execute()\n#3 /var/www/owncloud/apps/workin2gether/appinfo/app.php(34): OC_DB_StatementWrapper->execute()\n#4 /var/www/owncloud/lib/private/legacy/app.php(187): require_once('/var/www/ownclo...')\n#5 /var/www/owncloud/lib/private/legacy/app.php(150): OC_App::requireAppFile('workin2gether')\n#6 /var/www/owncloud/lib/private/legacy/app.php(120): OC_App::loadApp('workin2gether')\n#7 /var/www/owncloud/lib/base.php(875): OC_App::loadApps()\n#8 /var/www/owncloud/index.php(54): OC::handleRequest()\n#9 {main}","File":"/var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php","Line":115}

@Patt92
Copy link
Owner

Patt92 commented May 31, 2017

which database are you using. The varchar(255) should only use 765 Byte for UTF8. If you're using the default charset utf8mb4 then the size would exceed the limit. I guess your default settings in the database engine are off.
In mysql i.e. you have to execute this in your mysql instance:
mysql> set global innodb_large_prefix = ON;

@spsantos03
Copy link
Author

That solved that first error in the log, tks.
Now I get a complaint about column size, as follows:

Exception: {"Exception":"Doctrine\DBAL\Exception\DriverException","Message":"An exception occurred while executing 'CREATE table oc_locks_w2g(name varchar(255) PRIMARY KEY,created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,locked_by varchar(255))':\n\nSQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes.","Code":0,"Trace":"#0 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(116): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))\n#1 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(174): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'CREATE table oc...', Array)\n#2 /var/www/owncloud/lib/private/legacy/db/statementwrapper.php(75): Doctrine\DBAL\Statement->execute()\n#3 /var/www/owncloud/apps/workin2gether/appinfo/app.php(34): OC_DB_StatementWrapper->execute()\n#4 /var/www/owncloud/lib/private/legacy/app.php(187): require_once('/var/www/ownclo...')\n#5 /var/www/owncloud/lib/private/legacy/app.php(150): OC_App::requireAppFile('workin2gether')\n#6 /var/www/owncloud/lib/private/legacy/app.php(120): OC_App::loadApp('workin2gether')\n#7 /var/www/owncloud/lib/base.php(875): OC_App::loadApps()\n#8 /var/www/owncloud/index.php(54): OC::handleRequest()\n#9 {main}","File":"/var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php","Line":115}

@Patt92
Copy link
Owner

Patt92 commented May 31, 2017

Then fix your database setup, That's not caused by the app, but a restricted database.

I've found this: Add these to your db config.

[mysqld]
innodb-file-format=barracuda
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

I don't know what has to be set specifically, but all other users had no complaints with their setup. I don't support setups, I support the app

@Pisoko
Copy link

Pisoko commented Jun 15, 2017

same here..

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE table oc_locks_w2g(name varchar(255) PRIMARY KEY,created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,locked_by varchar(255))': SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes.

Can't enable the app in Nextcloud 12

@Patt92
Copy link
Owner

Patt92 commented Jun 19, 2017

I won't repeat. This is not related to the app and also not to Nextcloud. Configure your DB server properly.

@qhtho
Copy link

qhtho commented Jul 26, 2017

Dear Patrick,

Currently, I need to enable workin2gether app to support file locking on Owncloud v9.1.1.3. I have double checked DB configuration setting and updated the correct configuration as you requested.
For format and file per table setting
+--------------------------+-----------+
| Variable_name | Value |
+--------------------------+-----------+
| innodb_file_format | Barracuda |
| innodb_file_format_check | ON |
| innodb_file_format_max | Antelope |
| innodb_file_per_table | ON |
+--------------------------+-----------+
For large prefix setting
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| innodb_large_prefix | ON |
+---------------------+-------+

I am getting a problem when enabling workin2gether app with the following message
"
Error: this app cannot be enabled because it makes the server unstable
"
and owncloud log entry
"
"Exception: {"Exception":"Doctrine\\DBAL\\Exception\\DriverException","Message":"An exception occurred while executing 'CREATE table oc_locks_w2g(name varchar(255) PRIMARY KEY,created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,locked_by varchar(255))':\n\nSQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes.
"

I am appreciated to your time and effort

Regards,
Tho

@Patt92
Copy link
Owner

Patt92 commented Jul 26, 2017

Try in the sql console:

set global innodb_large_prefix=on;
CREATE table oc_locks_w2g(name varchar(255) PRIMARY KEY,created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,locked_by varchar(255));

Alternative, if the create doesn't work:
CREATE table oc_locks_w2g(name varchar(255) PRIMARY KEY,created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,locked_by varchar(255)) ENGINE=INNODB DEFAULT CHARSET=utf8

I guess the utf8 should do the trick, because it's wide is 3Bytes * 255 -> 765Bytes

Also paste your version:
SELECT @@Version;

Please remember to restart the DB server, after changing config files (if you did).

@qhtho
Copy link

qhtho commented Jul 26, 2017

Thanks Patrick
I can now install Workin2Gether app on owncloud.

Actions:

  • Create table oc_locks_w2g in sql console with the following comment
    "
    CREATE table oc_locks_w2g(name varchar(255) PRIMARY KEY,created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,locked_by varchar(255)) ENGINE=INNODB DEFAULT CHARSET=utf8;
    "
    Below is my sql version
    Server version: 10.0.29-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04

Regards,
Tho

@Patt92
Copy link
Owner

Patt92 commented Jul 26, 2017

great :-) glad, I could help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@Patt92 @Pisoko @spsantos03 @qhtho and others