NC 11: Error using PHP7

Hello,

installed NC 11 today using PHP7 but it doesn’t work. I’m getting this error:

PHP Fatal error: Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory in /nextcloud/lib/private/DB/Connection.php:60\nStack trace:\n#0 /nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n#1 /nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(621): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /nextcloud/lib/private/DB/Connection.php(147): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection in /nextcloud/lib/private/DB/Connection.php on line 60

I’m a little bit confused about this. What’s the problem? With PHP 5.6 it works fine!

Thanks for your help!

Do you have the php7.0-mysql module installed? You can try php -m to list installed & enabled PHP modules, to check that it is present.

Looks like v11 is not stable yet, below there are too many concerns with PHP7; sql driver is ok
v10.0.02 is doing fine with PHP7, as per others v11 is doing fine with PHP5.6 which means that, v11 is not ready yet for PHP7.

Look at the below reported behavior,

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/c0abc2205a08c7226c40f51b4b8c045c”, -1, 1482017777, “files/c0abc2205a08c7226c40f51b4b8c045c”]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘files/c0abc2205a08c7226c40f51b4b8c045c’ for key ‘lock_key_index’
/var/www/html/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/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 996: Doctrine\DBAL\DBALException driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), ‘INSERT INTO oc...', Array) /var/www/html/nextcloud/lib/private/DB/Connection.php - line 215: Doctrine\DBAL\Connection->executeUpdate('INSERT INTOoc…’, Array, Array)
/var/www/html/nextcloud/lib/private/DB/Adapter.php - line 114: OC\DB\Connection->executeUpdate(‘INSERT INTO `oc…’, Array)
/var/www/html/nextcloud/lib/private/DB/Connection.php - line 253: OC\DB\Adapter->insertIfNotExist(‘PREFIXfile_lo…’, Array, Array)
/var/www/html/nextcloud/lib/private/Lock/DBLockingProvider.php - line 118: OC\DB\Connection->insertIfNotExist(‘PREFIXfile_lo…’, Array, Array)
/var/www/html/nextcloud/lib/private/Lock/DBLockingProvider.php - line 178: OC\Lock\DBLockingProvider->initLockField(‘files/c0abc2205…’, -1)
/var/www/html/nextcloud/lib/private/Files/Storage/Common.php - line 680: OC\Lock\DBLockingProvider->acquireLock(‘files/c0abc2205…’, 2)
/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 588: OC\Files\Storage\Common->acquireLock(‘scanner appdat…’, 2, Object(OC\Lock\DBLockingProvider))
/var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 588: OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner appdat…’, 2, Object(OC\Lock\DBLockingProvider))
/var/www/html/nextcloud/lib/private/Files/Cache/Scanner.php - line 316: OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner appdat…’, 2, Object(OC\Lock\DBLockingProvider))
/var/www/html/nextcloud/lib/private/Files/View.php - line 1301: OC\Files\Cache\Scanner->scan(‘appdata_oc77ydd…’, false)
/var/www/html/nextcloud/lib/private/Files/View.php - line 1342: OC\Files\View->getCacheEntry(Object(OCA\Files_Trashbin\Storage), ‘appdata_oc77ydd…’, ‘/appdata_oc77yd…’)
/var/www/html/nextcloud/lib/private/Files/Node/Root.php - line 196: OC\Files\View->getFileInfo(’/appdata_oc77yd…’)
/var/www/html/nextcloud/lib/private/Files/Node/Folder.php - line 122: OC\Files\Node\Root->get(’/appdata_oc77yd…’)
/var/www/html/nextcloud/lib/private/Files/AppData/AppData.php - line 89: OC\Files\Node\Folder->get(‘theming’)
/var/www/html/nextcloud/lib/private/Files/AppData/AppData.php - line 105: OC\Files\AppData\AppData->getAppDataFolder()
/var/www/html/nextcloud/apps/theming/lib/ImageManager.php - line 62: OC\Files\AppData\AppData->getFolder(‘0’)
/var/www/html/nextcloud/apps/theming/lib/ImageManager.php - line 78: OCA\Theming\ImageManager->getCacheFolder()
/var/www/html/nextcloud/apps/theming/lib/Controller/IconController.php - line 94: OCA\Theming\ImageManager->getCachedImage(‘icon-core-filet…’)
[internal function] OCA\Theming\Controller\IconController->getThemedIcon(‘core’, ‘filetypes/folde…’)
/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array)
/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Theming\Controller\IconController), ‘getThemedIcon’)
/var/www/html/nextcloud/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Theming\Controller\IconController), ‘getThemedIcon’)
/var/www/html/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main(‘OCA\Theming\Con…’, ‘getThemedIcon’, Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
[internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
/var/www/html/nextcloud/lib/private/Route/Router.php - line 299: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
/var/www/html/nextcloud/lib/base.php - line 1010: OC\Route\Router->match(’/apps/theming/i…’)
/var/www/html/nextcloud/index.php - line 40: OC handleRequest()
{main}

AND

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘UPDATE oc_filecache SET mtime = GREATEST(mtime, ?), etag = ? WHERE (storage = ?) AND (path_hash IN (‘d41d8cd98f00b204e9800998ecf8427e’, ‘0408b6d83c754dd91352ec76b9476660’, ‘dc105a434443413656cda016551f8145’, ‘1336ef2e36a0460cdaf958996f1fda50’))’ with params [1482014239, “5855be1f571a9”, 3]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction
/var/www/html/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/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 996: Doctrine\DBAL\DBALException driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), ‘UPDATE oc_file...', Array) /var/www/html/nextcloud/lib/private/DB/Connection.php - line 215: Doctrine\DBAL\Connection->executeUpdate('UPDATEoc_file…’, Array, Array)
/var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php - line 208: OC\DB\Connection->executeUpdate(‘UPDATE `oc_file…’, Array, Array)
/var/www/html/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php - line 177: Doctrine\DBAL\Query\QueryBuilder->execute()
/var/www/html/nextcloud/lib/private/Files/Cache/Propagator.php - line 88: OC\DB\QueryBuilder\QueryBuilder->execute()
/var/www/html/nextcloud/lib/private/Files/Cache/Updater.php - line 138: OC\Files\Cache\Propagator->propagateChange(‘appdata_oc77ydd…’, 1482014239, 0)
/var/www/html/nextcloud/lib/private/Files/View.php - line 318: OC\Files\Cache\Updater->update(‘appdata_oc77ydd…’, 1482014239)
/var/www/html/nextcloud/lib/private/Files/View.php - line 1142: OC\Files\View->writeUpdate(Object(OCA\Files_Trashbin\Storage), ‘appdata_oc77ydd…’, 1482014239)
/var/www/html/nextcloud/lib/private/Files/View.php - line 556: OC\Files\View->basicOperation(‘touch’, ‘/appdata_oc77yd…’, Array, NULL)
/var/www/html/nextcloud/lib/private/Files/Node/Folder.php - line 170: OC\Files\View->touch(’/appdata_oc77yd…’)
/var/www/html/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php - line 83: OC\Files\Node\Folder->newFile(‘icon-core-filet…’)
/var/www/html/nextcloud/apps/theming/lib/ImageManager.php - line 94: OC\Files\SimpleFS\SimpleFolder->newFile(‘icon-core-filet…’)
/var/www/html/nextcloud/apps/theming/lib/Controller/IconController.php - line 100: OCA\Theming\ImageManager->setCachedImage(‘icon-core-filet…’, ‘<svg xmlns="htt…’)
[internal function] OCA\Theming\Controller\IconController->getThemedIcon(‘core’, ‘filetypes/text…’)
/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array)
/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Theming\Controller\IconController), ‘getThemedIcon’)
/var/www/html/nextcloud/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Theming\Controller\IconController), ‘getThemedIcon’)
/var/www/html/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main(‘OCA\Theming\Con…’, ‘getThemedIcon’, Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
[internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
/var/www/html/nextcloud/lib/private/Route/Router.php - line 299: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
/var/www/html/nextcloud/lib/base.php - line 1010: OC\Route\Router->match(’/apps/theming/i…’)
/var/www/html/nextcloud/index.php - line 40: OC handleRequest()
{main}

I failed to run upgrade by just checking out the stable11. once I remembered to also git submodule update, everything fell into place.

Hi

NC11 on Plesk Onyx 17.0.17 on U16.04.1 MySQL 5.7 with PHP-FPM 7.0.18 installs smooth. After several login screen takes up to 10 minutes to reach login screen after typing in URL. After entering username pw it takes 3-4 minute to enter in NC. No errors or entries in error_log found, also not in NC log.

Switch to PHP 5.6.28 it takes also 5-6 minutes to reach login screen after typing in URL, after entering username pw it takes 3-4 minute to enter in NC. But now in CN log following error is shown:

        Error while running background job (Doctrine\DBAL\Exception\SyntaxErrorException): An exception occurred while executing 'DELETE FROM `oc_activity_mq` WHERE `amq_timestamp` <= ? AND `amq_affecteduser` IN ()' with params [1482062740]: 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 ')' at line 1
OCA\Activity\BackgroundJob\EmailNotification ):
/var/www/httpdocs/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/httpdocs/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Statement.php - line 178: Doctrine\DBAL\DBALException driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'DELETE FROM `oc...', Array)
/var/www/httpdocs/apps/activity/lib/MailQueueHandler.php - line 334: Doctrine\DBAL\Statement->execute(Array)
/var/www/httpdocs/apps/activity/lib/BackgroundJob/EmailNotification.php - line 131: OCA\Activity\MailQueueHandler->deleteSentItems(Array, 1482062740)
/var/www/httpdocs/apps/activity/lib/BackgroundJob/EmailNotification.php - line 85: OCA\Activity\BackgroundJob\EmailNotification->runStep(25, 1482062740)
/var/www/httpdocs/lib/private/BackgroundJob/Job.php - line 53: OCA\Activity\BackgroundJob\EmailNotification->run(NULL)
/var/www/httpdocs/lib/private/BackgroundJob/TimedJob.php - line 54: OC\BackgroundJob\Job->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))
/var/www/httpdocs/cron.php - line 145: OC\BackgroundJob\TimedJob->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))
{main}

Yes, it’s installed. The problem was the database host address… Now it works… Thanks for your idea!!

@oliverm: This looks like my error I had: https://github.com/nextcloud/server/issues/2688