Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'INSERT INTO oc_filecache #5625

Closed
ghost opened this issue Jul 5, 2017 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Jul 5, 2017

Steps to reproduce

  1. Upload many files trough webbrowser (more then 300 files at the time)
  2. I'm not sure on this one but I think it's many small files, if I upload many small files at the same time around 80kb etc.

Expected behaviour

No error message and all files are uploaded.

Actual behaviour

I get a error message that I have errors, not on all files but on some.
For a example I did upload around 400 files and everyone did upload perfect beside 4 of them.

Server configuration

Operating system:
Ubuntu 16.04.2 LTS

Web server:
Apache2

Database:
MariaDB

PHP version:
7.0

Nextcloud version: (see Nextcloud admin page)
12.0.0

Updated from an older Nextcloud/ownCloud or fresh install:
Fresh install

Where did you install Nextcloud from:
I did use Tech and Me's official install script.

Signing status:

Signing status ``` No errors have been found. ```

List of activated apps:

App list

`Enabled:

  • activity: 2.5.2
  • calendar: 1.5.3
  • contacts: 1.5.3
  • dav: 1.3.0
  • federatedfilesharing: 1.2.0
  • files: 1.7.2
  • files_pdfviewer: 1.1.1
  • files_sharing: 1.4.0
  • files_texteditor: 2.4.1
  • files_trashbin: 1.2.0
  • files_versions: 1.5.0
  • gallery: 17.0.0
  • logreader: 2.0.0
  • lookup_server_connector: 1.0.0
  • nextcloud_announcements: 1.1
  • notifications: 2.0.0
  • oauth2: 1.0.5
  • password_policy: 1.2.2
  • previewgenerator: 1.0.6
  • provisioning_api: 1.2.0
  • serverinfo: 1.2.0
  • sharebymail: 1.2.0
  • survey_client: 1.0.0
  • systemtags: 1.2.0
  • theming: 1.3.0
  • twofactor_backupcodes: 1.1.1
  • updatenotification: 1.2.0
  • workflowengine: 1.2.0
    Disabled:
  • admin_audit
  • comments
  • encryption
  • federation
  • files_external
  • files_videoplayer
  • firstrunwizard
  • user_external
  • user_ldap`

Nextcloud configuration:

Config report

{
"system": {
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"localhost",
"192.168.1.107",
"xxxx",
"xxxxx"
],
"datadirectory": "/var/ncdata",
"overwrite.cli.url": "https://xxxx/",
"dbtype": "mysql",
"version": "12.0.0.29",
"dbname": "nextcloud_db",
"dbhost": "localhost",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"instanceid": "ocw8n8l1q6ms",
"mail_smtpmode": "smtp",
"memcache.local": "\OC\Memcache\Redis",
"filelocking.enabled": true,
"memcache.distributed": "\OC\Memcache\Redis",
"memcache.locking": "\OC\Memcache\Redis",
"redis": {
"host": "/var/run/redis/redis.sock",
"port": 0,
"timeout": 0,
"dbindex": 0,
"password": "REMOVED SENSITIVE VALUE"
},
"htaccess.RewriteBase": "/",
"maintenance": false,
"loglevel": "2",
"log_type": "file",
"logfile": "/var/ncdata/nextcloud.log",
"logtimezone": "Europe/Stockholm",
"mail_smtpsecure": "ssl",
"mail_smtpauthtype": "LOGIN",
"mail_from_address": "tinytechnetse",
"mail_domain": "gmail.com",
"mail_smtpauth": 1,
"mail_smtpport": "465",
"mail_smtphost": "smtp.gmail.com",
"mail_smtpname": "REMOVED SENSITIVE VALUE",
"mail_smtppassword": "REMOVED SENSITIVE VALUE",
"activity_expire_days": 7,
"trashbin_retention_obligation": "1, 7",
"versions_retention_obligation": "1, 2"
}
}

Are you using external storage, if yes which one: local/smb/sftp/...
No
Are you using encryption: yes/no
No
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
No

