Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestamp of contact change not correct #20641

Closed
BeFrankly opened this issue Apr 24, 2020 · 15 comments
Closed

Timestamp of contact change not correct #20641

BeFrankly opened this issue Apr 24, 2020 · 15 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: dav needs info stale Ticket or PR with no recent activity

Comments

@BeFrankly
Copy link

BeFrankly commented Apr 24, 2020

Hallo,

I’m testing nextcloud running on my Rock Pi mini computer and observe a strange behavior in the NC Webpage, when I created a new contact in Thunderbird with Cardbook Add-On.

After syncing the new contact, on the NC website it is declared as 2 hours in future. In the lower right corner it is displayed (translated from german) “last changed in 2 hours”.

Same when I change the contact in Thunderbird Cardbook. Timestamp on server is in future.
When I tested it some days ago, I did a timedatectl on Server and Client PC (both Ubuntu)

timedatectl on Server:
Local time: Mo 2020-04-20 19:22:51 UTC
Universal time: Mo 2020-04-20 19:22:51 UTC
RTC time: Mo 2020-04-20 19:22:51
Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
systemd-timesyncd.service active: yes
RTC in local TZ: no

timedatectl on Thunderbird Client (some seconds later exectuted):
Local time: Mo 2020-04-20 21:25:04 CEST
Universal time: Mo 2020-04-20 19:25:04 UTC
RTC time: Mo 2020-04-20 19:25:04
Time zone: Europe/Berlin (CEST, +0200)
System clock synchronized: yes
systemd-timesyncd.service active: yes
RTC in local TZ: no

So syncing the contacts is absolutely impossible after that in a range of 2 hours. How to fix this behaviour? I guess it's a bug. Contact version is 3.3.0


Operating system: Linux 4.4.154-59-rockchip-g5e70f14 #4 SMP Fri Dec 14 20:55:41 CST 2018 aarch64

Webserver: Apache/2.4.29 (Ubuntu) (apache2handler)

Database: mysql 10.1.44

PHP version: 7.2.24-0ubuntu0.18.04.4

Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, sodium, session, standard, apache2handler, mysqlnd, PDO, xml, apcu, apc, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, imagick, intl, json, exif, mysqli, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, Zend OPcache

Nextcloud version: 18.0.4 - 18.0.4.2

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Regards

Frank

@BeFrankly BeFrankly added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Apr 24, 2020
@kesselb
Copy link
Contributor

kesselb commented Apr 24, 2020

So syncing the contacts is absolutely impossible after that in a range of 2 hours.

Mind to elaborate? I don't see the issue yet. Afaik on a contact update the etag changes hence the timestamp is not relevant for the sync.

Is syncing of those contacts broken or just the last modified time wrong?

@BeFrankly
Copy link
Author

Dear kesselb,
thanks for your reply and the hint, that syncronising ist done using the etag and not timestamp. So I did a new test and have to say, that sync is not affected. It was just a misoberservation while playing with the First Name (Adding a letter in Cardbook, doing syncronisation, deleting the letter in nextcloud web interface, doing sync in cardbook again) This observation comes from the fact that i have not looked on the "firstname". I have looked on the displayname which is not updated, when firstname gets edited.

So the bug is not so relevant at a first glance. But the wrong timestamp is not good for transparency reason. It leads the user to a data-dschungle, where he can not be sure, which datas are the newest. So a bugfix would be great.

Regards
Frank

@kesselb
Copy link
Contributor

kesselb commented Apr 25, 2020

cc @nextcloud/contacts contacts or server? I guess to reproduce server and client must use a different time zone.

@j-ed
Copy link
Contributor

j-ed commented Apr 25, 2020

timedatectl on Server:
Local time: Mo 2020-04-20 19:22:51 UTC
Universal time: Mo 2020-04-20 19:22:51 UTC
Time zone: Etc/UTC (UTC, +0000)

timedatectl on Thunderbird Client (some seconds later exectuted):
Local time: Mo 2020-04-20 21:25:04 CEST
Universal time: Mo 2020-04-20 19:25:04 UTC
Time zone: Europe/Berlin (CEST, +0200)

A two hour time difference in Europe/Germany is usually caused by an incorrectly configured system clock. As you can see the local and the UTC time are identical on the server, compared to the client. You need to set the system clock to UTC but the local time need to be set to the correct time by choosing the right time zone. That's how the Linux clock usually works.

@BeFrankly
Copy link
Author

Dear j-ed,

thanks for your answer. I think that you are not right with your conclusion, that a two hour time difference is caused by an incorrectly configured system clock. See, here in Germany during the summer we have a central european summer time (CEST) what is nearly the same than daylight saving time. This CEST is UTC+2, whereas in winter we are in UTC+1.
So I still have the opinion, that my systems are configured right. It's always a good idea to let servers run in UTC and the clients at there local time. So the timestamp, or the display of the time-diffence, should take into account the UTC. Imagine, two people are working on the same adresses, one in europe and one in america (or china, russia, moon) . When the person in america changed one adress and syncs it, the person in europe (after syncing) should see a change time of now.

Regards

Frank

@j-ed
Copy link
Contributor

j-ed commented Apr 25, 2020

