13.0.2 on Ubuntu 18.04 crashes when installing app

Nextcloud version : 13.0.2
Operating system and version : Ubuntu server 18.04
Apache or nginx version : Apache 2.4.29
PHP version : 7.2.3-1ubuntu1

The issue you are facing: When installing apps, be they official or not, it causes ubuntu to crash and become unresponsive.

Is this the first time you’ve seen this error? : Yes

Steps to replicate it:

  1. Login as admin
  2. Browse to apps
  3. Install any app

The output of your Nextcloud log in Admin > Logging:

Fatal	webdav	Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'INSERT INTO `oc_file_locks` (`key`,`lock`,`ttl`) SELECT ?,?,? FROM `oc_file_locks` WHERE `key` = ? HAVING COUNT(*) = 0' with params ["files\/e383867aff18b7c5e8263b4253ceaed7", 1, 1525100319, "files\/e383867aff18b7c5e8263b4253ceaed7"]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'files/e383867aff18b7c5e8263b4253ceaed7' for key 'lock_key_index'

    /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php - line 128: Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
    /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 1015: Doctrine\DBAL\DBALException driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'INSERT INTO `oc...', Array)
    /var/www/nextcloud/lib/private/DB/Connection.php - line 216: Doctrine\DBAL\Connection->executeUpdate('INSERT INTO `oc...', Array, Array)
    /var/www/nextcloud/lib/private/DB/Adapter.php - line 114: OC\DB\Connection->executeUpdate('INSERT INTO `oc...', Array)
    /var/www/nextcloud/lib/private/DB/Connection.php - line 254: OC\DB\Adapter->insertIfNotExist('*PREFIX*file_lo...', Array, Array)
    /var/www/nextcloud/lib/private/Lock/DBLockingProvider.php - line 119: OC\DB\Connection->insertIfNotExist('*PREFIX*file_lo...', Array, Array)
    /var/www/nextcloud/lib/private/Lock/DBLockingProvider.php - line 164: OC\Lock\DBLockingProvider->initLockField('files/e383867af...', 1)
    /var/www/nextcloud/lib/private/Files/Storage/Common.php - line 709: OC\Lock\DBLockingProvider->acquireLock('files/e383867af...', 1)
    /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 592: OC\Files\Storage\Common->acquireLock('files_trashbin', 1, Object(OC\Lock\DBLockingProvider))
    /var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 145: OC\Files\Storage\Wrapper\Wrapper->acquireLock('files_trashbin', 1, Object(OC\Lock\DBLockingProvider))
    /var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 180: OC\Files\Cache\Scanner->scanFile('files_trashbin')
    /var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 335: OC\Files\Cache\Scanner->scanFile('files_trashbin/...', 3, -1, NULL, false)
    /var/www/nextcloud/lib/private/Files/Cache/Updater.php - line 124: OC\Files\Cache\Scanner->scan('files_trashbin/...', false, 3, false)
    /var/www/nextcloud/lib/private/Files/View.php - line 319: OC\Files\Cache\Updater->update('files_trashbin/...', 1525096719)
    /var/www/nextcloud/lib/private/Files/View.php - line 1163: OC\Files\View->writeUpdate(Object(OCA\Files_Trashbin\Storage), 'files_trashbin/...')
    /var/www/nextcloud/lib/private/Files/View.php - line 267: OC\Files\View->basicOperation('mkdir', '/files_trashbin...', Array)
    /var/www/nextcloud/apps/files_trashbin/lib/Trashbin.php - line 165: OC\Files\View->mkdir('files_trashbin/...')
    /var/www/nextcloud/apps/files_trashbin/lib/Trashbin.php - line 230: OCA\Files_Trashbin\Trashbin setUpTrash('admin')
    /var/www/nextcloud/apps/files_trashbin/lib/Storage.php - line 289: OCA\Files_Trashbin\Trashbin move2trash('Photos', false)
    /var/www/nextcloud/apps/files_trashbin/lib/Storage.php - line 208: OCA\Files_Trashbin\Storage->doDelete('files/Photos', 'rmdir')
    /var/www/nextcloud/lib/private/Files/View.php - line 1148: OCA\Files_Trashbin\Storage->rmdir('files/Photos')
    /var/www/nextcloud/lib/private/Files/View.php - line 346: OC\Files\View->basicOperation('rmdir', '/Photos', Array)
    /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 303: OC\Files\View->rmdir('/Photos')
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 179: OCA\DAV\Connector\Sabre\Directory->delete()
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 287: Sabre\DAV\Tree->delete('Photos')
    [internal function] Sabre\DAV\CorePlugin->httpDelete(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    /var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method DELETE', Array)
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    /var/www/nextcloud/apps/dav/appinfo/v1/webdav.php - line 80: Sabre\DAV\Server->exec()
    /var/www/nextcloud/remote.php - line 164: require_once('/var/www/nextcl...')
    {main}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'ocrvs25zpc31',
  'passwordsalt' => 'kKgqLvj6cOEeQQ3Q/reeL4IotC7ugB',
  'secret' => 'IX0xz84+8BoGgVbtsJtaFf/2BEAlkdCqAW53iTC4t45uVXgX',
  'trusted_domains' => 
  array (
    0 => '10.200.1.127',
    1 => 'cloud.occorp.net',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'overwrite.cli.url' => 'http://10.200.1.127/nextcloud',
  'dbtype' => 'mysql',
  'version' => '13.0.2.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nc_user',
  'dbpassword' => 'R0)wW]^sdb2Gn+Mu@lU&f5;v>',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
);

The output of your Apache/nginx/system log in /var/log/error.log:

[Sat Apr 28 01:56:49.571188 2018] [authz_core:error] [pid 4564] [client 96.3.151.133:58084] AH01630: client denied by server configuration: /var/www/nextcloud/data/.ocdata
[Mon Apr 30 13:55:22.493010 2018] [mpm_prefork:notice] [pid 1720] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations
[Mon Apr 30 13:55:22.573624 2018] [core:notice] [pid 1720] AH00094: Command line: '/usr/sbin/apache2'
[Mon Apr 30 14:04:08.372364 2018] [mpm_prefork:notice] [pid 1649] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations
[Mon Apr 30 14:04:08.392448 2018] [core:notice] [pid 1649] AH00094: Command line: '/usr/sbin/apache2'
[Mon Apr 30 14:08:42.590243 2018] [authz_core:error] [pid 1667] [client 10.200.1.104:55754] AH01630: client denied by server configuration: /var/www/nextcloud/data/.ocdata
[Mon Apr 30 14:11:20.457684 2018] [mpm_prefork:notice] [pid 1502] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations
[Mon Apr 30 14:11:20.501389 2018] [core:notice] [pid 1502] AH00094: Command line: '/usr/sbin/apache2'
[Mon Apr 30 14:18:28.595141 2018] [mpm_prefork:notice] [pid 1505] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations
[Mon Apr 30 14:18:28.673734 2018] [core:notice] [pid 1505] AH00094: Command line: '/usr/sbin/apache2'
[Mon Apr 30 14:20:42.530989 2018] [authz_core:error] [pid 1532] [client 10.200.1.104:56392] AH01630: client denied by server configuration: /var/www/nextcloud/data/.ocdata
[Mon Apr 30 14:20:44.777779 2018] [authz_core:error] [pid 1525] [client 10.200.1.104:56406] AH01630: client denied by server configuration: /var/www/nextcloud/data/.ocdata

“1062 Duuplicate entry” is the actual error. I got it all running on ubuntu 18.04. Maybe you can try to delete and recreate the db and start over.

edit: uh and please change the passwords. :slight_smile:

to redo the DB, would that require a complete reinstall of Nextcloud? Or once I recreate the DB, would going to [ip address]/nextcloud just bring me to the setup screen like when I first started.

as for the password, AHHHHH I DIDN’T CATCH THAT OH NO