Client configuration

Browser:
Firefox

Operating system:
Windows 10

Logs

Nextcloud log (data/nextcloud.log)

Nextcloud log
`Error	index	Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'INSERT INTO `oc_filecache` (`mimepart`,`mimetype`,`mtime`,`size`,`etag`,`storage_mtime`,`permissions`,`parent`,`checksum`,`path_hash`,`path`,`name`,`storage`) SELECT ?,?,?,?,?,?,?,?,?,?,?,?,? FROM `oc_filecache` WHERE `storage` = ? AND `path_hash` = ? HAVING COUNT(*) = 0' with params ["10", "12", 1499232820, 0, "c0fa9638f8da6953ec7884d2f3f16ac1", 1499232820, 27, 19665, "", "23204c67535d90d94cea45c824fa02a2", "appdata_ocw8n8l1q6ms\/preview\/11183\/64-64-crop.png", "64-64-crop.png", 2, 2, "23204c67535d90d94cea45c824fa02a2"]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

    /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 213: 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 251: OC\DB\Adapter->insertIfNotExist('*PREFIX*filecac...', Array, Array)
    /var/www/nextcloud/lib/private/Files/Cache/Cache.php - line 273: OC\DB\Connection->insertIfNotExist('*PREFIX*filecac...', Array, Array)
    /var/www/nextcloud/lib/private/Files/Cache/Cache.php - line 230: OC\Files\Cache\Cache->insert('appdata_ocw8n8l...', Array)
    /var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 279: OC\Files\Cache\Cache->put('appdata_ocw8n8l...', Array)
    /var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 216: OC\Files\Cache\Scanner->addToCache('appdata_ocw8n8l...', Array, -1)
    /var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 322: OC\Files\Cache\Scanner->scanFile('appdata_ocw8n8l...', 3, 19665, false, false)
    /var/www/nextcloud/lib/private/Files/Cache/Updater.php - line 124: OC\Files\Cache\Scanner->scan('appdata_ocw8n8l...', false, 3, false)
    /var/www/nextcloud/lib/private/Files/View.php - line 321: OC\Files\Cache\Updater->update('appdata_ocw8n8l...', 1499232820)
    /var/www/nextcloud/lib/private/Files/View.php - line 1147: OC\Files\View->writeUpdate(Object(OCA\Files_Trashbin\Storage), 'appdata_ocw8n8l...')
    /var/www/nextcloud/lib/private/Files/View.php - line 559: OC\Files\View->basicOperation('touch', '/appdata_ocw8n8...', Array, NULL)
    /var/www/nextcloud/lib/private/Files/Node/Folder.php - line 181: OC\Files\View->touch('/appdata_ocw8n8...')
    /var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php - line 83: OC\Files\Node\Folder->newFile('64-64-crop.png')
    /var/www/nextcloud/lib/private/Preview/Generator.php - line 337: OC\Files\SimpleFS\SimpleFolder->newFile('64-64-crop.png')
    /var/www/nextcloud/lib/private/Preview/Generator.php - line 125: OC\Preview\Generator->generatePreview(Object(OC\Files\SimpleFS\SimpleFolder), Object(OC\Files\SimpleFS\SimpleFile), 64, 64, true, 750, 1334)
    /var/www/nextcloud/lib/private/PreviewManager.php - line 201: OC\Preview\Generator->getPreview(Object(OC\Files\Node\File), 64, 64, true, 'fill', 'image/png')
    /var/www/nextcloud/core/Controller/PreviewController.php - line 113: OC\PreviewManager->getPreview(Object(OC\Files\Node\File), 40, 40, true, 'fill')
    [internal function] OC\Core\Controller\PreviewController->getPreview(Object(OC\Files\Node\File), 40, 40, false, false, 'fill')
    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array)
    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OC\Core\Controller\PreviewController), 'getPreview')
    /var/www/nextcloud/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OC\Core\Controller\PreviewController), 'getPreview')
    /var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main('OC\\Core\\Control...', 'getPreview', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
    [internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
    /var/www/nextcloud/lib/private/Route/Router.php - line 299: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
    /var/www/nextcloud/lib/base.php - line 1000: OC\Route\Router->match('/core/preview.p...')
    /var/www/nextcloud/index.php - line 40: OC handleRequest()
    {main}`


Fatal	webdav	Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'INSERT INTO `oc_filecache` (`mimepart`,`mimetype`,`mtime`,`size`,`etag`,`storage_mtime`,`permissions`,`parent`,`checksum`,`path_hash`,`path`,`name`,`storage`) SELECT ?,?,?,?,?,?,?,?,?,?,?,?,? FROM `oc_filecache` WHERE `storage` = ? AND `path_hash` = ? HAVING COUNT(*) = 0' with params ["1", "2", 1499249221, -1, "595cba4574bee", 1499249221, 31, 193, "", "93f99708edca991e4b45529e54d8452d", "appdata_ocw8n8l1q6ms\/dav-photocache\/17c2aa15172c4d4fe7127996672b45bd", "17c2aa15172c4d4fe7127996672b45bd", 2, 2, "93f99708edca991e4b45529e54d8452d"]: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

    /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 213: 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 251: OC\DB\Adapter->insertIfNotExist('*PREFIX*filecac...', Array, Array)
    /var/www/nextcloud/lib/private/Files/Cache/Cache.php - line 273: OC\DB\Connection->insertIfNotExist('*PREFIX*filecac...', Array, Array)
    /var/www/nextcloud/lib/private/Files/Cache/Cache.php - line 230: OC\Files\Cache\Cache->insert('appdata_ocw8n8l...', Array)
    /var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 279: OC\Files\Cache\Cache->put('appdata_ocw8n8l...', Array)
    /var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 216: OC\Files\Cache\Scanner->addToCache('appdata_ocw8n8l...', Array, -1)
    /var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 322: OC\Files\Cache\Scanner->scanFile('appdata_ocw8n8l...', 3, 193, false, false)
    /var/www/nextcloud/lib/private/Files/Cache/Updater.php - line 124: OC\Files\Cache\Scanner->scan('appdata_ocw8n8l...', false, 3, false)
    /var/www/nextcloud/lib/private/Files/View.php - line 321: OC\Files\Cache\Updater->update('appdata_ocw8n8l...', 1499249221)
    /var/www/nextcloud/lib/private/Files/View.php - line 1147: OC\Files\View->writeUpdate(Object(OCA\Files_Trashbin\Storage), 'appdata_ocw8n8l...')
    /var/www/nextcloud/lib/private/Files/View.php - line 269: OC\Files\View->basicOperation('mkdir', '/appdata_ocw8n8...', Array)
    /var/www/nextcloud/lib/private/Files/Node/Folder.php - line 160: OC\Files\View->mkdir('/appdata_ocw8n8...')
    /var/www/nextcloud/lib/private/Files/AppData/AppData.php - line 112: OC\Files\Node\Folder->newFolder('17c2aa15172c4d4...')
    /var/www/nextcloud/apps/dav/lib/CardDAV/PhotoCache.php - line 145: OC\Files\AppData\AppData->newFolder('17c2aa15172c4d4...')
    /var/www/nextcloud/apps/dav/lib/CardDAV/PhotoCache.php - line 38: OCA\DAV\CardDAV\PhotoCache->getFolder('9', '2c563306-9174-4...')
    /var/www/nextcloud/apps/dav/lib/CardDAV/ImageExportPlugin.php - line 104: OCA\DAV\CardDAV\PhotoCache->get('9', '2c563306-9174-4...', 64, Object(Sabre\CardDAV\Card))
    [internal function] OCA\DAV\CardDAV\ImageExportPlugin->httpGet(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 GET', 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/lib/Server.php - line 253: Sabre\DAV\Server->exec()
    /var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 33: OCA\DAV\Server->exec()
    /var/www/nextcloud/remote.php - line 162: require_once('/var/www/nextcl...')
    {main}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants