Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-11370

"The directory name is invalid" on Windows slaves

    Details

      Description

      Old description:

      pre-scm-buildstep assumes that the directory workspace exists when it's running. However, when setting up a project, it does not exist, and thus this step will fail unless the admin creates manually. Proper behaviour should be to check if it exists, and create it if it doesn't. Otherwise, if it does not exist, the execute shell will fail

      The issue also applies to system calls invoked from other places

        Activity

        niklassaers Niklas Saers created issue -
        Hide
        gbois Gregory Boissinot added a comment -

        Do you have tested the nvInject plugin?
        Maybe it is an alternative to your issue.
        Anyway, you could use the EnvInject plugin to setup the job workspace.

        Show
        gbois Gregory Boissinot added a comment - Do you have tested the nvInject plugin? Maybe it is an alternative to your issue. Anyway, you could use the EnvInject plugin to setup the job workspace.
        Hide
        acolichia Aaron Colichia added a comment -

        Here is the full stacktrace from the console when the pre-scm build plugin tries to reference the non-existent workspace. This will happen any time a new job which has no namespace in the slave filesystem uses the pre-scm plugin.

        Started by user <username>
        Building remotely on <slave node> in workspace /some/path/on/slave
        Running Prebuild steps
        [<job name>] $ cmd /c call C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\hudson334444854237146312.bat
        The directory name is invalid
        FATAL: command execution failed
        java.io.IOException: Cannot run program "cmd" (in directory "/some/path/on/slave"): CreateProcess error=267, The directory name is invalid
        at java.lang.ProcessBuilder.start(Unknown Source)
        at hudson.Proc$LocalProc.<init>(Proc.java:244)
        at hudson.Proc$LocalProc.<init>(Proc.java:216)
        at hudson.Launcher$LocalLauncher.launch(Launcher.java:707)
        at hudson.Launcher$ProcStarter.start(Launcher.java:338)
        at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:932)
        at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:899)
        at hudson.remoting.UserRequest.perform(UserRequest.java:118)
        at hudson.remoting.UserRequest.perform(UserRequest.java:48)
        at hudson.remoting.Request$2.run(Request.java:287)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at hudson.remoting.Engine$1$1.run(Engine.java:60)
        at java.lang.Thread.run(Unknown Source)
        Caused by: java.io.IOException: CreateProcess error=267, The directory name is invalid
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(Unknown Source)
        at java.lang.ProcessImpl.start(Unknown Source)
        ... 17 more
        Failed build for hudson.tasks.BatchFile@535c37ae

        Show
        acolichia Aaron Colichia added a comment - Here is the full stacktrace from the console when the pre-scm build plugin tries to reference the non-existent workspace. This will happen any time a new job which has no namespace in the slave filesystem uses the pre-scm plugin. Started by user <username> Building remotely on <slave node> in workspace /some/path/on/slave Running Prebuild steps [<job name>] $ cmd /c call C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\hudson334444854237146312.bat The directory name is invalid FATAL: command execution failed java.io.IOException: Cannot run program "cmd" (in directory "/some/path/on/slave"): CreateProcess error=267, The directory name is invalid at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:707) at hudson.Launcher$ProcStarter.start(Launcher.java:338) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:932) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:899) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:287) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:60) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: CreateProcess error=267, The directory name is invalid at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 17 more Failed build for hudson.tasks.BatchFile@535c37ae
        Hide
        oleg_nenashev Oleg Nenashev added a comment -

        Updated the issue.
        I suppose it is not related to [pre-scm-buildstep], because it also appears in other build steps

        Show
        oleg_nenashev Oleg Nenashev added a comment - Updated the issue. I suppose it is not related to [pre-scm-buildstep] , because it also appears in other build steps
        oleg_nenashev Oleg Nenashev made changes -
        Field Original Value New Value
        Summary pre-scm-buildstep assumes workspace exists "The directory name is invalid" on Windows slaves
        Labels slave
        Environment OS X 1.509.4
        Priority Minor [ 4 ] Major [ 3 ]
        Description pre-scm-buildstep assumes that the directory workspace exists when it's running. However, when setting up a project, it does not exist, and thus this step will fail unless the admin creates manually. Proper behaviour should be to check if it exists, and create it if it doesn't. Otherwise, if it does not exist, the execute shell will fail Old description:
        {quote}
        pre-scm-buildstep assumes that the directory workspace exists when it's running. However, when setting up a project, it does not exist, and thus this step will fail unless the admin creates manually. Proper behaviour should be to check if it exists, and create it if it doesn't. Otherwise, if it does not exist, the execute shell will fail
        {quote}

        The issue also applies to system calls invoked from other places
        Component/s core [ 15593 ]
        Component/s plugin [ 15491 ]
        oleg_nenashev Oleg Nenashev made changes -
        Labels slave slave windows workspace_corruption
        oleg_nenashev Oleg Nenashev made changes -
        Labels slave windows workspace_corruption slave windows workspace workspace_corruption
        Hide
        danielbeck Daniel Beck added a comment -

        Oleg: I don't see the core issue here. Could you elaborate? Automatic creation of the directory could well hide bugs.

        Show
        danielbeck Daniel Beck added a comment - Oleg: I don't see the core issue here. Could you elaborate? Automatic creation of the directory could well hide bugs.
        oleg_nenashev Oleg Nenashev made changes -
        Assignee Oleg Nenashev [ oleg_nenashev ]
        Hide
        oleg_nenashev Oleg Nenashev added a comment - - edited

        The issue rarely appears in following plugins:

        • Wokspace cleanup plugin
        • Perforce plugin

        BTW, I'm also not sure about the issue's origin.
        It could be caused by JNA libraries, FileSystem / OS specifics, etc., etc.
        All plugins use Jenkins core's methods to manage directories, I've supposed that it's better to re-assign the issue to the core

        Show
        oleg_nenashev Oleg Nenashev added a comment - - edited The issue rarely appears in following plugins: Wokspace cleanup plugin Perforce plugin BTW, I'm also not sure about the issue's origin. It could be caused by JNA libraries, FileSystem / OS specifics, etc., etc. All plugins use Jenkins core's methods to manage directories, I've supposed that it's better to re-assign the issue to the core
        oleg_nenashev Oleg Nenashev made changes -
        Assignee Oleg Nenashev [ oleg_nenashev ]

          People

          • Assignee:
            Unassigned
            Reporter:
            niklassaers Niklas Saers
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: