Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clock skew detected: you build may be incomplete

Tags:

makefile

nfs

I've seen a bunch of these questions, most notable this one, which all say pretty much the same thing: This error is caused by the modification time of the source files being in the future, which usually occurs on a mounted NFS when the server clock and client clock are not in sync.

I've tried to touch all the files in my directory, as many have suggested. when that didn't work, I actually attempted copying all files out of the mounted drive and into a local drive, touching them again, then rerunning the build, and I still get the same error. Is there any other way to solve this problem?

like image 562
ewok Avatar asked Dec 01 '25 14:12

ewok


1 Answers

The NFS server and NFS client's system times are out of sync. The NFS server is probably drifting ahead.

Running make on an NFS mount is sensitive to the millisecond level so client/server system times must be tight as a drum. This can be done by having your NFS client(s) sync their time off of the NFS server's time using NTP at the highest rate allowed (usually 8 seconds). On a LAN this should get you sub-millisecond accuracy.

  • Install NTP on both the NFS client(s) and the NFS server.
  • On the NTP config file of the clients (ntp.conf in linux), comment out the entries starting with 'pool' or 'server' and add the line:

server [put address of the nfs server here] minpoll 3 maxpoll 3

... The '3' is a power-of-two in seconds for the polling interval, hence 8 seconds. The NFS server's NTP config file can probably be left alone.

  • Restart the ntpd service on your client.
  • Test that your client is syncing by using the linux command within the client:

ntpq -p

... the important part is that your 'reach' column is not zero for long as that means it cannot contact the server's NTP.

  • If they don't sync, you may have to reboot the client and server. This may be the case with Synology NAS as the NTP server.

  • Perform a full clean of your build (even nuke the directory and re-clone if convenient) and try again.

Similar answers are throughout the internet, but they suggest simply installing NTP to the machines. This wasn't good enough to solve the issue for me - they weren't synced tightly enough. A better way is to sync the clients' clocks to the server's clock on the local network at very frequent intervals. This is frowned upon with the internet but cheap on a LAN.

If this isn't possible, at least try to ensure NTP on the clients and server uses the same time servers in its pool/server entries.

like image 191
user515655 Avatar answered Dec 04 '25 13:12

user515655