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 INTO ocā€¦ā€™, 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('UPDATE oc_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