java.lang.IllegalArgumentException: Prefix string too short

Jenkins JIRA | Jonathan Price | 2 years ago
  1. 0

    Jenkins 1.597 changed the build ID from being a timestamp to being the build number. xvfb-plugin calls Hudson.FilePath.createTempDir() using the build ID as the prefix. The prefix must be at least 3 characters long or there is an exception. For builds with the build number < 100, therefore, the build ID won't be big enough and so will fail the build. Sample stack trace below. An ugly workaround would be to keep running the failing builds until you get to build 100, where it should again be successful. ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com java.lang.IllegalArgumentException: Prefix string too short at java.io.File.createTempFile0(File.java:1844) at java.io.File.createTempFile(File.java:1934) at hudson.FilePath$18.invoke(FilePath.java:1404) at hudson.FilePath$18.invoke(FilePath.java:1401) at hudson.FilePath.act(FilePath.java:989) at hudson.FilePath.act(FilePath.java:967) at hudson.FilePath.createTempDir(FilePath.java:1401) at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.launchXvfb(XvfbBuildWrapper.java:484) at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.setUp(XvfbBuildWrapper.java:594) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:655) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533) at hudson.model.Run.execute(Run.java:1718) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240)

    Jenkins JIRA | 2 years ago | Jonathan Price
    java.lang.IllegalArgumentException: Prefix string too short
  2. 0

    Jenkins 1.597 changed the build ID from being a timestamp to being the build number. xvfb-plugin calls Hudson.FilePath.createTempDir() using the build ID as the prefix. The prefix must be at least 3 characters long or there is an exception. For builds with the build number < 100, therefore, the build ID won't be big enough and so will fail the build. Sample stack trace below. An ugly workaround would be to keep running the failing builds until you get to build 100, where it should again be successful. ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com java.lang.IllegalArgumentException: Prefix string too short at java.io.File.createTempFile0(File.java:1844) at java.io.File.createTempFile(File.java:1934) at hudson.FilePath$18.invoke(FilePath.java:1404) at hudson.FilePath$18.invoke(FilePath.java:1401) at hudson.FilePath.act(FilePath.java:989) at hudson.FilePath.act(FilePath.java:967) at hudson.FilePath.createTempDir(FilePath.java:1401) at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.launchXvfb(XvfbBuildWrapper.java:484) at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.setUp(XvfbBuildWrapper.java:594) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:655) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533) at hudson.model.Run.execute(Run.java:1718) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240)

    Jenkins JIRA | 2 years ago | Jonathan Price
    java.lang.IllegalArgumentException: Prefix string too short
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    I get this error starting a job with "Start Xvfb before the build, and shut it down after" option active. ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com java.lang.IllegalArgumentException: Prefix string too short at java.io.File.createTempFile(File.java:1978) at hudson.FilePath$18.invoke(FilePath.java:1404) at hudson.FilePath$18.invoke(FilePath.java:1401) at hudson.FilePath.act(FilePath.java:989) at hudson.FilePath.act(FilePath.java:967) at hudson.FilePath.createTempDir(FilePath.java:1401) at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.launchXvfb(XvfbBuildWrapper.java:484) at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.setUp(XvfbBuildWrapper.java:594) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:655) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533) at hudson.model.Run.execute(Run.java:1718) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) I see in the code XvfbBuildWrapper.launchXvfb the build Id property is passed as prefix. final FilePath frameBufferDir = rootPath.createTempDir(build.getId(), "xvfb"); The java.io.File.createTempFile throw an IllegalArgumentException if the prefix argument contains less than three characters. I think the build.id is a number and is less than 3 character (at least for the first 99 builds).

    Jenkins JIRA | 2 years ago | mturra
    java.lang.IllegalArgumentException: Prefix string too short
  5. 0

    I get this error starting a job with "Start Xvfb before the build, and shut it down after" option active. ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com java.lang.IllegalArgumentException: Prefix string too short at java.io.File.createTempFile(File.java:1978) at hudson.FilePath$18.invoke(FilePath.java:1404) at hudson.FilePath$18.invoke(FilePath.java:1401) at hudson.FilePath.act(FilePath.java:989) at hudson.FilePath.act(FilePath.java:967) at hudson.FilePath.createTempDir(FilePath.java:1401) at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.launchXvfb(XvfbBuildWrapper.java:484) at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.setUp(XvfbBuildWrapper.java:594) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:655) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533) at hudson.model.Run.execute(Run.java:1718) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) I see in the code XvfbBuildWrapper.launchXvfb the build Id property is passed as prefix. final FilePath frameBufferDir = rootPath.createTempDir(build.getId(), "xvfb"); The java.io.File.createTempFile throw an IllegalArgumentException if the prefix argument contains less than three characters. I think the build.id is a number and is less than 3 character (at least for the first 99 builds).

    Jenkins JIRA | 2 years ago | mturra
    java.lang.IllegalArgumentException: Prefix string too short

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Prefix string too short

      at java.io.File.createTempFile0()
    2. Java RT
      File.createTempFile
      1. java.io.File.createTempFile0(File.java:1844)
      2. java.io.File.createTempFile(File.java:1934)
      2 frames
    3. Hudson
      FilePath.createTempDir
      1. hudson.FilePath$18.invoke(FilePath.java:1404)
      2. hudson.FilePath$18.invoke(FilePath.java:1401)
      3. hudson.FilePath.act(FilePath.java:989)
      4. hudson.FilePath.act(FilePath.java:967)
      5. hudson.FilePath.createTempDir(FilePath.java:1401)
      5 frames
    4. org.jenkinsci.plugins
      XvfbBuildWrapper.setUp
      1. org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.launchXvfb(XvfbBuildWrapper.java:484)
      2. org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.setUp(XvfbBuildWrapper.java:594)
      2 frames
    5. Hudson Maven Embedder
      MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun
      1. hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:655)
      1 frame
    6. Hudson
      Run.execute
      1. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
      2. hudson.model.Run.execute(Run.java:1718)
      2 frames
    7. Hudson Maven Embedder
      MavenModuleSetBuild.run
      1. hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
      1 frame
    8. Hudson
      Executor.run
      1. hudson.model.ResourceController.execute(ResourceController.java:89)
      2. hudson.model.Executor.run(Executor.java:240)
      2 frames