nextcloud / nextcloud/notifications

[5.0.0-dev] Since NC32: Controller OCA\Notifications\Controller\EndpointController::listNotifications executed 121 queries.

Open
#2,508 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug performance
Dominant language
JavaScript
Stars
153
Forks
67
Avg merge
15h 3m
Merged PRs (30d)
96

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce
Expected behaviour

The warning should be more verbose to be able to understand, what it is about and what is to do.

Actual behaviour

Every 30 seconds a warning is written to the server log file without further explanation.

Server configuration

Web server: Apache

Database: MySQL

PHP version: 8.3

Nextcloud version: 32

List of activated apps
Enabled:
  - activity: 5.0.0-dev.0
  - admin_audit: 1.22.0
  - app_api: 32.0.0-dev.5
  - bruteforcesettings: 5.0.0-dev.0
  - calendar: 6.0.0-rc.2
  - circles: 32.0.0-dev.0
  - cloud_federation_api: 1.16.0
  - comments: 1.22.0
  - contacts: 8.0.0-rc.1
  - contactsinteraction: 1.13.0
  - dashboard: 7.12.0
  - dav: 1.34.2
  - deck: 1.16.0-beta.1
  - federatedfilesharing: 1.22.0
  - federation: 1.22.0
  - files: 2.4.0
  - files_downloadlimit: 5.0.0-dev.0
  - files_reminders: 1.5.0
  - files_sharing: 1.24.0
  - files_trashbin: 1.22.0
  - files_versions: 1.25.0
  - guests: 4.5.1
  - logreader: 5.0.0-dev.0
  - lookup_server_connector: 1.20.0
  - mail: 5.4.0
  - nextcloud_announcements: 4.0.0-dev.0
  - notes: 4.12.3
  - notifications: 5.0.0-dev.0
  - oauth2: 1.20.0
  - password_policy: 4.0.0-dev.0
  - polls: 8.4.6
  - profile: 1.1.0
  - provisioning_api: 1.22.0
  - recommendations: 5.0.0-dev.0
  - related_resources: 3.0.0-dev.0
  - serverinfo: 4.0.0-dev.0
  - settings: 1.15.0
  - sharebymail: 1.22.0
  - spreed: 22.0.0-rc.1
  - support: 4.0.0-dev.0
  - systemtags: 1.22.0
  - text: 6.0.0-dev.0
  - theming: 2.7.0
  - twofactor_backupcodes: 1.21.0
  - updatenotification: 1.22.0
  - user_status: 1.12.0
  - viewer: 5.0.0-dev.0
  - weather_status: 1.12.0
  - webhook_listeners: 1.3.0
  - workflowengine: 2.14.0
Disabled:
  - calendar_resource_management: 0.10.0 (installed 0.10.0)
  - collectives: 3.1.2 (installed 3.1.2)
  - encryption: 2.20.0 (installed 2.11.0)
  - files_external: 1.24.0 (installed 1.13.0)
  - files_pdfviewer: 5.0.0-dev.0 (installed 2.8.0)
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - firstrunwizard: 5.0.0-dev.0 (installed 2.10.0)
  - forms: 5.2.0-beta.1 (installed 5.2.0-beta.1)
  - impersonate: 3.0.0 (installed 3.0.0)
  - integration_mattermost: 2.1.1 (installed 2.1.1)
  - login_notes: 1.6.1 (installed 1.6.1)
  - photos: 5.0.0-dev.1 (installed 1.7.1)
  - privacy: 4.0.0-dev.0 (installed 1.11.0)
  - survey_client: 4.0.0-dev.0 (installed 1.6.0)
  - suspicious_login: 10.0.0-dev.0 (installed 4.3.0)
  - tables: 1.0.0-beta.3 (installed 1.0.0-beta.3)
  - talk_simple_poll: 1.3.1 (installed 1.3.1)
  - tasks: 0.16.1 (installed 0.16.1)
  - twofactor_nextcloud_notification: 6.0.0-dev.0
  - twofactor_totp: 14.0.0
  - twofactor_webauthn: 2.3.1 (installed 2.3.1)
  - unsplash: 3.1.0 (installed 3.1.0)
  - user_ldap: 1.23.0 (installed 1.13.0)

Nextcloud configuration
{
    "system": {
        "projects.enabled": false,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "dev.yagst.de"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "tempdirectory": "\/tmp\/foo.com\/nextcloud",
        "dbtype": "mysql",
        "version": "32.0.0.9",
        "overwrite.cli.url": "https:\/\/foo.com",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "default_language": "de",
        "default_phone_region": "DE",
        "maintenance": false,
        "theme": "",
        "loglevel": 1,
        "updater.release.channel": "beta",
        "htaccess.RewriteBase": "\/",
        "htaccess.IgnoreFrontController": true,
        "app_install_overwrite": [
            "deck",
            "spreed",
            "impersonate",
            "dashboard",
            "circles",
            "talk_simple_poll",
            "polls",
            "calendar",
            "contacts",
            "unsplash",
            "richdocumentscode",
            "spgverein",
            "collectives",
            "tasks"
        ],
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": true,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_send_plaintext_only": false,
        "ldapIgnoreNamingRules": false,
        "maintenance_window_start": 3,
        "mail_smtpport": "587",
        "defaultapp": "polls,dashboard,files",
        "debug": true
    }
}

Browser

Browser name: Firefox
Browser version: 142
Operating system: Ubuntu

Server log
{
  "reqId": "aMEU41hb9T7EmyRGVsoAAAQBI",
  "level": 2,
  "time": "2025-09-10T06:04:19+00:00",
  "remoteAddr": "pft",
  "user": "me",
  "app": "notifications",
  "method": "GET",
  "url": "/ocs/v2.php/apps/notifications/api/v2/notifications",
  "message": "Controller OCA\\Notifications\\Controller\\EndpointController::listNotifications executed 121 queries.",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:143.0) Gecko/20100101 Firefox/143.0",
  "version": "32.0.0.9",
  "data": {
    "app": "notifications"
  },
  "id": "68c114ee56128"
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report identifies OCA\Notifications\Controller\EndpointController::listNotifications and the GET /ocs/v2.php/apps/notifications/api/v2/notifications endpoint. Start by reproducing that request and inspecting how the 121 queries are measured and logged. Done should include a verified explanation or correction of the excessive-query warning and a clearer server-log message, but the issue does not specify the intended change.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
backend, databases, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.