I think that you are not right with your conclusion, that a two hour time difference is caused by an incorrectly configured system clock. See, here in Germany during the summer we have a central european summer time (CEST) what is nearly the same than daylight saving time. This CEST is UTC+2, whereas in winter we are in UTC+1.

Ok, you know the basics, but on your server the system and local time are both set to UTC and the timezone is set to Etc/UTC too. To get rid of the two hour difference you should set the timezone to "Berlin/Germany" so that the local time is two hours ahead of UTC, otherwise you will see the described time difference of two hours. What is wrong with this?

@BeFrankly
Copy link
Author

Dear j-ed,
so I did a "sudo timedatectl set-timezone Europe/Berlin". Here is the output of timedatectl after that
Local time: Sa 2020-04-25 22:21:01 CEST
Universal time: Sa 2020-04-25 20:21:01 UTC
RTC time: Sa 2020-04-25 20:21:02
Time zone: Europe/Berlin (CEST, +0200)
System clock synchronized: yes
systemd-timesyncd.service active: yes
RTC in local TZ: no

I do not know, why the former call did not display the RTC time.
I restarted the server then! I again created a new contact in cardbook and synced.
Still the nextcloud webpage said that the new contact is "in 2 hours". So I restarted Firefox as well and re-opened the NC webpage and did a new try. Still the same behavior.

Regards
Frank

@j-ed
Copy link
Contributor

j-ed commented Apr 26, 2020

I restarted the server then!

  • What does that mean in detail?
  • Have you rebooted your server or just restarted the web server?
  • Which PHP implementation do you use, php-fpm, etc.?
  • Have you tried to edit the record using the Nextcloud GUI and downloaded the vcf file instantly without syncing it?
  • How does the downloaded vcf file look like in detail?

@BeFrankly
Copy link
Author

Thanks j-ed for your support.
Coming to your questions. I had rebooted the hole system, not even the webserver (sudo shutdown -r now)
Further details you will see in the added files. PHPINFO (private data obfuscated) and two vcf files generated a few minutes ago this morning around 11:43 and 11:49 german local time.
You have to remove the txt file ending.
It's an addressbook entry "Konrad Zuse", the inventer of the computer. I added the card with cardbook. Then I edited it in the NC webgui and added a "o" to the first name.

Hope this helps.

Regards

Frank

8a58d236-6d02-4554-94e7-5b013ad39d1c after edit in webgui.vcf.txt
phpinfo().html.txt
8a58d236-6d02-4554-94e7-5b013ad39d1c-before edit in webgui.vcf.txt

@j-ed
Copy link
Contributor

j-ed commented Apr 26, 2020

The timezone settings seem to be ok for me. To be honest, I don't have an idea why the timestamp is still written in UTC. The only thing I found is, that once you've edited a contact using the Nextcloud gui, the Revision-Tag is incorrectly written in this format:

REV;VALUE=DATE-AND-OR-TIME:20191125T222506Z

This problem has already been addressed here and will most likely been fixed soon. Unfortunately I don't know if this will also fix the time stamp issue in the record I just realized that the time stamp is written as UTC time, which is indicated by the trailing "Z", so it seems to be correct for me. Let's wait until the open issue has been fixed. Most likely your issue will be fixed too: nextcloud/contacts#1352

@BeFrankly
Copy link
Author

Dear j-ed,
thanks for being so frank, that you also have no idea, why it's written in UTC. So haven't I. So here we start right from the beginning.

I have not the time and resource to debug and develop. I hope, someone else will have it. I know from many other software projects, that time related things always work right, when you stay in one timezone. But when different timezones come into play, it doesn't work. My hope was, that it's not the case with nextcloud, because it's founded in Germany, and you always have to set language, keyboard layout and timezone in Germany before you can start.

Because of the other thread you have linked here i thing, it's not the time to use address synchronization with cardbook in thunderbird, nextcloud and DAVx5 on Android. Seems to be to buggy at the moment.

Regards

Frank

@skjnldsv
Copy link
Member

I just realized that the time stamp is written as UTC time, which is indicated by the trailing "Z", so it seems to be correct for me. Let's wait until the open issue has been fixed. Most likely your issue will be fixed too: nextcloud/contacts#1352

Yes, it's valid :)
The only part that was not valid was the VALUE=DATE-AND-OR-TIME, but it should not matter.

@ghost
Copy link

ghost commented May 27, 2020

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

@ghost ghost added the stale Ticket or PR with no recent activity label May 27, 2020
@ghost ghost closed this as completed Jun 10, 2020
@webberian
Copy link

@BeFrankly , could the mismatch in the web interface perhaps be caused by #19006?

@BeFrankly
Copy link
Author

Dear @webberian,
its long ago since I wrote this down, but as far as I remember I had not done some special setting in firefox. I was not in private mode and have never set the privacy.resistFingerprinting config switch to true by myself.

For me this behavior is not relevant ever more, because as described today in the documentation, I use TBSync with Provider for CalDAV and CardDAV and Category Manager now. It seems to work but has also some funny behavior with timestamp as well. In Web Interface all contact show "changed seconds ago" in the right bottom of the page, even if they where not changed in thunderbird or elsewhere month ago. I am not interested in filing this as a bug. Syncing works somehow and that's ok for me.

Regards

Frank

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: dav needs info stale Ticket or PR with no recent activity
Projects
None yet
Development

No branches or pull requests

5 participants