owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.38k stars 2.06k forks source link

new files created in windows shares have timestamps in the future #32426

Closed IngoEF closed 5 years ago

IngoEF commented 6 years ago

Steps to reproduce

  1. create file in windows share from owncloud web gui or windows explorer
  2. file timestamp shown in owncloud is "in 2 hours"
  3. file timestamps shown in windows are correct

Expected behaviour

show correct file timestamps in owncloud

Actual behaviour

owncloud shows and works with wrong file timestamps

Server configuration

Operating system: CentOS 7.3.1611

Web server: Apache 2.4.6

Database: MariaDB 5.5.52

PHP version: 7.0.27 ownCloud version: 10.0.9.5

Updated from an older ownCloud or fresh install: updated from 9.x

Where did you install ownCloud from: yum repository

Login as admin user into your ownCloud and access http://example.com/index.php/settings/integrity/failed

No errors have been found.

The content of config/config.php:

$CONFIG = array ( 'updatechecker' => false, 'instanceid' => 'oct50jc0rkfb', 'passwordsalt' => 'xxx', 'secret' => ''xxx, 'trusteddomains' => array ( 0 => 'xxx.yyy.com', 1 => 'aaa.bbb.ccc.ddd', ), 'datadirectory' => '/data/owncloud/data', 'tempdirectory' => '/data/owncloud/uploadtemp', 'memcache.local' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array ( 'host' => '/var/opt/rh/rh-redis32/tmp/redis.sock', 'port' => 0, ), 'overwrite.cli.url' => 'https://cloud.xxx.com', 'dbtype' => 'mysql', 'version' => '10.0.9.5', 'dbname' => 'owncloud', 'dbhost' => 'localhost', 'dbtableprefix' => 'oc', 'dbuser' => 'ocdbuser', 'dbpassword' => 'xxx', 'logtimezone' => 'Europe/Berlin', 'log_rotate_size' => '52428800', 'installed' => true, 'mail_smtpmode' => 'smtp', 'mail_smtpsecure' => 'tls', 'mail_from_address' => 'cloud', 'mail_domain' => 'xxx.com', 'mail_smtpauthtype' => 'LOGIN', 'mail_smtpauth' => 1, 'mail_smtphost' => 'xxx.yyy.de', 'mail_smtpport' => '25', 'mail_smtpname' => 'name', 'mail_smtppassword' => 'xxx', 'theme' => 'mo', 'loglevel' => 2, 'maintenance' => false, 'htaccess.RewriteBase' => '/', 'integrity.check.disabled' => false, 'ldapIgnoreNamingRules' => false, 'ldapUserCleanupInterval' => 30, 'trashbin_retention_obligation' => 'auto, 0', );

List of activated apps:

Enabled:

Are you using external storage, if yes which one: local/smb

Are you using encryption: no

Are you using an external user-backend, if yes which one: ActiveDirectory

LDAP configuration (delete this part if not used)

+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Configuration +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ hasMemberOfFilterSupport 1 hasPagedResultSupport homeFolderNamingRule lastJpegPhotoLookup 0 ldapAgentName REMOVED SENSITIVE VALUE ldapAgentPassword *** ldapAttributesForGroupSearch ldapAttributesForUserSearch ldapBackupHost ldapBackupPort ldapBase REMOVED SENSITIVE VALUE ldapBaseGroups REMOVED SENSITIVE VALUE ldapBaseUsers REMOVED SENSITIVE VALUE ldapCacheTTL 30 ldapConfigurationActive 1 ldapDynamicGroupMemberURL ldapEmailAttribute mail ldapExperiencedAdmin 0 ldapExpertUUIDGroupAttr ldapExpertUUIDUserAttr ldapExpertUsernameAttr samAccountname ldapGroupDisplayName cn ldapGroupFilter REMOVED SENSITIVE VALUE ldapGroupFilterGroups REMOVED SENSITIVE VALUE
ldapGroupFilterMode 0
ldapGroupFilterObjectclass group
ldapGroupMemberAssocAttr member
ldapHost REMOVED SENSITIVE VALUE
ldapIgnoreNamingRules
ldapLoginFilter REMOVED SENSITIVE VALUE
ldapLoginFilterAttributes
ldapLoginFilterEmail 0
ldapLoginFilterMode 1
ldapLoginFilterUsername 1
ldapNestedGroups 0
ldapOverrideMainServer
ldapPagingSize 500
ldapPort 389
ldapQuotaAttribute
ldapQuotaDefault
ldapTLS 0
ldapUserDisplayName displayname
ldapUserDisplayName2
ldapUserFilter REMOVED SENSITIVE VALUE
ldapUserFilterGroups REMOVED SENSITIVE VALUE
ldapUserFilterMode 0
ldapUserFilterObjectclass person
ldapUuidGroupAttribute auto
ldapUuidUserAttribute auto
turnOffCertCheck 0
useMemberOfToDetectMembership 1

