Error after upgrading to 30.0 : Driver exception

Nextcloud version (eg, 29.0.5): 30.0.0
Operating system and version (eg, Ubuntu 24.04): Ubuntu 22.04 LTS
Apache or nginx version (eg, Apache 2.4.25): NGINX
PHP version (eg, 8.3): 8.3

The issue you are facing:

After upgrading from 29-0.7 to 30.0.0 i have a lot of this errors belong to core system marked as “Driver Exception: an exception occurred while executing a query…” as by attached log.
I believed it was due calendar app. incompatibility.
I ensured to uninstall/install again several times the calendar-app compatible with NC30.
At now i fully disabled and uninstalled it but the errors are still ongoing.
The WORST thing this stucks the whole web frontend. It’s close to impossible to look/copy the log as it stucks on that page with long/infinite wait time. Also trying to change page become impossible. i have just close te browser tab and open a new window. It “seems” does not affects overall functionalities but it’s now critical for described behaviour.
I made a clean upgrade and ran the post installation occ commands.
I also faced the whitheboard-app issue, now solved with the workaround.
Any idea ?

Is this the first time you’ve seen this error? (Y/N): Y

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

{
  "reqId": "pyDeIhraMZ6wBpDVTEMx",
  "level": 3,
  "time": "2024-09-15T08:25:02+02:00",
  "remoteAddr": "",
  "user": "--",
  "app": "core",
  "method": "",
  "url": "--",
  "message": "Error while running background job OCA\\DAV\\BackgroundJob\\EventReminderJob (id: 27, arguments: null)",
  "userAgent": "--",
  "version": "30.0.0.14",
  "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": 415,
        "function": "executeQuery",
        "class": "Doctrine\\DBAL\\Connection",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php",
        "line": 50,
        "function": "executeQuery",
        "class": "OC\\DB\\Connection",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
        "line": 272,
        "function": "executeQuery",
        "class": "OC\\DB\\ConnectionAdapter",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
        "line": 249,
        "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": 415,
          "function": "executeQuery",
          "class": "Doctrine\\DBAL\\Connection",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php",
          "line": 50,
          "function": "executeQuery",
          "class": "OC\\DB\\Connection",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
          "line": 272,
          "function": "executeQuery",
          "class": "OC\\DB\\ConnectionAdapter",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
          "line": 249,
          "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": 415,
            "function": "executeQuery",
            "class": "Doctrine\\DBAL\\Connection",
            "type": "->"
          },
          {
            "file": "/var/www/nextcloud/lib/private/DB/ConnectionAdapter.php",
            "line": 50,
            "function": "executeQuery",
            "class": "OC\\DB\\Connection",
            "type": "->"
          },
          {
            "file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
            "line": 272,
            "function": "executeQuery",
            "class": "OC\\DB\\ConnectionAdapter",
            "type": "->"
          },
          {
            "file": "/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php",
            "line": 249,
            "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: 27, arguments: null)",
    "exception": [],
    "CustomMessage": "Error while running background job OCA\\DAV\\BackgroundJob\\EventReminderJob (id: 27, arguments: null)"
  },
  "id": "66e67ea094ef8"
}
5 Likes

Same here, ever since 30 rc1.

it logged already 1137 errors in 2 days and i’m the only users. Administration page become fully unresponsive. I regret to upgrade to 30.0.0 , 29.0.7 was perfect for me. Is there a way to “safely” rollback ? I rather prefer something stable rather than new features.

Same here. Nextcloud AIO fresh install with 30.0 .

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: 31, arguments: null)

1 Like

seems to be a known bug [Bug]: DriverException during BackgroundJob · Issue #47275 · nextcloud/server · GitHub please follow/upvote it on Github

Same issue here after updating to 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 as suggested here: https://github.com/nextcloud/server/issues/47275

Any solution other than waiting for update?

2 Likes

same behavior here.

1 Like

I have the same problem.
I installed Nextcloud via the AiO Docker reverse proxy image and had the bug immediately after installation.

Wanted to give Nextcloud another chance after many years and now this.

1 Like

HI,
same problem here with NC AIO installed from scratch.
No reverse proxy and for me too, the bug are visible after installation

1 Like

This is going to be fixed in Nextcloud 30.0.1. See [stable30] fix: expand select and group by for calendar reminder backend by backportbot[bot] · Pull Request #48211 · nextcloud/server · GitHub

2 Likes

Tested this on my system, no more errors! Thanks!

Could you please share, how you did apply the fixes, I’m kind of lost here…

Thx!

Hi @La-Fabrique-Info

How to apply a patch is → explained and described in the manual ←


Much and good luck,
ernolf

1 Like

I’ve followed the instructions here:
https://docs.nextcloud.com/server/latest/admin_manual/issues/applying_patch.html#patching-apps

And here is the patch:
https://patch-diff.githubusercontent.com/raw/nextcloud/server/pull/48211.patch

It looks like two files are to be patched, as described here:

The two files are:

  1. apps/dav/lib/CalDAV/Reminder/Backend.php
  2. apps/dav/tests/unit/CalDAV/Reminder/BackendTest.php

The second one doesn’t exist on my install ( actually the whole apps/dav/tests directory does not exist ) , so what is it’s purpose?
Should I patch only the first one?

2 Likes

Ok never had to apply some patch before… Every day is a day for learning something :grin:, Thanks for you answers.

Same as @aledef here, the folder apps/dav/tests does not exists at all.
I’ve install NC AIO with docker, and using V 30.0.0.

Seems patch solved the issue. Regarding about “test” guess is just because is a development patch used also with a test environment. Here what i did:

  1. navigate to root NC folder (check for status.php to ensure you’re in the right place)
  2. sudo https://patch-diff.githubusercontent.com/raw/nextcloud/server/pull/48211.patch
  3. patch -p 1 < 48211.patch

At this point it will prompt how to proceed as the /test directory does not exists (this is my case a standard NC installation). Just ignore (press enter) it will ask if you wanna skip those files, do that.

That’s all. I did like that and since 40 minutes i do not log that error anymore. If you wanna be 100% sure do not worsen things just make a backup of the original file (sudo cp Backend.php Backend_original.php from the appropriate indicated path) in case you can rollback and wait for an official patch/update.

1 Like

In an All-In-One Docker container, you cannot simply apply patches as described in the manual. AIO is designed in such a way that the user does not need to know or understand anything, but can also hardly customize anything beyond the standard. All errors are fixed by the developers and you have to wait for the new container.


ernolf

Running AIO here. I just manually edited the Backend.php file per the Git revisions. It was a pretty simple change. So, sudo nano /var/www/nextcloud/apps/dav/lib/CalDAV/Reminder/Backend.php and then cut/paste the changes. Done.

1 Like

Yes. Of course that is possible. And? Are those changes persistent between reboots?


ernolf

Yes, should be until the next Nextcloud update

1 Like