Skip to content

Duplicate log messages in browser after first js refresh #1271

Closed

Description

@jmechnich

Steps to reproduce

  1. Open https://nextcloud.server.example.org/settings/admin/logging
  2. Wait for a few seconds until the log gets refreshed

Expected behaviour

The same log messages as before the refresh should be shown (plus potentially new ones).

Actual behaviour

A few log messages are shown as duplicates. The latest and older log messages are shown properly. Checking the log file directly or using occ log:tail lists the log entries properly.

Screenshot

image

Server configuration

Operating system:
Debian 12 bookworm

Web server:
nginx/1.22.1

Database:
mariadb Ver 15.1 Distrib 10.11.6-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper

PHP version:
PHP 8.2.18 (cli) (built: Apr 11 2024 22:07:45) (NTS)

Nextcloud version:
29.0.2

Where did you install Nextcloud from:

List of activated apps:

Enabled:
  - activity: 2.21.1
  - admin_audit: 1.19.0
  - bookmarks: 14.1.2
  - bruteforcesettings: 2.9.0
  - calendar: 4.7.6
  - circles: 29.0.0-dev
  - cloud_federation_api: 1.12.0
  - collectives: 2.11.0
  - comments: 1.19.0
  - contacts: 6.0.0
  - contactsinteraction: 1.10.0
  - dav: 1.30.1
  - drawio: 3.0.2
  - federatedfilesharing: 1.19.0
  - federation: 1.19.0
  - files: 2.1.0
  - files_downloadlimit: 2.0.0
  - files_external: 1.21.0
  - files_markdown: 2.4.1
  - files_pdfviewer: 2.10.0
  - files_reminders: 1.2.0
  - files_sharing: 1.21.0
  - files_trashbin: 1.19.0
  - files_versions: 1.22.0
  - firstrunwizard: 2.18.0
  - gpxpod: 5.0.18
  - groupfolders: 17.0.0
  - impersonate: 1.16.0
  - logreader: 2.14.0
  - lookup_server_connector: 1.17.0
  - nextcloud_announcements: 1.18.0
  - notes: 4.10.0
  - notifications: 2.17.0
  - oauth2: 1.17.0
  - password_policy: 1.19.0
  - photos: 2.5.0
  - polls: 7.0.3
  - privacy: 1.13.0
  - provisioning_api: 1.19.0
  - recommendations: 2.1.0
  - related_resources: 1.4.0
  - richdocuments: 8.4.2
  - richdocumentscode: 24.4.201
  - serverinfo: 1.19.0
  - settings: 1.12.0
  - sharebymail: 1.19.0
  - spreed: 19.0.1
  - support: 1.12.0
  - survey_client: 1.17.0
  - systemtags: 1.19.0
  - text: 3.10.0
  - theming: 2.4.0
  - twofactor_backupcodes: 1.18.0
  - twofactor_totp: 11.0.0-dev
  - twofactor_webauthn: 1.4.0
  - updatenotification: 1.19.1
  - user_status: 1.9.0
  - viewer: 2.3.0
  - weather_status: 1.9.0
  - workflowengine: 2.11.0
Disabled:
  - dashboard: 7.9.0 (installed 7.0.0)
  - encryption: 2.17.0 (installed 2.5.0)
  - suspicious_login: 7.0.0 (installed 4.3.0)
  - user_ldap: 1.20.0

Nextcloud configuration:

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "29.0.2.2",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 1.5,
            "password": "***REMOVED SENSITIVE VALUE***",
            "dbindex": 0
        },
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "maintenance": false,
        "theme": "",
        "log_type": "file",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "loglevel": 2,
        "logtimezone": "Europe\/Berlin",
        "updater.release.channel": "stable",
        "app_install_overwrite": [
            "calendar",
            "groupfolders",
            "ojsxc",
            "richdocuments",
            "richdocumentscode",
            "gpxpod",
            "video_converter",
            "files_markdown",
            "impersonate",
            "drawio"
        ],
        "debug": false,
        "default_phone_region": "de",
        "mail_sendmailmode": "smtp",
        "maintenance_window_start": 1,
        "trashbin_retention_obligation": "auto, 30",
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\OpenDocument",
            "OC\\Preview\\Krita",
            "OC\\Preview\\TIFF"
        ]
    }
}

