[JIRA] (JENKINS-60081) AgentConfigFiles could be more defensive

3 views
Skip to first unread message

aburdajewicz@cloudbees.com (JIRA)

unread,
Nov 7, 2019, 1:35:02 AM11/7/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ created an issue
 
Jenkins / Improvement JENKINS-60081
AgentConfigFiles could be more defensive
Issue Type: Improvement Improvement
Assignee: Emilio Escobar
Components: support-core-plugin
Created: 2019-11-07 06:34
Environment: support-core:2.56
Priority: Minor Minor
Reporter: Allan BURDAJEWICZ

While analyzing instances, I have seen cases where the nodes/slave/ directory contains many agents but the config.xml could not be found. This results in many files `nodes/slave/<slaveName>/config.xml` containing the exception:

--- WARNING: Could not attach <JENKINS_HOME>/nodes/<agentName>/config.xml as it cannot currently be found ---

java.io.FileNotFoundException: File '<JENKINS_HOME>/nodes/<agentName>/config.xml' does not exist
	at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:292)
	at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1765)
	at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1800)
	at com.cloudbees.jenkins.support.configfiles.SecretHandler.findSecrets(SecretHandler.java:96)
	at com.cloudbees.jenkins.support.configfiles.XmlRedactedSecretFileContent.getInputStream(XmlRedactedSecretFileContent.java:25)
	at com.cloudbees.jenkins.support.api.FileContent.writeTo(FileContent.java:85)
	at com.cloudbees.jenkins.support.SupportPlugin.writeBundle(SupportPlugin.java:316)
	at com.cloudbees.jenkins.support.SupportPlugin.writeBundle(SupportPlugin.java:278)
	at com.cloudbees.jenkins.support.SupportPlugin$PeriodicWorkImpl.lambda$doRun$0(SupportPlugin.java:820)
	at java.lang.Thread.run(Unknown Source)
        [...]

This suggests that the $JENKINS_HOME/nodes directory contains some kind of obsolete / corrupted directories. Maybe this could happen with ephemeral agents. In any case I do believe that https://github.com/jenkinsci/support-core-plugin/blob/support-core-2.56/src/main/java/com/cloudbees/jenkins/support/configfiles/AgentsConfigFile.java could be more defensive

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

aburdajewicz@cloudbees.com (JIRA)

unread,
Nov 7, 2019, 1:35:03 AM11/7/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ assigned an issue to Allan BURDAJEWICZ
Change By: Allan BURDAJEWICZ
Assignee: Emilio  Escobar Allan BURDAJEWICZ
Reply all
Reply to author
Forward
0 new messages