+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Client configuration

Browser: Firefox 61.02 64 bit

Operating system: Windows Server 2012 R2

Logs

Web server error log

no concerning errors

ownCloud log (data/owncloud.log)

no concerning errors

Browser log

a) The javascript console log b) The network log c) ...

nothing applicable

I've checked the owncloud file timestamps in the database using the sql-statement: MariaDB [owncloud]> select * from oc_filecache where path like '%Ingotest%'; with this result: +---------+---------+--------------------------------------------------------------+----------------------------------+---------+--------------------------+----------+----------+------+------------+---------------+-----------+------------------+----------------------------------+-------------+-----------------------------------------------------------------------------------------------------+ | fileid | storage | path | path_hash | parent | name | mimetype | mimepart | size | mtime | storage_mtime | encrypted | unencrypted_size | etag | permissions | checksum | +---------+---------+--------------------------------------------------------------+----------------------------------+---------+--------------------------+----------+----------+------+------------+---------------+-----------+------------------+----------------------------------+-------------+-----------------------------------------------------------------------------------------------------+ | 1546009 | 358 | temp/Ingotest.txt | 2ea96397f31384c14d79e86f752ddf45 | 1545942 | Ingotest.txt | 19 | 18 | 3 | 1534367184 | 1534367184 | 0 | 0 | 5b7479b020506 | 27 | | | 1546013 | 157 | files_versions/SANITIZED/temp/Ingotest.txt.v1534367176 | 61267bded5f8db76a94240581cde1b1f | 1546012 | Ingotest.txt.v1534367176 | 9 | 3 | 0 | 1534359983 | 1534359983 | 0 | 0 | 1d288626e05555562175484bacd32131 | 27 |
+---------+---------+--------------------------------------------------------------+----------------------------------+---------+--------------------------+----------+----------+------+------------+---------------+-----------+------------------+----------------------------------+-------------+-----------------------------------------------------------------------------------------------------+ 2 rows in set (2.30 sec)

mtime = storage_mtime: Sekunden seit 1970: 1534367184 umgerechnet in Zeitangabe: 23:06:24, 15.08.2018

file timestamp in windows: PS P:> get-item P:\temp\Ingotest.txt

Verzeichnis: P:\temp

Mode LastWriteTime Length Name


-a---- 15.08.2018 21:06 3 Ingotest.txt

The file timestamp shown in windows is correct.

There is a difference of 2 hours which only exists in the owncloud database and must be an error.

The difference impacts sync activities in the owncloud client, because users often work with unsynced file versions.

All time zone configuration options (Linux OS, PHP, and Windows) are set to "Europe/Berlin"

DeepDiver1975 commented 6 years ago

All time zone configuration options (Linux OS, PHP, and Windows) are set to "Europe/Berlin"

the owncloud server shall be operated using UTC ... please double check ...

ownclouders commented 6 years ago

GitMate.io thinks the contributor most likely able to help you is @PVince81.

Possibly related issues are https://github.com/owncloud/core/issues/3465 (Sharing files), https://github.com/owncloud/core/issues/3949 (File sharing), https://github.com/owncloud/core/issues/18283 (cant share already shared Files or Folders for new created users), https://github.com/owncloud/core/issues/5417 (Ghosted shared file), and https://github.com/owncloud/core/issues/10810 (create folders through share).

IngoEF commented 6 years ago

@DeepDriver1975 Thanks for the hint. But: what do you mean with "the owncloud- server"? is it OS-, PHP-, DB- or which configuration you are referring to? Where do I find timezone setup instructions in a manual?

IngoEF commented 6 years ago

ownclouders comment has nothing to do with the point. It is more than needless, time wasting and should be switched off.

IngoEF commented 6 years ago

Tried several setups now. The only configuration which seems to influence the owncloud file timestamps is setting the Linux-OS timezone to UTC. This -to me- is a bug, because it forces the whole system to show wrong timestamps.

PVince81 commented 6 years ago

@IngoEF you could set the timezone only for the Apache process. Basically PHP needs to run in UTC timezone.