Client configuration

Browser:
Firefox 126.0.1

Operating system:
macOS 14.5

Logs

Nextcloud log (data/owncloud.log)

No relevant log entries.

Browser log

No relevant log entries.

Activity

  1. dkadioglu commented on Sep 27, 2024

    @dkadioglu
  2. gaudryc commented on Jun 25, 2025

    @gaudryc

    This issue stems from this commit: 32f93c2
    Subsequent commits do not resolve anything.

    On my Nextcloud 29, 30, and 31 servers, I overwrite the LogIterator class with the one from the latest stable version 28 (with a block size set to 8192).

  3. gaudryc commented on Jun 25, 2025

    @gaudryc

    Using the original LogIterator class (stable29), it is confirmed on a fresh install of Nextcloud 29.0.16.4 running on PHP8.3.21:

    Image

    Image

  4. gaudryc commented on Jun 25, 2025

    @gaudryc

    Using the original LogIterator class (stable31), it is confirmed on a fresh install of Nextcloud 31.0.6 running on PHP8.3.21:

    Image

    Image

  5. gaudryc commented on Jun 25, 2025

    @gaudryc

    It is the same with Nextcloud 30.0.12.

    In fact it depends on the nextcloud.log file size.
    By example, to get the previous sreenshots (with Nextcloud 31), I have deleted one line in the log file.
    When the log file size is 19501 bytes (5 lines), everything is good, the refresh does not refresh anything.
    When the log file size is 17291 bytes (4 lines), the first refresh duplicates old lines but the latest.

  6. muchachagrande commented on Aug 6, 2025

    @muchachagrande
  7. muchachagrande commented on Nov 7, 2025

    @muchachagrande
  8. elliotjm64 commented on Dec 7, 2025

    @elliotjm64
  9. camouflage81 commented on Dec 8, 2025

    @camouflage81
  10. Antreesy commented on Dec 8, 2025

    @Antreesy
    Collaborator

    Potential fix is in #1845

    Mentioned there workaround for PHP should also work, appreciate if someone could give it a try and see, whether that resolves the issue

  11. scharmach commented on Dec 18, 2025

    @scharmach

    @Antreesy Updated to Nextcloud 32.0.3 a couple of days ago. Unfortunately, the issue is still not fixed, at least for me.

    Here's my log directly after opening it:

    Image

    And here it is after only a few seconds, with then duplicated entries:

    Image

  12. Antreesy commented on Dec 18, 2025

    @Antreesy
    Collaborator

    Thanks for reporting @scharmach

    Would you mind to show, what's happening on Network tab for you?

    Image
  13. scharmach commented on Dec 19, 2025

    @scharmach

    Sure, @Antreesy. This is when I first opened the logs:

    Image

    And this is after the entries got duplicated, which happened instantly when the poll?=lastReqId-request popped up:

    Image

  14. Antreesy commented on Dec 19, 2025

    @Antreesy
    Collaborator

    If I understood it correctly, and you have required access to your instance, you can try to modify apps/logreader/LogController.php directly to comment or remove this line:

    diff --git a/lib/Controller/LogController.php b/lib/Controller/LogController.php
    --- a/lib/Controller/LogController.php	(revision d65622ed69123dfd339f1e36d45ff3c7a1113861)
    +++ b/lib/Controller/LogController.php	(date 1766160918194)
    @@ -69,7 +69,6 @@
     	 */
     	private function getLastItem() {
     		$iterator = $this->logIteratorFactory->getLogIterator($this->settingsService->getShownLevels());
    -		$iterator->next();
     		return $iterator->current();
     	}

    From the test, it looks like function returns the second last item and not the last one

  15. scharmach commented on Dec 20, 2025

    @scharmach

    @Antreesy Indeed, this must be where this issue is located. Commented the line out, and the entries are not duplicating any more.

    Here's also a screenshot, the function returns the last item now:

    Image

  16. gaudryc commented on Jan 7, 2026

    @gaudryc

    Hello,
    I can confirm that applying the patch #1859 to LogReader for Nextcloud versions 31.0.12 and 32.0.3 successfully fixes this duplication issue. Without this specific patch, the problem persists.
    Regards,
    Chris

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions