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

[Bug]: DriverException during BackgroundJob #47275

Closed
6 of 8 tasks
AndyFx12 opened this issue Aug 16, 2024 · 12 comments · Fixed by #47399
Closed
6 of 8 tasks

[Bug]: DriverException during BackgroundJob #47275

AndyFx12 opened this issue Aug 16, 2024 · 12 comments · Fixed by #47399
Assignees
Labels
3. to review Waiting for reviews 30-feedback bug feature: caldav Related to CalDAV internals regression

Comments

@AndyFx12
Copy link

AndyFx12 commented Aug 16, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

On every backgroundjob I see an error at protocol:
DriverException
An exception occurred while executing a query: SQLSTATE[42803]: Grouping error: 7 ERROR: column "cr.id" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT "cr".*, "co"."calendardata", "c"."displayname", "c"."... ^
Error while running background job OCA\DAV\BackgroundJob\EventReminderJob (id: 9156, arguments: null)

Steps to reproduce

  1. Use NC30 RC1
  2. Let CRON start backgroundjobs
  3. Look at your logfile.

Expected behavior

No error should be visible.

Installation method

None

Nextcloud Server version

30rc1

Operating system

Ubuntu 22.04

PHP engine version

8.2

Web server

Apache

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "debug": false,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "simpleSignUpLink.shown": false,
        "trusted_domains": [
            "cloud.s-t-franz.de",
            "localhost",
            "192.168.1.3",
            "nextcloud"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/192.168.1.3\/nextcloud",
        "overwritehost": "cloud.s-t-franz.de",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "30.0.0.8",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "session_relaxed_expiry": false,
        "mail_smtpmode": "smtp",
        "log_rotate_size": "10485760",
        "maintenance_window_start": "1",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": true,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0.5,
            "dbindex": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "htaccess.RewriteBase": "\/",
        "loglevel": "2",
        "log_type": "file",
        "logfile": "\/mnt\/ncdata\/nextcloud.log",
        "logtimezone": "Europe\/Berlin",
        "default_phone_region": "DE",
        "maintenance": false,
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpstreamoptions": {
            "ssl": {
                "allow_self_signed": true,
                "verify_peer": false,
                "verify_peer_name": false
            }
        },
        "theme": "",
        "updater.release.channel": "beta",
        "app_install_overwrite": [
            "calendar",
            "bruteforcesettings",
            "admin_notifications",
            "onlyoffice",
            "files_trackdownloads",
            "checksum",
            "music",
            "twofactor_totp",
            "twofactor_email",
            "impersonate",
            "previewgenerator"
        ],
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "has_rebuilt_cache": true,
        "mail_sendmailmode": "smtp"
    }
}

List of activated Apps

Enabled:
  - activity: 3.0.0
  - admin_audit: 1.20.0
  - admin_notifications: 1.0.2
  - bruteforcesettings: 3.0.0
  - checksum: 1.2.4
  - cloud_federation_api: 1.13.0
  - comments: 1.20.1
  - contactsinteraction: 1.11.0
  - dav: 1.31.1
  - federatedfilesharing: 1.20.0
  - federation: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - firstrunwizard: 3.0.0
  - impersonate: 1.17.0
  - integration_openai: 3.0.1
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - nextcloud_announcements: 2.0.0
  - notifications: 3.0.0
  - oauth2: 1.18.0
  - password_policy: 2.0.0
  - photos: 3.0.2
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - support: 2.0.0
  - survey_client: 2.0.0
  - systemtags: 1.20.0
  - theming: 2.5.0
  - twofactor_backupcodes: 1.19.0
  - twofactor_email: 2.7.4
  - twofactor_totp: 12.0.0-dev
  - updatenotification: 1.20.0
  - user_ldap: 1.21.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - workflowengine: 2.12.0
