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

Running shell script broken - was: Net build fails due to douple PATH enviroment Variable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • batch-task-plugin
    • None
    • Platform: PC, OS: Windows XP

      If you are running a batch task for some net build and the build uses dynamic
      code compilation (like ASP.Net, xsl transformation (MbUnit reporting)) then you
      can get the following error stack (snippet):

      Item has already been added. Key in dictionary: 'path' Key being added: 'path'
      [System.ArgumentException: Item has already been added. Key in dictionary:
      'path' Key being added: 'path'
      at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
      at System.Collections.Hashtable.Add(Object key, Object value)
      at System.Collections.Specialized.StringDictionary.Add(String key, String value)
      at
      System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(SafeUserTokenHandle
      userToken, String cmd, String currentDir, TempFileCollection tempFiles, String&
      outputName, String& errorName, String trueCmdLine)
      at System.CodeDom.Compiler.Executor.ExecWaitWithCapture(SafeUserTokenHandle
      userToken, String cmd, String currentDir, TempFileCollection tempFiles, String&
      outputName, String& errorName, String trueCmdLine)
      at Microsoft.CSharp.CSharpCodeGenerator.Compile(CompilerParameters options,
      String compilerDirectory, String compilerExe, String arguments, String&
      outputFile, Int32& nativeReturnValue, String trueArgs)
      at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters
      options, String[] fileNames)
      at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters
      options, String[] sources)
      at
      Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters
      options, String[] sources)
      at
      System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource(CompilerParameters
      options, String[] sources)
      ...

      This is caused (in my case) by a double entry for the path environment variable.
      I printed out the Net System.Environment while running under hudson (snippet):

      ...
      Path:C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\DrDOC\SYSTEM;C:\Programme\Microsoft
      Visual Studio\Common\VSS\win32;C:\Programme\Microsoft SQL
      Server\80\Tools\BINN;C:\Programme\Support
      Tools\;C:\Programme\CVSNT\;C:\Programme\apache-ant\bin\;c:\Programme\svn\bin
      SVN_REVISION:104
      USERDNSDOMAIN:xxx.de
      BUILD_ID:2007-10-31_10-05-38
      PATH:C:\Programme\Java\jdk1.5.0_05\bin
      ...

      For the base problem please see the following forum rss:

      http://forums.microsoft.com/msdn/rss.aspx?postid=231948&forumid=18&siteid=1

            kohsuke Kohsuke Kawaguchi
            mcmatt mcmatt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: