logreader icon indicating copy to clipboard operation
logreader copied to clipboard

Duplicate log messages in browser after first js refresh

Open jmechnich opened this issue 1 year ago • 7 comments

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.

jmechnich avatar Jun 06 '24 16:06 jmechnich

I have the same issue, at least since Nextcloud Server 30.0.

dkadioglu avatar Sep 27 '24 04:09 dkadioglu

This issue stems from this commit: https://github.com/nextcloud/logreader/commit/32f93c28276564df9defa67469685092cb87f87f 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).

gaudryc avatar Jun 25 '25 11:06 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

gaudryc avatar Jun 25 '25 15:06 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

gaudryc avatar Jun 25 '25 15:06 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.

gaudryc avatar Jun 25 '25 15:06 gaudryc

I have this issue on Nextcloud 31.0.7 under Ubuntu Server 22.04 with PHP 8.3 and Apache installed with Hansson IT VM and updated regularly.

muchachagrande avatar Aug 06 '25 14:08 muchachagrande

Upgraded to 32.0.1 and the issue is still present.

muchachagrande avatar Nov 07 '25 15:11 muchachagrande