I’m running Nextcloud 21.0.2 inside docker. Yesterday, after my server crashed, I was welcomed with an internal server error screen at my cloud’s landing page. Nextcloud’s log shows something like this every time I refresh:
{
"reqId":"egpXdrzcvkRkJSaC0rh1",
"level":4,
"time":"2021-08-25T06:51:02+00:00",
"remoteAddr":"172.19.0.1",
"user":"--",
"app":"webdav",
"method":"PROPFIND",
"url":"/remote.php/webdav/",
"message":{
"Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable",
"Message":"Doctrine\\DBAL\\Exception\\DriverException: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1932 Table 'nextcloud.oc_authtoken' doesn't exist in engine",
"Code":0,
"Trace":[
{
"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",
"line":182,
"function":"check",
"class":"OCA\\DAV\\Connector\\Sabre\\Auth",
"type":"->",
"args":[
{
"__class__":"Sabre\\HTTP\\Request"
},
{
"__class__":"Sabre\\HTTP\\Response"
}
]
},
{
"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",
"line":137,
"function":"check",
"class":"Sabre\\DAV\\Auth\\Plugin",
"type":"->",
"args":[
{
"__class__":"Sabre\\HTTP\\Request"
},
{
"__class__":"Sabre\\HTTP\\Response"
}
]
},
{
"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line":89,
"function":"beforeMethod",
"class":"Sabre\\DAV\\Auth\\Plugin",
"type":"->",
"args":[
{
"__class__":"Sabre\\HTTP\\Request"
},
{
"__class__":"Sabre\\HTTP\\Response"
}
]
},
{
"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
"line":456,
"function":"emit",
"class":"Sabre\\DAV\\Server",
"type":"->",
"args":[
"beforeMethod:PROPFIND",
[
{
"__class__":"Sabre\\HTTP\\Request"
},
{
"__class__":"Sabre\\HTTP\\Response"
}
]
]
},
{
"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
"line":253,
"function":"invokeMethod",
"class":"Sabre\\DAV\\Server",
"type":"->",
"args":[
{
"__class__":"Sabre\\HTTP\\Request"
},
{
"__class__":"Sabre\\HTTP\\Response"
}
]
},
{
"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
"line":321,
"function":"start",
"class":"Sabre\\DAV\\Server",
"type":"->",
"args":[
]
},
{
"file":"/var/www/html/apps/dav/appinfo/v1/webdav.php",
"line":84,
"function":"exec",
"class":"Sabre\\DAV\\Server",
"type":"->",
"args":[
]
},
{
"file":"/var/www/html/remote.php",
"line":167,
"args":[
"/var/www/html/apps/dav/appinfo/v1/webdav.php"
],
"function":"require_once"
}
],
"File":"/var/www/html/apps/dav/lib/Connector/Sabre/Auth.php",
"Line":163,
"CustomMessage":"--"
},
"userAgent":"Mozilla/5.0 (Linux) mirall/3.2.2git (build 5903) (Nextcloud, elementary-5.4.0-81-generic ClientArchitecture: x86_64 OsArchitecture: x86_64)",
"version":"21.0.2.1"
}
It seems like the table nextcloud.oc_authtoken is not found, but at least SHOW TABLES shows it in the Mariadb container.
Following this thread, I tried this without success:
MariaDB [nextcloud]> describe oc_authtoken;
ERROR 1932 (42S02): Table 'nextcloud.oc_authtoken' doesn't exist in engine
MariaDB [nextcloud]> CREATE TABLE oc_authtoken (
-> id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
-> uid VARCHAR(64) NOT NULL,
-> login_name VARCHAR(64) NOT NULL,
-> password LONGTEXT,
-> name LONGTEXT NOT NULL,
-> token VARCHAR(200) NOT NULL,
-> type SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
-> last_activity INT(10) NOT NULL DEFAULT '0',
-> last_check INT(10) UNSIGNED NOT NULL DEFAULT '0',
-> remember SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
-> scope LONGTEXT,
-> expires INT(10) UNSIGNED,
-> private_key LONGTEXT,
-> public_key LONGTEXT,
-> version SMALLINT(5) UNSIGNED NOT NULL DEFAULT '1',
-> password_invalid TINYINT(1) NOT NULL DEFAULT '0')
-> ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ERROR 1050 (42S01): Table 'oc_authtoken' already exists
Also, I’ve tried to drop the table first, but the process seem to hang: no feedback, and it seems to never end.
Any recommendation? I’m quite lost.