There is a time and/or date difference between the client and server

Jenkinswindows-server-2008-r2

I am running a Build Job using Jenkins. The Jenkins job executes a command shown below that simply copies a test file from server A to server B. Jenkins resides on Server A and well as the command file. The Servers are running Windows Server 2008 R2.

copy C:\Users\myuser\test.txt" "\\ServerB\myfolder\test.txt"

The command fails with the error message:

There is a time and/or date difference between the client and
server.

Jenkins uses the Windows account myuser. If you log onto ServerA as myuser and run the command, it works just fine.

The System Admin ran the command w32tm /resync on both servers. No effect.

If I change the command to copy to Server C instead, it works fine from Jenkins.

Tried rebooting Server B, no luck.

The times and timezones on the servers all look the same down to the second.

Any ideas on how to fix this this?

Best Answer

1 command:

net time /set

...on both the workstation and server. This will ensure that both have the proper time/date set (make sure time zones are set properly. Just because it says 4PM in the tray... does not mean 4PM in YOUR timezone.)