Disabled:
  - circles: 30.0.0-dev (installed 28.0.0-dev)
  - dashboard: 7.10.0 (installed 7.1.0)
  - encryption: 2.18.0
  - files_external: 1.22.0
  - suspicious_login: 8.0.0
  - text: 4.1.0 (installed 3.9.1)
  - twofactor_nextcloud_notification: 4.0.0
  - weather_status: 1.10.0 (installed 1.0.0)
  - webhook_listeners: 1.1.0-dev

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"6jbk5hTxCTGD3EtOmsWM","level":3,"time":"2024-08-16T12:15:08+02:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Error while running background job OCA\\DAV\\BackgroundJob\\EventReminderJob (id: 9156, arguments: null)","userAgent":"--","version":"30.0.0.8","exception":{"Exception":"Doctrine\\DBAL\\Exception\\DriverException","Message":"An exception occurred while executing a query: SQLSTATE[42803]: Grouping error: 7 ERROR:  column \"cr.id\" must appear in the GROUP BY clause or be used in an aggregate function\nLINE 1: SELECT \"cr\".*, \"co\".\"calendardata\", \"c\".\"displayname\", \"c\".\"...\n               ^","Code":7,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1943,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1885,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1106,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":312,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php","line":48,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":271,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":248,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/Backend.php","line":53,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php","line":104,"function":"getRemindersToProcess","class":"OCA\\DAV\\CalDAV\\Reminder\\Backend","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/BackgroundJob/EventReminderJob.php","line":50,"function":"processReminders","class":"OCA\\DAV\\CalDAV\\Reminder\\ReminderService","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\DAV\\BackgroundJob\\EventReminderJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":83,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":73,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":162,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php","Line":87,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[42803]: Grouping error: 7 ERROR:  column \"cr.id\" must appear in the GROUP BY clause or be used in an aggregate function\nLINE 1: SELECT \"cr\".*, \"co\".\"calendardata\", \"c\".\"displayname\", \"c\".\"...\n               ^","Code":7,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1099,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":312,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php","line":48,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":271,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":248,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/Backend.php","line":53,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php","line":104,"function":"getRemindersToProcess","class":"OCA\\DAV\\CalDAV\\Reminder\\Backend","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/BackgroundJob/EventReminderJob.php","line":50,"function":"processReminders","class":"OCA\\DAV\\CalDAV\\Reminder\\ReminderService","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\DAV\\BackgroundJob\\EventReminderJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":83,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":73,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":162,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":28,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[42803]: Grouping error: 7 ERROR:  column \"cr.id\" must appear in the GROUP BY clause or be used in an aggregate function\nLINE 1: SELECT \"cr\".*, \"co\".\"calendardata\", \"c\".\"displayname\", \"c\".\"...\n               ^","Code":"42803","Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":130,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1099,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":312,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php","line":48,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":271,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":248,"function":"executeQuery","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/Backend.php","line":53,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/ReminderService.php","line":104,"function":"getRemindersToProcess","class":"OCA\\DAV\\CalDAV\\Reminder\\Backend","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/BackgroundJob/EventReminderJob.php","line":50,"function":"processReminders","class":"OCA\\DAV\\CalDAV\\Reminder\\ReminderService","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\DAV\\BackgroundJob\\EventReminderJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":83,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":73,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":162,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":130}},"message":"Error while running background job OCA\\DAV\\BackgroundJob\\EventReminderJob (id: 9156, arguments: null)","exception":{},"CustomMessage":"Error while running background job OCA\\DAV\\BackgroundJob\\EventReminderJob (id: 9156, arguments: null)"}}

Additional info

No response

@AndyFx12 AndyFx12 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Aug 16, 2024
@kesselb kesselb added the feature: caldav Related to CalDAV internals label Aug 16, 2024
@kesselb
Copy link
Contributor

kesselb commented Aug 16, 2024

@AndyFx12 AndyFx12 changed the title [Bug]: DriverExeption during BackgroundJob [Bug]: DriverException during BackgroundJob Aug 16, 2024
@miaulalala
Copy link
Contributor

miaulalala commented Aug 19, 2024

Hello full GROUP MY, my old f(r)iend. Not MYSQL; the same principle applies.

@ChristophWurst
Copy link
Member

Yep: #41740 (review)

@ChristophWurst ChristophWurst added 1. to develop Accepted and waiting to be taken care of regression and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Aug 20, 2024
@ChristophWurst
Copy link
Member

@hamza221 this should be easy to reproduce if you use mysql/mariadb and (temporarily) enable strict mode. Every SELECTed column has to be in the GROUP BY as well. Expand cr.* to the individual columns in SELECT and GROUP BY.

@grandgeorg
Copy link

I'm on the stable update channel and updated to 30.0.0 today. And now I have this bug. I cannot believe, that this is still open while pushing 30.0.0 to stable - this is very bad.

@lukasig
Copy link

lukasig commented Sep 19, 2024

There are discussions raised about this bot on github and nc forums, but no solution provided.

Can anything be done on the admin side?

@miaulalala
Copy link
Contributor

There are discussions raised about this bot on github and nc forums, but no solution provided.

Can anything be done on the admin side?

Right this second you could disable the full GROUP BY in MySQL should you be using that.

Fix is in #47399

@grandgeorg
Copy link

Can anything be done on the admin side?

Sure, under e.g. Ubuntu, edit the my.cnf file under /etc/mysql/my.cnf and add the following line under the [mysqld] section:

[mysqld]
sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"

Then restart the MySQL server with:

sudo systemctl restart mysql

@aledef
Copy link

aledef commented Sep 19, 2024

Same issue here, after updating to version 30.0.0
I'm on the stable update channel and this is not the firs time I get big issues after updating, next time I'll wait for XX.0.1 !

Calendar notifications are not working and I get hundreds of errors in the log like this one:
"DriverException An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'xxxxxxx.cr.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by"

My Nextcloud is on a shared hosting so I can't edit /etc/mysql/my.cnf

@lukasig
Copy link

lukasig commented Sep 19, 2024

Sure, under e.g. Ubuntu, edit the my.cnf file under /etc/mysql/my.cnf and add the following line under the [mysqld] section:

[mysqld]
sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"

Then restart the MySQL server with:

sudo systemctl restart mysql

is that the same if I am running nc under docker in ubuntu ?

@pietricello
Copy link

I’m sorry, but putting aside how old and well-known this bug is, I believe the suggested approach is conceptually wrong. You cannot ask users to modify the MySQL/MariaDB configuration file just to fix an issue related to NC. Please keep in mind that many people may have other software installed that also relies on MariaDB. Who can guarantee that this modification won’t negatively affect other services relying on MariaDB? I don’t think anyone can.

@ChristophWurst
Copy link
Member

Please, keep the discussion and support at https://help.nextcloud.com/t/error-after-upgrading-to-30-0-driver-exception/203947.

The bug is known and tracked, we have a fix in QA and a planned backport. Feel free to apply the linked PR as patch, or wait for the next maintenance update.

@nextcloud nextcloud locked as resolved and limited conversation to collaborators Sep 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3. to review Waiting for reviews 30-feedback bug feature: caldav Related to CalDAV internals regression
Projects
Status: ☑️ Done
Development

Successfully merging a pull request may close this issue.

10 participants