Log dates are in the future

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 29.0.5): 29.0.6
Operating system and version (eg, Ubuntu 24.04): Debian Bookworm
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.62
PHP version (eg, 8.3): 8.2.23

The issue you are facing: I have multiple log entries that are supposedly from the future. and not the wrong timezone kind of future, but multiple weeks.

The output of your Nextcloud log in Admin > Logging:

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'oc9p1m2w02j2',
  'passwordsalt' => '*',
  'secret' => '*',
  'trusted_domains' =>
  array (
    0 => '192.168.1.118',
    1 => 'pi.hole',
    2 => 'pi.hole/',
  ),
  'datadirectory' => '/var/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '29.0.6.1',
  'overwrite.cli.url' => 'http://192.168.1.118/nextcloud',
  'dbname' => 'nextclouddb',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextclouduser',
  'dbpassword' => '*',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'default_phone_region' => 'DE',
  'default_timezone' => 'Europe/Berlin',
  'session_relaxed_expiry' => true,
  'trashbin_retention_obligation' => 'auto, 30',
  'defaultapp' => 'files',
  'logdateformat' => 'H:i:s, d.j.Y',
  'log_type' => 'file',
  'logfile' => '/var/www/nextcloud/data/nextcloud.log',
  'auth.bruteforce.protection.enabled' => false,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'memories.exiftool' => '/var/www/nextcloud/apps/memories/bin-ext/exiftool-aarch64-glibc',
  'memories.vod.path' => '/var/www/nextcloud/apps/memories/bin-ext/go-vod-aarch64',
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\Image',
    1 => 'OC\\Preview\\HEIC',
    2 => 'OC\\Preview\\TIFF',
    3 => 'OC\\Preview\\Movie',
  ),
  'preview_max_x' => 2048,
  'preview_max_y' => 2048,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
  ),
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'memories.vod.ffmpeg' => '/usr/bin/ffmpeg',
  'memories.vod.ffprobe' => '/usr/bin/ffprobe',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '*',
  'mail_smtpport' => '465',
  'mail_from_address' => '*',
  'mail_domain' => '*',
  'mail_smtpname' => '*',
  'mail_smtppassword' => '*',
  'maintenance_window_start' => 7,
  'memories.db.triggers.fcu' => true,
  'memories.index.path.blacklist' => '\\/(\\.trashed|\\.pending)[^\\/]*$',
);

Edit: I just noticed that the entries in the actual log file have not only a wrong date but an impossible one:

{"reqId":"C0QZYKVUbxNvZnbj9raj","level":2,"time":"22:50:36, 18.18.2024","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Used memory grew by more than 10 MB when executing job OC\\FilesMetadata\\Job\\UpdateSingleMetadata (id: 8362, arguments: [\"MA6zu812CUfgdP56CUsS\",63369]): 22.9 MB (before: 7.5 MB)","userAgent":"--","version":"29.0.3.4","data":{"app":"cron"}}

Nextcloud uses the time information configured on the OS level, so check your system setup using e.g. the timedatectl command.

timedatectl returns:

Local time: Fr 2024-09-06 17:15:46 CEST
Universal time: Fr 2024-09-06 15:15:46 UTC
RTC time: n/a
Time zone: Europe/Berlin (CEST, +0200)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

additionally, I just notice that searching for one of those entries in the log file with grep C0QZYKVUbxNvZnbj9raj /var/www/nextcloud/data/nextcloud.log
the date is not only different from the one shown in the nextcloud interface, but isn’t a real date at all.

{"reqId":"C0QZYKVUbxNvZnbj9raj","level":2,"time":"22:50:36, 18.18.2024","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Used memory grew by more than 10 MB when executing job OC\\FilesMetadata\\Job\\UpdateSingleMetadata (id: 8362, arguments: [\"MA6zu812CUfgdP56CUsS\",63369]): 22.9 MB (before: 7.5 MB)","userAgent":"--","version":"29.0.3.4","data":{"app":"cron"}}

This is why.

d and j are both day of the month. So this likely isn’t what you intended when you set a custom log format. See here: PHP: DateTimeInterface::format - Manual

2 Likes

Thanks, now that you have pointed it out, it seems painfully obvious.
Just out of curiosity, is there a reason nextcloud would assume a date without a month is of the current month, instead of considering it an invalid date and throwing an error?

I think Nextcloud uses PHP functions to interpret the date format and if one of these functions are using some kind of default values to return a valid date, Nextcloud cannot identify it on its own.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.