Some of our jobs are configured to run concurrently - therefore it happens from time to time that the workspace path, which is automatically created - is adjusted by Jenkins and an '@2' is added.
However, this change in the workspace path is not done for the WORKSPACE variable - which is little bit annoying as any build running on '@2' fails
Manually triggering another build helps in most of the cases but is not the best solution esp. in case the build takes more than one hour.
E.g. if the workspace originally points to
c:\Jenkins-slave\workspace
It points sometimes (most probably because of concurrency) to c:\Jenkins-slave\workspace@2
However, the WORKSPACE variable still points to the original value.
Is it reproduced with a recent Jenkins version?