-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins 1.6.42.1
Ubuntu 14.04
JAVA 7
Jenkins creates lots of warning message for matrix project. The size of log would just keep growing which makes it very hard to read.
The log looks something like this:
Feb 29, 2016 5:06:34 PM hudson.matrix.MatrixProject getRootDirFor WARNING: Cannot create directory /var/lib/jenkins/jobs/model/configurations/axis-BUILD_TYPE/release/axis-MODEL_NAME/XXX for the combination BUILD_TYPE=release,MODEL_NAME=XXXX Feb 29, 2016 5:06:34 PM hudson.matrix.MatrixProject getRootDirFor WARNING: Cannot create directory /var/lib/jenkins/jobs/model/configurations/axis-BUILD_TYPE/release/axis-MODEL_NAME/XXX for the combination BUILD_TYPE=release,MODEL_NAME=XXXX Feb 29, 2016 5:06:34 PM hudson.matrix.MatrixProject getRootDirFor
After some debugging, I think the problem is that it's calling File.mkdirs(), which would return false if the folder already exist.
public File getRootDirFor(@Nonnull Combination combination) { File f = getConfigurationsDir(); for (Entry<String, String> e : combination.entrySet()) f = new File(f,"axis-"+e.getKey()+'/'+Util.rawEncode(e.getValue())); if (!f.getParentFile().mkdirs()) { LOGGER.log(Level.WARNING, "Cannot create directory {0} for the combination {1}", new Object[]{f, combination}); } return f; }
I suggest there should be a check whether the folder exist. if !f.exists() && !f.getParentFile().mkdirs(), then output the warning.
I also see these warnings (in the system log at startup) after upgrading the Matrix Project Plugin from 1.6 to 1.7 on Jenkins 1.656. Downgrading the plugin to 1.6 cleared the messages.