jenkinsci / jenkinsci/support-core-plugin
[JENKINS-60081] AgentConfigFiles could be more defensive
- Dominant language
- Java
- Stars
- 19
- Forks
- 77
- Avg merge
- 17h 53m
- Merged PRs (30d)
- 3
Description
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//config.xml` containing the exception:
--- WARNING: Could not attach /nodes//config.xml as it cannot currently be found ---java.io.FileNotFoundException: File '/nodes//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
---
Originally reported by
allan_burdajewicz, imported from: AgentConfigFiles could be more defensive
allan_burdajewicz
Raw content of original issue
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
- environment:
support-core:2.56
Contributor guide
Research direction
Start with com/cloudbees/jenkins/support/configfiles/AgentsConfigFile.java and trace how missing nodes//config.xml files are handled during bundle generation. Reproduce the case with an obsolete or incomplete agent directory, then verify that support-bundle generation completes without the reported FileNotFoundException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100