title: Jenkins startup error: jenkins.model.InvalidBuildsDir: does not contain ${ITEM_FULL_NAME} or ${ITEM_ROOTDIR}, cannot distinguish between projects
body: <p>Help please. In our workflow we only work with pre-packaged offline deploys where we do not have root access and therefore use supervisord to stop start ALL packages. We deploy all our packages under a user account. I have created a custom Jenkins package. Its basically its a folder containing the Jenkins war file and configurations from when I tool a vanilla initial setup.</p>
  
  <p>My installation has worked up until now. Seems trying to get things running for the first time seems flaky. Once running Jenkins is fine. This time I am trying to deploy the packages (they have not changed) however I cannot start Jenkins and get and error:</p>
  
  <p><em>jenkins.model.InvalidBuildsDir: does not contain ${ITEM_FULL_NAME} or ${ITEM_ROOTDIR}, cannot distinguish between projects</em></p>
  
  <p>So what I did was get a clean fresh install running and packaged it up. Basically I untar the jenkins directory then use supervisord to control start/stop.</p>
  
  <p><strong>Supervisord config:</strong></p>
  
  <pre><code>[program:jenkins]
  autorestart = true
  autostart = true
  command = /bin/bash -c "set JENKINS_HOME=/opt/home/svc_user/opskit/jenkins; /opt/home/svc_user/opskit/jdk/bin/java -Djava.awt.headless=true -Djenkins.model.Jenkins.buildsDir=/opt/home/svc_user/data/jenkins/builds/${ITEM_FULL_NAME} -Djenkins.model.Jenkins.workspacesDir=/opt/home/svc_user/data/jenkins/workspace/${ITEM_FULL_NAME} -jar /opt/home/svc_user/opskit/jenkins/bin/jenkins.war -path=/opt/home/svc_user/opskit/jenkins"
  directory = /opt/home/svc_user/opskit/jenkins
  redirect_stderr = true
  stdout_logfile = /opt/home/svc_user/opskit/log/jenkins.log
  stdout_logfile_backups = 5
  stdout_logfile_maxbytes = 10MB
  stopwaitsecs = 300
  </code></pre>
  
  <p><strong>Full error:</strong></p>
  
  <pre><code>jenkins.model.InvalidBuildsDir: /opt/home/svc_user/data/jenkins/builds does not contain ${ITEM_FULL_NAME} or ${ITEM_ROOTDIR}, cannot distinguish between projects
      at jenkins.model.Jenkins.checkRawBuildsDir(Jenkins.java:3179)
      at jenkins.model.Jenkins.setBuildsAndWorkspacesDir(Jenkins.java:3135)
      at jenkins.model.Jenkins.loadConfig(Jenkins.java:3123)
  Caused: java.io.IOException
      at jenkins.model.Jenkins.loadConfig(Jenkins.java:3125)
      at jenkins.model.Jenkins.access$1200(Jenkins.java:320)
      at jenkins.model.Jenkins$13.run(Jenkins.java:3219)
      at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
      at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
      at jenkins.model.Jenkins$5.runTask(Jenkins.java:1133)
      at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
      at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
      at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  Caused: org.jvnet.hudson.reactor.ReactorException
      at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
      at jenkins.InitReactorRunner.run(InitReactorRunner.java:50)
      at jenkins.model.Jenkins.executeReactor(Jenkins.java:1166)
      at jenkins.model.Jenkins.&lt;init&gt;(Jenkins.java:966)
      at hudson.model.Hudson.&lt;init&gt;(Hudson.java:85)
      at hudson.model.Hudson.&lt;init&gt;(Hudson.java:81)
      at hudson.WebAppMain$3.run(WebAppMain.java:233)
  Caused: hudson.util.HudsonFailedToLoad
      at hudson.WebAppMain$3.run(WebAppMain.java:250)
  </code></pre>
  
  <p><strong>Jenkins config.xml:</strong></p>
  
  <pre><code>&lt;workspaceDir&gt;/opt/home/svc_user/data/jenkins/workspace/${ITEM_FULL_NAME}&lt;/workspaceDir&gt;
  &lt;buildsDir&gt;/opt/home/svc_user/data/jenkins/builds/${ITEM_FULL_NAME}&lt;/buildsDir&gt;
  </code></pre>
  
  <p><strong>Folder permissions (install dir):</strong></p>
  
  <pre><code>lrwxrwxrwx  1 svc_user svc_user   39 Jun  4 02:51 jenkins -&gt; /opt/home/svc_user/opskit/jenkins-2.222.3
  drwxr-xr-x 13 svc_user svc_user 4096 May  1 05:07 jenkins-2.222.3
  </code></pre>
  
  <p><strong>Folder permissions (custom dir for builds and workspaces):</strong></p>
  
  <pre><code>lrwxrwxrwx 1 svc_user svc_user 37 Jun  4 02:51 jenkins -&gt; /opt/home/svc_user/data/jenkins-2.222.3
  drwxr-xr-x 4 svc_user svc_user 37 Jun  4 16:39 jenkins-2.222.3
  
    |-nginx-1.16.1
    |-jdk-8u91
    |-jenkins-2.222.3
    |  |-builds
    |  |-workspace
  </code></pre>
  
  <p>Help would be greatly appreciated. Thank you in advance.</p>