I get an error in Jenkins about "${BUILD_DATETIMEVERSION_PATH}' is invalid", how do I fix it?

  • Page Owner: Not Set
  • Last Reviewed: 2019-02-22

My build in Jenkins is failing with this error:

MSBUILD : OctoPack error OCTONUGET: Version string specified for package reference '${BUILD_DATETIMEVERSION_PATH}.103' is invalid. [S:\Program Files\Jenkins\workspace\Client\Project.csproj]

What's causing this error and how do I fix it?


Answer

For our builds that use Octopus Deploy, we use a plugin for Jenkins called "Build Timestamp," which creates a variable Jenkins can use that contains the current date.

We use this plugin to create a custom variable called BUILD_DATETIMEVERSION_PATH, which is just the current date in a YYYY.MM.DD format.

Sometimes, after applying updates to Jenkins, this plugin forgets it's settings.

The fix is to restore the settings. You'll need to:

  1. Go into Manage Jenkins
  2. Go to Configure System
  3. Find the Build Timestamp section and make sure it is Enabled.
  4. Add a new Build Timestamp Export Variable named BUILD_DATETIMEVERSION_PATH, with a yyyy.MM.dd pattern, and - 0 days 0 hours 0 minutes Shift Timestamp value.
  5. Save and kick off a new build.

Your Build Timestamp should look like this