Skip to content

SQL error background job #2688

Description

@amittel

Just look at the log and found this error occuring at cron times.

Nextcloud 11.0.0 (stable)
Apps: Contacts, Calendar, News
MySQL: Localhost MySQL - (Debian) 5.5.53-0+deb8u1
Encryption: No

Timestamps of error

2016-12-15T09:45:06+0100
2016-12-15T09:15:07+0100
2016-12-15T08:45:02+0100
2016-12-15T08:15:01+0100
2016-12-15T07:45:02+0100
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 [1481784301]: 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 ):
/media/f147882d-b410-4463-873b-e1b81659918a/www/cloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php - line 128: Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
/media/f147882d-b410-4463-873b-e1b81659918a/www/cloud/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)
/media/f147882d-b410-4463-873b-e1b81659918a/www/cloud/apps/activity/lib/MailQueueHandler.php - line 334: Doctrine\DBAL\Statement->execute(Array)
/media/f147882d-b410-4463-873b-e1b81659918a/www/cloud/apps/activity/lib/BackgroundJob/EmailNotification.php - line 131: OCA\Activity\MailQueueHandler->deleteSentItems(Array, 1481784301)
/media/f147882d-b410-4463-873b-e1b81659918a/www/cloud/apps/activity/lib/BackgroundJob/EmailNotification.php - line 81: OCA\Activity\BackgroundJob\EmailNotification->runStep(500, 1481784301)
/media/f147882d-b410-4463-873b-e1b81659918a/www/cloud/lib/private/BackgroundJob/Job.php - line 53: OCA\Activity\BackgroundJob\EmailNotification->run(NULL)
/media/f147882d-b410-4463-873b-e1b81659918a/www/cloud/lib/private/BackgroundJob/TimedJob.php - line 54: OC\BackgroundJob\Job->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))
/media/f147882d-b410-4463-873b-e1b81659918a/www/cloud/cron.php - line 121: OC\BackgroundJob\TimedJob->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))
{main}

The only thing changing is the number in params [1481786100]

Activity

  1. LukasReschke commented on Dec 15, 2016

    @LukasReschke
    Member
  2. nickvergessen commented on Dec 15, 2016

    @nickvergessen
    Member
  3. added this to the Nextcloud 12.0 milestone on Dec 15, 2016
  4. amittel commented on Dec 15, 2016

    @amittel
    ContributorAuthor

    Ok, thanks.
    I'll apply it and see if it works.

  5. nrgeen commented on Dec 15, 2016

    @nrgeen

    @amittel Does it work?
    I have the same problem and it slows down my system pretty much!
    Particularly affected by this seems to be any login procedure and syncronization.

  6. amittel commented on Dec 15, 2016

    @amittel
    ContributorAuthor

    Yes, just checked my log and no errors anymore.

  7. nrgeen commented on Dec 15, 2016

    @nrgeen

    Excuse the question, but have you just exchanged the file "MailQueueHandler.php" or how did you proceed?

  8. amittel commented on Dec 15, 2016

    @amittel
    ContributorAuthor

    Yes, you can just copy the new file or edit the file with the changes from the pull request.
    I edited the file https://github.com/nextcloud/activity/pull/94/files

  9. techc0de commented on Dec 16, 2016

    @techc0de

    Hi,

    I having the same error after updated to NC11 from 10.0.2.
    So, I just copy & paste the fix into my current MailQueueHandler.php?

  10. nickvergessen commented on Dec 19, 2016

    @nickvergessen
    Member

    @tx7 yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions