Solved - External Storage - Database error on creation

Hello there!

I recently installed Owncloud and all went on just fine. However, when I'm trying to activate External Storage I do get this error:
An exception occurred while executing 'CREATE TABLE oc_external_mounts (mount_id BIGINT AUTO_INCREMENT NOT NULL, mount_point VARCHAR(128) NOT NULL, storage_backend VARCHAR(64) NOT NULL, auth_backend VARCHAR(64) NOT NULL, priority INT DEFAULT 100 NOT NULL, type INT NOT NULL, PRIMARY KEY(mount_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB': SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_external_mounts' already exists.

First time I did try to activate it there was another error. Bug I can't recall that.

Is there a way to delete these entries and recreate the table?

Please help us by providing the following info. Before posting please also check the pinned "Known issues" threads and make sure that you're running the latest available version for your oC release: https://owncloud.org/changelog/

Server configuration
Operating system: Ubuntu 16.04
Web server: Apache 2.4.1.8
Database: Mysql Ver 14.14 Distrib 5.7.17
PHP version: 7.0
ownCloud version (see ownCloud admin page): 9.1.4
Updated from an older ownCloud or fresh install: Fresh install
Special configuration (external storage, external authentication, reverse proxy, server-side-encryption):

ownCloud log (data/owncloud.log)

