Skip to content

OpenJDK Server VM warning: No monotonic clock was available - timed services may be adversely affected if the time-of-day clock changes #469

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

Closed
juliusjava opened this issue Nov 18, 2020 · 7 comments
Labels
Milestone

Comments

@juliusjava
Copy link

juliusjava commented Nov 18, 2020

When I run a docker image built from adoptopenjdk:15-jdk-hostspot on my raspberry pi 3B (arm32v7 architecture) and start any java application inside a container, I get the following warning:
OpenJDK Server VM warning: No monotonic clock was available - timed services may be adversely affected if the time-of-day clock changes

At least theses versions are also affected:
14-jdk-hostspot
11-jdk-hostspot

When I execute date inside a container multiple times, it prints the following random dates:
Thu 19 Feb 1970 02:46:19 PM UTC
Thu 19 Feb 1970 11:54:27 PM UTC
Tue 24 Feb 1970 03:22:35 PM UTC
Tue 03 Mar 1970 03:15:07 PM UTC

When I execute "date" directly in my raspberry pi OS, it prints the following correct dates:
Wed 18 Nov 21:17:42 EET 2020
Wed 18 Nov 21:17:43 EET 2020
Wed 18 Nov 21:17:44 EET 2020
Wed 18 Nov 21:17:51 EET 2020

Moreover, my springboot applications inside a container also starts only randomly. Most of the time it simply does not start, only mentioned warning is printed in logs. But the same application starts and operates correctly when I run it directly from raspberry pi OS.

One more thing: when I run for example tomcat:7-jdk8-adoptopenjdk-hotspot image and execute date command, it prints date correctly. Same applies to alpine image. So it shows, that this is not a hardware or raspberry pi OS issue.

@juliusjava juliusjava changed the title OpenJDK Server VM warning: No monotonic clock was available - timed services may be adversly affected if the time-of-day clock changes OpenJDK Server VM warning: No monotonic clock was available - timed services may be adversely affected if the time-of-day clock changes Nov 18, 2020
@karianna karianna added the bug label Nov 18, 2020
@dinogun
Copy link
Collaborator

dinogun commented Nov 19, 2020

Can you please check if you see the same behaviour with a ubuntu:20.04 image ?

@aahlenst
Copy link
Contributor

$ docker run --rm adoptopenjdk:15.0.1_9-jdk-hotspot-focal
Unable to find image 'adoptopenjdk:15.0.1_9-jdk-hotspot-focal' locally
15.0.1_9-jdk-hotspot-focal: Pulling from library/adoptopenjdk
Digest: sha256:c57a720a6d04d224efb95f23f1a58cb8c3a74498c11f8f6ae6de97955188b0c0
Status: Downloaded newer image for adoptopenjdk:15.0.1_9-jdk-hotspot-focal
OpenJDK Server VM warning: No monotonic clock was available - timed services may be adversely affected if the time-of-day clock changes
Exception in thread "main" java.lang.ExceptionInInitializerError
	at java.prefs/java.util.prefs.FileSystemPreferencesFactory.userRoot(FileSystemPreferencesFactory.java:41)
	at java.prefs/java.util.prefs.Preferences.userRoot(Preferences.java:457)
	at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.rawTool(JShellToolBuilder.java:218)
	at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.start(JShellToolBuilder.java:254)
	at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:120)
Caused by: java.lang.IllegalArgumentException: Illegal execution time.
	at java.base/java.util.Timer.sched(Timer.java:389)
	at java.base/java.util.Timer.schedule(Timer.java:249)
	at java.prefs/java.util.prefs.FileSystemPreferences.<clinit>(FileSystemPreferences.java:448)
	... 5 more

and

$ docker run --rm adoptopenjdk:11.0.9_11-jdk-hotspot-focal
Unable to find image 'adoptopenjdk:11.0.9_11-jdk-hotspot-focal' locally
11.0.9_11-jdk-hotspot-focal: Pulling from library/adoptopenjdk
Digest: sha256:22fda5482af1e2364248517a9d22991cecd640965938828534e5233b8d9b13eb
Status: Downloaded newer image for adoptopenjdk:11.0.9_11-jdk-hotspot-focal
OpenJDK Server VM warning: No monotonic clock was available - timed services may be adversely affected if the time-of-day clock changes

@dinogun
Copy link
Collaborator

dinogun commented Nov 19, 2020

I meant to run date on a bare ubuntu:20.04 image to see if it prints random dates. I am suspecting this to be a Ubuntu issue as all the above reported images have that in common.

@aahlenst
Copy link
Contributor

root@e8b53a14fb72:/# date
Fri Feb 27 15:03:23 UTC 1970
root@e8b53a14fb72:/# date
Mon Mar  2 18:08:59 UTC 1970
root@e8b53a14fb72:/# date
Mon Mar  2 22:42:03 UTC 1970
root@e8b53a14fb72:/# date
Thu Feb 19 10:13:15 UTC 1970
root@e8b53a14fb72:/# date
Sun Feb 22 03:04:27 UTC 1970
root@e8b53a14fb72:/# date
Tue Feb 24 06:16:27 UTC 1970
root@e8b53a14fb72:/# date
Sun Mar  1 11:25:47 UTC 1970
root@e8b53a14fb72:/# cat /etc/os-release 
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
root@e8b53a14fb72:/# uname -a
Linux e8b53a14fb72 5.4.72-v7l+ #1356 SMP Thu Oct 22 13:57:51 BST 2020 armv7l armv7l armv7l GNU/Linux

@dinogun
Copy link
Collaborator

dinogun commented Nov 19, 2020

@aahlenst thanks ! ... That confirms that it is a Ubuntu 20.04 issue.
@juliusjava I think this needs to be reported at the official ubuntu github.

@juliusjava
Copy link
Author

Sorry, that I couldn't reply faster.
Thank you all for troubleshooting this issue so fast.
I will try to dig into this with ubuntu guys to this issue tianon/docker-brew-ubuntu-core#196, which I just have created with specific reproduction info.

@juliusjava
Copy link
Author

Guy from ubuntu image project helped me and I was able to solve this issue by updating libseccomp librarry on my raspberry (docker host) from ~2.3.2 to 2.5.0.
See more details here tianon/docker-brew-ubuntu-core#196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants