nextcloud / nextcloud/server

[Bug]: Prevent/hide "dirty table reads" messages during updates by default

Open
#51,503 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 30-feedback bug feature: database feature: install and update feature: logging
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

When doing an update (e.g. here from 30.0.6 to 30.0.7) the messages about dirty table reads below are showing up in the nextcloud.log.

As discussed here these are no errors:

and are only shown if the Loglevel is set to 0.

The problems here are:

  1. the updater is setting the Loglevel to 0 / this value automatically during an update (see next log)
  2. this is causing a flood of the logs (grep "dirty table reads" nextcloud.log | wc -l showed 40 entries just happening during an update), especially as these messages seems to be quite big / long
  3. this prevents the focus on the actual important info happening during an update
  4. users might get confused by such messages including e.g. dirty during updates
{
  "reqId": "***",
  "level": 1,
  "time": "***",
  "remoteAddr": "",
  "user": "--",
  "app": "updater",
  "method": "",
  "url": "--",
  "message": "\\OC\\Updater::resetLogLevel: Reset log level to Warning(2)",
  "userAgent": "--",
  "version": "30.0.7.2",
  "data": {
    "app": "updater"
  }
}
Steps to reproduce
  1. Have 30.0.6 installed
  2. Update to 30.0.7 manually (sudo -u www-data php occ upgrade)
  3. Check data/nextcloud.log
Expected behavior

No dirty table reads messages in the log file during an update (updater could "hide" these kind of messages during an update by default) so that one can focus on the relevant info on the update (e.g. done repair steps etc.).

Nextcloud Server version

30

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Nginx

Database engine version

MariaDB

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

Updated from a MINOR version (ex. 32.0.1 to 32.0.2)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report

Only relevant entry from config.php:

'loglevel' => 2,
List of activated Apps

Nextcloud Signing status

Nextcloud Logs
{
  "reqId": "***",
  "level": 0,
  "time": "***",
  "remoteAddr": "",
  "user": "--",
  "app": "no app in context",
  "method": "",
  "url": "--",
  "message": "dirty table reads: SELECT `id` FROM `*PREFIX*jobs` WHERE (`class` = :dcValue1) AND (`argument_hash` = :dcValue2) LIMIT 1",
  "userAgent": "--",
  "version": "30.0.6.2",
  "exception": {
    "Exception": "Exception",
    "Message": "dirty table reads: SELECT `id` FROM `*PREFIX*jobs` WHERE (`class` = :dcValue1) AND (`argument_hash` = :dcValue2) LIMIT 1",
    "Code": 0,
    "Trace": [
      {
        "file": "/***/lib/private/DB/ConnectionAdapter.php",
        "line": 50,
        "function": "executeQuery",
        "class": "OC\\DB\\Connection",
        "type": "->"
      },
      {
        "file": "/***/lib/private/DB/QueryBuilder/QueryBuilder.php",
        "line": 289,
        "function": "executeQuery",
        "class": "OC\\DB\\ConnectionAdapter",
        "type": "->"
      },
      {
        "file": "/***/lib/private/BackgroundJob/JobList.php",
        "line": 127,
        "function": "executeQuery",
        "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
        "type": "->"
      },
      {
        "file": "/***/lib/private/BackgroundJob/JobList.php",
        "line": 47,
        "function": "has",
        "class": "OC\\BackgroundJob\\JobList",
        "type": "->"
      },
      {
        "file": "/***/lib/private/Setup.php",
        "line": 415,
        "function": "add",
        "class": "OC\\BackgroundJob\\JobList",
        "type": "->"
      },
      {
        "file": "/***/lib/private/Updater.php",
        "line": 227,
        "function": "installBackgroundJobs",
        "class": "OC\\Setup",
        "type": "::"
      },
      {
        "file": "/***/lib/private/Updater.php",
        "line": 98,
        "function": "doUpgrade",
        "class": "OC\\Updater",
        "type": "->"
      },
      {
        "file": "/***/core/Command/Upgrade.php",
        "line": 190,
        "function": "upgrade",
        "class": "OC\\Updater",
        "type": "->"
      },
      {
        "file": "/***/3rdparty/symfony/console/Command/Command.php",
        "line": 326,
        "function": "execute",
        "class": "OC\\Core\\Command\\Upgrade",
        "type": "->"
      },
      {
        "file": "/***/3rdparty/symfony/console/Application.php",
        "line": 1078,
        "function": "run",
        "class": "Symfony\\Component\\Console\\Command\\Command",
        "type": "->"
      },
      {
        "file": "/***/3rdparty/symfony/console/Application.php",
        "line": 324,
        "function": "doRunCommand",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/***/3rdparty/symfony/console/Application.php",
        "line": 175,
        "function": "doRun",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/***/lib/private/Console/Application.php",
        "line": 183,
        "function": "run",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/***/console.php",
        "line": 87,
        "function": "run",
        "class": "OC\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/***/occ",
        "line": 33,
        "args": [
          "/***/console.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/***/lib/private/DB/Connection.php",
    "Line": 402,
    "message": "dirty table reads: SELECT `id` FROM `*PREFIX*jobs` WHERE (`class` = :dcValue1) AND (`argument_hash` = :dcValue2) LIMIT 1",
    "tables": [
      "oc_jobs"
    ],
    "reads": [
      "oc_jobs"
    ],
    "exception": {},
    "CustomMessage": "dirty table reads: SELECT `id` FROM `*PREFIX*jobs` WHERE (`class` = :dcValue1) AND (`argument_hash` = :dcValue2) LIMIT 1"
  }
}
Additional info

No response

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

Start by tracing the update path in lib/private/Updater.php and core/Command/Upgrade.php, then inspect the dirty-read handling in lib/private/DB/Connection.php and lib/private/DB/ConnectionAdapter.php. Reproduce with sudo -u www-data php occ upgrade and verify that dirty table reads are hidden during the update while relevant update messages remain visible.

Written by the indexing model from the issue text.

Assessment

Tech stack
mariadb, php
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.