{"reqId":"YtST8Q16szE2XIhCHmt2","remoteAddr":"192.168.168.120","app":"core","message":"Login failed: '' (Remote IP: '192.168.168.120')","level":2,"time":"2017-03-05T20:23:23+00:00","method":"HEAD","url":"\/owncloud\/remote.php\/webdav\/","user":"--"}
{"reqId":"AFfi+c5zixvcOVbmqnvN","remoteAddr":"192.168.168.120","app":"core","message":"Login failed: '' (Remote IP: '192.168.168.120')","level":2,"time":"2017-03-05T20:23:23+00:00","method":"HEAD","url":"\/owncloud\/remote.php\/webdav\/","user":"--"}
{"reqId":"o7xFmIK5AgzrSkz0+JVv","remoteAddr":"192.168.168.120","app":"core","message":"Login failed: 'fredrik' (Remote IP: '192.168.168.120')","level":2,"time":"2017-03-05T20:23:56+00:00","method":"PROPFIND","url":"\/owncloud\/remote.php\/webdav\/","user":"--"}
{"reqId":"yG\/4tNPZmebm9I0Hc6Hp","remoteAddr":"192.168.168.120","app":"core","message":"Login failed: 'fredrik' (Remote IP: '192.168.168.120')","level":2,"time":"2017-03-05T20:23:56+00:00","method":"PROPFIND","url":"\/owncloud\/remote.php\/webdav\/","user":"--"}
{"reqId":"ZLh5xb5pG1OeyasyAhxu","remoteAddr":"192.168.168.137","app":"core","message":"Trusted domain error. \"192.168.168.137\" tried to access using \"server\" as host.","level":2,"time":"2017-03-05T21:30:30+00:00","method":"GET","url":"\/owncloud\/","user":"--"}
{"reqId":"gZAmdFs3hoKvvkBbZqMC","remoteAddr":"192.168.168.137","app":"core","message":"Trusted domain error. \"192.168.168.137\" tried to access using \"server\" as host.","level":2,"time":"2017-03-05T21:30:30+00:00","method":"GET","url":"\/owncloud\/index.php\/core\/js\/oc.js?v=44f549c002f9d7bd0c14461179cc593a","user":"--"}
{"reqId":"Eu8uWbS7eYFHVqFD3zPb","remoteAddr":"192.168.168.137","app":"core","message":"Trusted domain error. \"192.168.168.137\" tried to access using \"server\" as host.","level":2,"time":"2017-03-05T21:30:30+00:00","method":"GET","url":"\/owncloud\/cron.php","user":"--"}
{"reqId":"UE4S7YLA+jnOeKYHrhFK","remoteAddr":"192.168.168.137","app":"index","message":"Exception: {\"Exception\":\"Error\",\"Message\":\"Call to a member function addUser() on boolean\",\"Code\":0,\"Trace\":\"#0 [internal function]: OC\\\\Settings\\\\Controller\\\\UsersController->create('jenny', 'sommar!', Array, '')\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(159): call_user_func_array(Array, Array)\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OC\\\\Settings\\\\Controller\\\\UsersController), 'create')\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/App.php(99): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OC\\\\Settings\\\\Controller\\\\UsersController), 'create')\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(46): OC\\\\AppFramework\\\\App::main('UsersController', 'create', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#5 [internal function]: OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke(Array)\\n#6 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Route\\\/Router.php(280): call_user_func(Object(OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler), Array)\\n#7 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(891): OC\\\\Route\\\\Router->match('\\\/settings\\\/users...')\\n#8 \\\/var\\\/www\\\/owncloud\\\/index.php(54): OC::handleRequest()\\n#9 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/settings\\\/Controller\\\/UsersController.php\",\"Line\":379}","level":3,"time":"2017-03-05T21:36:20+00:00","method":"POST","url":"\/owncloud\/index.php\/settings\/users\/users","user":"fredrik"}
{"reqId":"gOZnlCx8ThqvvSe\/FCEc","remoteAddr":"192.168.168.129","app":"core","message":"Login failed: 'fredrik' (Remote IP: '192.168.168.129')","level":2,"time":"2017-03-05T22:14:51+00:00","method":"POST","url":"\/owncloud\/index.php\/login","user":"--"}
{"reqId":"Kb656J0YJ0ARWxPl\/TzK","remoteAddr":"192.168.168.129","app":"core","message":"Login failed: 'fredrik' (Remote IP: '192.168.168.129')","level":2,"time":"2017-03-05T22:15:01+00:00","method":"POST","url":"\/owncloud\/index.php\/login?user=fredrik","user":"--"}
{"reqId":"VLMtSWlrHRgurs9goa3G","remoteAddr":"192.168.168.129","app":"core","message":"An exception occurred while executing 'CREATE TABLE `oc_external_mounts` (`mount_id` BIGINT AUTO_INCREMENT NOT NULL, `mount_point` VARCHAR(128) NOT NULL, `storage_backend` VARCHAR(64) NOT NULL, `auth_backend` VARCHAR(64) NOT NULL, `priority` INT DEFAULT 100 NOT NULL, `type` INT NOT NULL, PRIMARY KEY(`mount_id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':\n\nSQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_external_mounts' already exists","level":3,"time":"2017-03-05T22:18:18+00:00","method":"POST","url":"\/owncloud\/index.php\/settings\/ajax\/enableapp.php","user":"fredrik"}
{"reqId":"1\/8zLUaF2RS3fcMZqGZQ","remoteAddr":"192.168.168.129","app":"core","message":"An exception occurred while executing 'CREATE TABLE `oc_external_mounts` (`mount_id` BIGINT AUTO_INCREMENT NOT NULL, `mount_point` VARCHAR(128) NOT NULL, `storage_backend` VARCHAR(64) NOT NULL, `auth_backend` VARCHAR(64) NOT NULL, `priority` INT DEFAULT 100 NOT NULL, `type` INT NOT NULL, PRIMARY KEY(`mount_id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':\n\nSQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_external_mounts' already exists","level":3,"time":"2017-03-05T22:18:54+00:00","method":"POST","url":"\/owncloud\/index.php\/settings\/ajax\/enableapp.php","user":"fredrik"}
{"reqId":"wECqh7ZO1uWpz3Vb8uSy","remoteAddr":"192.168.168.129","app":"core","message":"An exception occurred while executing 'CREATE TABLE `oc_external_mounts` (`mount_id` BIGINT AUTO_INCREMENT NOT NULL, `mount_point` VARCHAR(128) NOT NULL, `storage_backend` VARCHAR(64) NOT NULL, `auth_backend` VARCHAR(64) NOT NULL, `priority` INT DEFAULT 100 NOT NULL, `type` INT NOT NULL, PRIMARY KEY(`mount_id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':\n\nSQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_external_mounts' already exists","level":3,"time":"2017-03-05T22:19:06+00:00","method":"POST","url":"\/owncloud\/index.php\/settings\/ajax\/enableapp.php","user":"fredrik"}
{"reqId":"kZw8UdC81l\/D\/RCP800u","remoteAddr":"10.8.0.6","app":"core","message":"An exception occurred while executing 'CREATE TABLE `oc_external_mounts` (`mount_id` BIGINT AUTO_INCREMENT NOT NULL, `mount_point` VARCHAR(128) NOT NULL, `storage_backend` VARCHAR(64) NOT NULL, `auth_backend` VARCHAR(64) NOT NULL, `priority` INT DEFAULT 100 NOT NULL, `type` INT NOT NULL, PRIMARY KEY(`mount_id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':\n\nSQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_external_mounts' already exists","level":3,"time":"2017-03-06T05:54:24+00:00","method":"POST","url":"\/owncloud\/index.php\/settings\/ajax\/enableapp.php","user":"fredrik"}

Integrity status for oC9+

No errors found

Thanks in advanced,
Fredrik

1 Like

So I solved it.

I had to delete all rows in owncloud mysql table that external storage use.
So now we're up and running.

/Fredik

1 Like