I am building a pipeline job with parallel stages. The pipeline will run on two slave machines. One is MAC and other is WINDOWS. If I execute more than
      one instance of the pipeline, it seems there is a permission error in windows. 

          [JENKINS-56135] Npm parallel builds failing.

          Ravi Singh created issue -
          Ravi Singh made changes -
          Description Original: I am building a pipeline job with parallel stages. The pipeline will run on two slave machines. One is MAC and other is WINDOWS. If I execute more than one instance of the pipeline, it seems there is a permission error in windows. Like 


          {code:java}
          npm ERR! path C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json
           
           
          npm ERR! code EPERM
           
           
          npm ERR! errno -4048
           
           
          npm ERR! syscall unlink
           
           
          npm ERR! Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json'
           
           
          npm ERR! { [Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json']
           
           
          npm ERR! cause:
           
           
          npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json'
           
           
          npm ERR! errno: -4048,
           
           
          npm ERR! code: 'EPERM',
           
           
          npm ERR! syscall: 'unlink',
           
           
          npm ERR! path:
           
           
          npm ERR! 'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json' },
           
           
          npm ERR! stack:
           
           
          npm ERR! 'Error: EPERM: operation not permitted, unlink \'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json\'',
           
           
          npm ERR! errno: -4048,
           
           
          npm ERR! code: 'EPERM',
           
           
          npm ERR! syscall: 'unlink',
           
           
          npm ERR! path:
           
           
          npm ERR! 'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json',
           
           
          npm ERR! parent: 'IBMDigitalAppBuilder' }
           
           
          npm ERR!
           
           
          npm ERR! The operation was rejected by your operating system.
           
           
          npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
           
           
          npm ERR! or that you lack permissions to access it.
           
           
          npm ERR!
          {code}
           
          Even when I am using a dynamic workspace folder because of this. The workspace folder is working as they should but why these folders are created in the first place.

          My pipeline code is something like this.-
           
          {code:java}
          // code placeholder
          pipeline { agent { label { label "" customWorkspace "./workspace/BuildFor_${env.JOB_NAME}_${env.BRANCH_NAME}_${env.BUILD_NUMBER}" } } environment { NODE_OPTIONS='--max-old-space-size=4096' github_token = credentials('ibm_github') mac_slave_machine_password = credentials('mac_slave_machine_password') personal_github_token = credentials('personal_github_token') artifactory_apikey = credentials('artifactory_wcp-mobileservices-npm-local_apikey') } stages { stage ("Copywrite Check + Dynamically Generate .npmrc file") { parallel { stage('Checking copywrite and generating .npmrc file on MAC') { agent { label "mf-build-11" } steps { // sh 'python scripts/check_copyright.py' sh 'echo $BUILD_NUMBER' sh 'python scripts/generate_npmrc.py $artifactory_apikey' sh 'ls' } } stage('Checking copywrite and generating .npmrc file on Windows') { agent { label "studioBuild" } steps { // bat 'python scripts/check_copyright.py' bat 'echo %BUILD_NUMBER%' bat 'python scripts/generate_npmrc.py %artifactory_apikey%' bat 'dir' } } }
          {code}
          New: I am building a pipeline job with parallel stages. The pipeline will run on two slave machines. One is MAC and other is WINDOWS. If I execute more than
           one instance of the pipeline, it seems there is a permission error in windows. Like 
          {code:java}
          npm ERR! path C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json
           
           
          npm ERR! code EPERM
           
           
          npm ERR! errno -4048
           
           
          npm ERR! syscall unlink
           
           
          npm ERR! Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json'
           
           
          npm ERR! { [Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json']
           
           
          npm ERR! cause:
           
           
          npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json'
           
           
          npm ERR! errno: -4048,
           
           
          npm ERR! code: 'EPERM',
           
           
          npm ERR! syscall: 'unlink',
           
           
          npm ERR! path:
           
           
          npm ERR! 'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json' },
           
           
          npm ERR! stack:
           
           
          npm ERR! 'Error: EPERM: operation not permitted, unlink \'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json\'',
           
           
          npm ERR! errno: -4048,
           
           
          npm ERR! code: 'EPERM',
           
           
          npm ERR! syscall: 'unlink',
           
           
          npm ERR! path:
           
           
          npm ERR! 'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json',
           
           
          npm ERR! parent: 'IBMDigitalAppBuilder' }
           
           
          npm ERR!
           
           
          npm ERR! The operation was rejected by your operating system.
           
           
          npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
           
           
          npm ERR! or that you lack permissions to access it.
           
           
          npm ERR!
          {code}
           
           Even when I am using a dynamic workspace folder because of this. The workspace folder is working as they should but why these folders are created in the first place.
          {code:java}
          My pipeline code is something like this.-
          pipeline { agent { label { label "" customWorkspace "./workspace/BuildFor_${env.JOB_NAME}_${env.BRANCH_NAME}_${env.BUILD_NUMBER}" } } stages { stage ("Copywrite Check + Dynamically Generate .npmrc file") { parallel { stage('Checking copywrite and generating .npmrc file on MAC') { agent { label "mf-build-11" } steps { // sh 'python scripts/check_copyright.py' sh 'echo $BUILD_NUMBER' sh 'python scripts/generate_npmrc.py $artifactory_apikey' sh 'ls' } } stage('Checking copywrite and generating .npmrc file on Windows') { agent { label "studioBuild" } steps { // bat 'python scripts/check_copyright.py' bat 'echo %BUILD_NUMBER%' bat 'python scripts/generate_npmrc.py %artifactory_apikey%' bat 'dir' } } } }{code}
            
          {code:java}
          // code placeholder
          {code}
           
          Ravi Singh made changes -
          Description Original: I am building a pipeline job with parallel stages. The pipeline will run on two slave machines. One is MAC and other is WINDOWS. If I execute more than
           one instance of the pipeline, it seems there is a permission error in windows. Like 
          {code:java}
          npm ERR! path C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json
           
           
          npm ERR! code EPERM
           
           
          npm ERR! errno -4048
           
           
          npm ERR! syscall unlink
           
           
          npm ERR! Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json'
           
           
          npm ERR! { [Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json']
           
           
          npm ERR! cause:
           
           
          npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json'
           
           
          npm ERR! errno: -4048,
           
           
          npm ERR! code: 'EPERM',
           
           
          npm ERR! syscall: 'unlink',
           
           
          npm ERR! path:
           
           
          npm ERR! 'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json' },
           
           
          npm ERR! stack:
           
           
          npm ERR! 'Error: EPERM: operation not permitted, unlink \'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json\'',
           
           
          npm ERR! errno: -4048,
           
           
          npm ERR! code: 'EPERM',
           
           
          npm ERR! syscall: 'unlink',
           
           
          npm ERR! path:
           
           
          npm ERR! 'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json',
           
           
          npm ERR! parent: 'IBMDigitalAppBuilder' }
           
           
          npm ERR!
           
           
          npm ERR! The operation was rejected by your operating system.
           
           
          npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
           
           
          npm ERR! or that you lack permissions to access it.
           
           
          npm ERR!
          {code}
           
           Even when I am using a dynamic workspace folder because of this. The workspace folder is working as they should but why these folders are created in the first place.
          {code:java}
          My pipeline code is something like this.-
          pipeline { agent { label { label "" customWorkspace "./workspace/BuildFor_${env.JOB_NAME}_${env.BRANCH_NAME}_${env.BUILD_NUMBER}" } } stages { stage ("Copywrite Check + Dynamically Generate .npmrc file") { parallel { stage('Checking copywrite and generating .npmrc file on MAC') { agent { label "mf-build-11" } steps { // sh 'python scripts/check_copyright.py' sh 'echo $BUILD_NUMBER' sh 'python scripts/generate_npmrc.py $artifactory_apikey' sh 'ls' } } stage('Checking copywrite and generating .npmrc file on Windows') { agent { label "studioBuild" } steps { // bat 'python scripts/check_copyright.py' bat 'echo %BUILD_NUMBER%' bat 'python scripts/generate_npmrc.py %artifactory_apikey%' bat 'dir' } } } }{code}
            
          {code:java}
          // code placeholder
          {code}
           
          New: I am building a pipeline job with parallel stages. The pipeline will run on two slave machines. One is MAC and other is WINDOWS. If I execute more than
           one instance of the pipeline, it seems there is a permission error in windows. Like 
          {code:java}
          npm ERR! path C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json
           
           
          npm ERR! code EPERM
           
           
          npm ERR! errno -4048
           
           
          npm ERR! syscall unlink
           
           
          npm ERR! Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json'
           
           
          npm ERR! { [Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json']
           
           
          npm ERR! cause:
           
           
          npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json'
           
           
          npm ERR! errno: -4048,
           
           
          npm ERR! code: 'EPERM',
           
           
          npm ERR! syscall: 'unlink',
           
           
          npm ERR! path:
           
           
          npm ERR! 'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json' },
           
           
          npm ERR! stack:
           
           
          npm ERR! 'Error: EPERM: operation not permitted, unlink \'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json\'',
           
           
          npm ERR! errno: -4048,
           
           
          npm ERR! code: 'EPERM',
           
           
          npm ERR! syscall: 'unlink',
           
           
          npm ERR! path:
           
           
          npm ERR! 'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json',
           
           
          npm ERR! parent: 'IBMDigitalAppBuilder' }
           
           
          npm ERR!
           
           
          npm ERR! The operation was rejected by your operating system.
           
           
          npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
           
           
          npm ERR! or that you lack permissions to access it.
           
           
          npm ERR!
          {code}
           
           Even when I am using a dynamic workspace folder because of this. The workspace folder is working as they should but why these folders are created in the first place.
          {code:java}
          My pipeline code is something like this.-

          pipeline {
          agent {
          label {
           label ""
          customWorkspace "./workspace/BuildFor_${env.JOB_NAME}_${env.BRANCH_NAME}_${env.BUILD_NUMBER}"
                 } }
           stages {
          stage ("Copywrite Check + Dynamically Generate .npmrc file") {
            parallel {
           stage('Checking copywrite and generating .npmrc file on MAC') {
                agent {
                  label "mf-build-11"
            }
            steps {
                  // sh 'python scripts/check_copyright.py'

                   sh 'echo $BUILD_NUMBER'
                    sh 'python scripts/generate_npmrc.py $artifactory_apikey'
                           sh 'ls'
           }
             }
            stage('Checking copywrite and generating .npmrc file on Windows') {
                        agent {
                       label "studioBuild"
                        }
                         steps {
                            // bat 'python scripts/check_copyright.py'
                  bat 'echo %BUILD_NUMBER%'
                       bat 'python scripts/generate_npmrc.py %artifactory_apikey%'
                                bat 'dir'
                      }
              }
           }
          }{code}
            

           
          Andrew Bayer made changes -
          Assignee Original: Andrew Bayer [ abayer ]
          Ravi Singh made changes -
          Description Original: I am building a pipeline job with parallel stages. The pipeline will run on two slave machines. One is MAC and other is WINDOWS. If I execute more than
           one instance of the pipeline, it seems there is a permission error in windows. Like 
          {code:java}
          npm ERR! path C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json
           
           
          npm ERR! code EPERM
           
           
          npm ERR! errno -4048
           
           
          npm ERR! syscall unlink
           
           
          npm ERR! Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json'
           
           
          npm ERR! { [Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json']
           
           
          npm ERR! cause:
           
           
          npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\workspace\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\node_modules\.staging\typescript-c52c96ba\lib\es\diagnosticMessages.generated.json'
           
           
          npm ERR! errno: -4048,
           
           
          npm ERR! code: 'EPERM',
           
           
          npm ERR! syscall: 'unlink',
           
           
          npm ERR! path:
           
           
          npm ERR! 'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json' },
           
           
          npm ERR! stack:
           
           
          npm ERR! 'Error: EPERM: operation not permitted, unlink \'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json\'',
           
           
          npm ERR! errno: -4048,
           
           
          npm ERR! code: 'EPERM',
           
           
          npm ERR! syscall: 'unlink',
           
           
          npm ERR! path:
           
           
          npm ERR! 'C:\\workspace\\ntal_build_new_pull_request-BL7QHNTCEFER3V4N6SFI4MCLHOCO62H22UO6N4UOONFACJ44GBIA\\node_modules\\.staging\\typescript-c52c96ba\\lib\\es\\diagnosticMessages.generated.json',
           
           
          npm ERR! parent: 'IBMDigitalAppBuilder' }
           
           
          npm ERR!
           
           
          npm ERR! The operation was rejected by your operating system.
           
           
          npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
           
           
          npm ERR! or that you lack permissions to access it.
           
           
          npm ERR!
          {code}
           
           Even when I am using a dynamic workspace folder because of this. The workspace folder is working as they should but why these folders are created in the first place.
          {code:java}
          My pipeline code is something like this.-

          pipeline {
          agent {
          label {
           label ""
          customWorkspace "./workspace/BuildFor_${env.JOB_NAME}_${env.BRANCH_NAME}_${env.BUILD_NUMBER}"
                 } }
           stages {
          stage ("Copywrite Check + Dynamically Generate .npmrc file") {
            parallel {
           stage('Checking copywrite and generating .npmrc file on MAC') {
                agent {
                  label "mf-build-11"
            }
            steps {
                  // sh 'python scripts/check_copyright.py'

                   sh 'echo $BUILD_NUMBER'
                    sh 'python scripts/generate_npmrc.py $artifactory_apikey'
                           sh 'ls'
           }
             }
            stage('Checking copywrite and generating .npmrc file on Windows') {
                        agent {
                       label "studioBuild"
                        }
                         steps {
                            // bat 'python scripts/check_copyright.py'
                  bat 'echo %BUILD_NUMBER%'
                       bat 'python scripts/generate_npmrc.py %artifactory_apikey%'
                                bat 'dir'
                      }
              }
           }
          }{code}
            

           
          New: I am building a pipeline job with parallel stages. The pipeline will run on two slave machines. One is MAC and other is WINDOWS. If I execute more than
          one instance of the pipeline, it seems there is a permission error in windows. 
          Ravi Singh made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

            Unassigned Unassigned
            rvsingh011 Ravi Singh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: