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

Error while running background job (Doctrine\DBAL\Exception\DriverException): #7336

Closed
nix155 opened this issue Nov 29, 2017 · 1 comment
Closed

Comments

@nix155
Copy link

nix155 commented Nov 29, 2017

nextcloud.log

error.log

Steps to reproduce

Error appears every time cron is run

Error | core | Error while running background job (Doctrine\DBAL\Exception\DriverException): An exception occurred while executing 'DELETE FROM oc_share WHERE item_type in ('file', 'folder') AND NOT EXISTS (SELECT fileid FROM oc_filecache WHERE file_source = fileid)': SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction | 2017-11-29T13:45:04+0300
Error | core | Error while running background job (Doctrine\DBAL\Exception\DriverException): An exception occurred while executing 'DELETE FROM oc_share WHERE item_type in ('file', 'folder') AND NOT EXISTS (SELECT fileid FROM oc_filecache WHERE file_source = fileid)': SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction | 2017-11-29T12:15:04+0300
Error | core | Error while running background job (Doctrine\DBAL\Exception\DriverException): An exception occurred while executing 'DELETE FROM oc_share WHERE item_type in ('file', 'folder') AND NOT EXISTS (SELECT fileid FROM oc_filecache WHERE file_source = fileid)': SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction | 2017-11-29T11:45:04+0300

Expected behaviour

No error

Actual behaviour

Error core Error while running background job (Doctrine\DBAL\Exception\DriverException): An exception occurred while executing 'DELETE FROM oc_share WHERE item_type in ('file', 'folder') AND NOT EXISTS (SELECT fileid FROM oc_filecache WHERE file_source = fileid)': SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transactionOCA\Files_Sharing\DeleteOrphanedSharesJob ):/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), 'DELETE FROM oc...', Array)/var/www/nextcloud/lib/private/DB/Connection.php - line 213: Doctrine\DBAL\Connection->executeUpdate('DELETE FROM oc...', Array, Array)/var/www/nextcloud/apps/files_sharing/lib/DeleteOrphanedSharesJob.php - line 62: OC\DB\Connection->executeUpdate('DELETE FROM `oc...')/var/www/nextcloud/lib/private/BackgroundJob/Job.php - line 59: OCA\Files_Sharing\DeleteOrphanedSharesJob->run(NULL)/var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php - line 54: OC\BackgroundJob\Job->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))/var/www/nextcloud/cron.php - line 124: OC\BackgroundJob\TimedJob->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log)){main}

Server configuration

Operating system:
Ubuntu 16.04.3 LTS

Web server:
Apache/2.4.18 (Ubuntu)

Database:
10.0.31-MariaDB-0ubuntu0.16.04.2 Ubuntu 16.04

PHP version:
PHP 7.0.22-0ubuntu0.16.04.1

Nextcloud version: (see Nextcloud admin page)
Nextcloud 12.0.4 RC2

Updated from an older Nextcloud/ownCloud or fresh install:
Updated from 12.0.3 Stable

Where did you install Nextcloud from:
nextcloud.com

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

<!doctype html>

<title>Example Domain</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body {
    background-color: #f0f0f2;
    margin: 0;
    padding: 0;
    font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

}
div {
    width: 600px;
    margin: 5em auto;
    padding: 50px;
    background-color: #fff;
    border-radius: 1em;
}
a:link, a:visited {
    color: #38488f;
    text-decoration: none;
}
@media (max-width: 700px) {
    body {
        background-color: #fff;
    }
    div {
        width: auto;
        margin: 0 auto;
        border-radius: 0;
        padding: 1em;
    }
}
</style>

Example Domain

This domain is established to be used for illustrative examples in documents. You may use this domain in examples without prior coordination or asking for permission.

More information...

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Enabled:

  • activity: 2.5.2
  • bruteforcesettings: 1.0.2
  • comments: 1.2.0
  • dav: 1.3.0
  • federatedfilesharing: 1.2.0
  • federation: 1.2.0
  • files: 1.7.2
  • files_external: 1.3.0
  • 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
  • files_videoplayer: 1.1.0
  • firstrunwizard: 2.1
  • 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
  • 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
  • user_ldap: 1.2.1
  • workflowengine: 1.2.0
    Disabled:
  • admin_audit
  • encryption
  • user_external

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

{
"system": {
"instanceid": "ocpxggd0drhb",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"next.rcstroy.com"
],
"datadirectory": "/var/nextcloud/data",
"overwrite.cli.url": "https://next.rcstroy.com/nextcloud",
"dbtype": "mysql",
"version": "12.0.4.1",
"dbname": "nextcloud",
"dbhost": "localhost",
"dbport": "",
"dbtableprefix": "oc_",
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"htaccess.RewriteBase": "/nextcloud",
"memcache.local": "\OC\Memcache\APCu",
"memcache.locking": "\OC\Memcache\Redis",
"redis": {
"host": "localhost",
"port": 6379
},
"mail_smtpmode": "smtp",
"mail_smtpauthtype": "LOGIN",
"mail_from_address": "nextcloud",
"mail_domain": "rcstroy.com",
"mail_smtphost": "172.16.127.5",
"updater.release.channel": "beta",
"ldapIgnoreNamingRules": false,
"ldapProviderFactory": "\OCA\User_LDAP\LDAPProviderFactory",
"updater.secret": "REMOVED SENSITIVE VALUE",
"maintenance": false,
"theme": "",
"loglevel": 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/...
LDAP/ActiveDirectory

LDAP configuration (delete this part if not used)

LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Configuration | |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| hasMemberOfFilterSupport | 1 |
| hasPagedResultSupport | |
| homeFolderNamingRule | |
| lastJpegPhotoLookup | 0 |
| ldapAgentName | CN=nextcloud,OU=Services,DC=su151,DC=local |
| ldapAgentPassword | *** |
| ldapAttributesForGroupSearch | |
| ldapAttributesForUserSearch | |
| ldapBackupHost | dc3.su151.local |
| ldapBackupPort | 389 |
| ldapBase | DC=su151,DC=local |
| ldapBaseGroups | DC=su151,DC=local |
| ldapBaseUsers | DC=su151,DC=local |
| ldapCacheTTL | 600 |
| ldapConfigurationActive | 1 |
| ldapDefaultPPolicyDN | |
| ldapDynamicGroupMemberURL | |
| ldapEmailAttribute | mail |
| ldapExperiencedAdmin | 0 |
| ldapExpertUUIDGroupAttr | |
| ldapExpertUUIDUserAttr | |
| ldapExpertUsernameAttr | sAMAccountName |
| ldapGidNumber | gidNumber |
| ldapGroupDisplayName | cn |
| ldapGroupFilter | (&(|(objectclass=group))(|(cn=Пользователи nextCloud))) |
| ldapGroupFilterGroups | Пользователи nextCloud |
| ldapGroupFilterMode | 0 |
| ldapGroupFilterObjectclass | group |
| ldapGroupMemberAssocAttr | member |
| ldapHost | dc1.su151.local |
| ldapIgnoreNamingRules | |
| ldapLoginFilter | (&(&(|(objectclass=person))(|(|(memberof=CN=Пользователи nextCloud,OU=Пользователи nextCloud,OU=Пользователи ресурсов СУ151,OU=Ресурсы,OU=СУ151,DC=su151,DC=local)(primaryGroupID=6766))))(|(|(mailPrimaryAddress=%uid)(mail=%uid))(|(sAMAccountName=%uid)))) |
| ldapLoginFilterAttributes | sAMAccountName |
| ldapLoginFilterEmail | 1 |
| ldapLoginFilterMode | 0 |
| ldapLoginFilterUsername | 1 |
| ldapNestedGroups | 0 |
| ldapOverrideMainServer | |
| ldapPagingSize | 500 |
| ldapPort | 389 |
| ldapQuotaAttribute | |
| ldapQuotaDefault | |
| ldapTLS | 0 |
| ldapUserDisplayName | displayName |
| ldapUserDisplayName2 | |
| ldapUserFilter | (&(|(objectclass=person))(|(|(memberof=CN=Пользователи nextCloud,OU=Пользователи nextCloud,OU=Пользователи ресурсов СУ151,OU=Ресурсы,OU=СУ151,DC=su151,DC=local)(primaryGroupID=6766)))) |
| ldapUserFilterGroups | Пользователи nextCloud |
| ldapUserFilterMode | 1 |
| ldapUserFilterObjectclass | person |
| ldapUuidGroupAttribute | auto |
| ldapUuidUserAttribute | auto |
| turnOffCertCheck | 0 |
| turnOnPasswordChange | 0 |
| useMemberOfToDetectMembership | 1 |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Client configuration

Google Chrome 62.0.3202.94

Operating system:
Windows 10

Logs

Web server error log

Web server error log [access.log](https://github.com/nextcloud/server/files/1513606/access.log) [error.log](https://github.com/nextcloud/server/files/1513607/error.log) [nextcloud.log](https://github.com/nextcloud/server/files/1513608/nextcloud.log) [access.log](https://github.com/nextcloud/server/files/1513610/access.log)
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@Poikilos
Copy link

Poikilos commented Apr 17, 2019

This exception while running a background job can be caused by not having the php in your path set to the same version as is actually enabled as an apache module (and then when the cron job or systemd timer runs "php" or "/usr/bin/php", the PHP version doesn't match the version on which Nextcloud is running). When that is the cause, fix the exception by configuring /etc/alternatives correctly: #11638 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants