Ritica Ramakrishnan
Ritica Ramakrishnan

Reputation: 79

Jenkins symlinks/permalinks broken after restart

Jenkins version 2.114 is running builds but they seem to disappear from the Dashboard after a restart. I have Jenkins setup on Linux and all the log is present under ${JENKINS_HOME}/jobs/${ITEM_FULL_NAME}/builds

I have tried Reload Configuration from Disk with following set in /etc/sysconfig/jenkins

JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"

Below is build and workspace directory settings:

Workspace Root Directory :${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}
Build Record Root Directory: ${ITEM_ROOTDIR}/builds

Below you can see the build number 117 and 118, but still, the lastFailedBuild, lastStableBuild , lastSuccessfulBuild are set to -1, which doesn't exist

drwxr-xr-x 4 jenkins jenkins 4096 Apr  2 20:17 117
drwxr-xr-x 4 jenkins jenkins 4096 Apr  3 20:17 118
lrwxrwxrwx 1 jenkins jenkins    2 Apr  3 11:09 lastFailedBuild -> -1
lrwxrwxrwx 1 jenkins jenkins    2 Apr  4 10:44 lastStableBuild -> -1
lrwxrwxrwx 1 jenkins jenkins    2 Apr  4 03:21 lastSuccessfulBuild -> -1
lrwxrwxrwx 1 jenkins jenkins    2 Apr  3 10:58 lastUnstableBuild -> -1
lrwxrwxrwx 1 jenkins jenkins    2 Apr  3 10:58 lastUnsuccessfulBuild -> -1

I have also set the

Discard Old Builds Slicer - Days to keep artifacts as 30
Discard Old Builds Slicer - Max # of builds to keep as 40

I ran the jenkins-job-checker[ https://github.com/docwhat/jenkins-job-checker ] on one of the jobs and found the following :

 Problem: NOTLINK: The number link builds/1 is not a symlink!
 Problem: NOTLINK: The number link builds/2 is not a symlink!
 Problem: NOTLINK: The number link builds/3 is not a symlink!
 Proposal: Archive non-link builds/1
 Proposal: Archive non-link builds/2
 Proposal: Archive non-link builds/3

Really appreaciate some help

Upvotes: 2

Views: 3514

Answers (3)

Kurt Vangraefschepe
Kurt Vangraefschepe

Reputation: 130

Installing the Build Symlink plugin should restore the symlink functionality.

Upvotes: 0

AAber
AAber

Reputation: 1759

The links have been replaced with the permalinks file:

 rwxr-xr-x 2 jenkins jenkins 4096 Aug  6  2018 98
drwxr-xr-x 2 jenkins jenkins 4096 Aug  7  2018 99
lrwxrwxrwx 1 jenkins jenkins    3 Jan 19 13:47 lastFailedBuild -> 649
lrwxrwxrwx 1 jenkins jenkins    3 Jan 19 13:48 lastSuccessfulBuild -> 622
lrwxrwxrwx 1 jenkins jenkins    2 Jun 14  2018 lastUnstableBuild -> -1
lrwxrwxrwx 1 jenkins jenkins    3 Jan 19 13:49 lastUnsuccessfulBuild -> 649
-rw-r--r-- 1 jenkins jenkins    0 Jun 14  2018 legacyIds
-rw-r--r-- 1 jenkins jenkins  134 Jan 19 14:42 permalinks
jenkins@ip-1-9-2-253_jenkins:~/jobs/cron_dockers/jobs/ios/builds$ cat permalinks 
lastCompletedBuild 651
lastFailedBuild 650
lastStableBuild 651
lastSuccessfulBuild 651
lastUnstableBuild -1
lastUnsuccessfulBuild 650

Make sure the values in the permalinks file are correct, these are the values that are used to generate the values in the Jenkins GUI.

Upvotes: 2

Ritica Ramakrishnan
Ritica Ramakrishnan

Reputation: 79

I installed the plugin operations-center-context and that solved my problem

I found the solution in below link:

https://support.cloudbees.com/hc/en-us/articles/216227047-After-moving-a-job-symlinks-for-folders-became-actual-folders

Upvotes: 1

Related Questions