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

workspace name too long error when using a template

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Critical Critical
    • p4-plugin

      We are tesing with the P4 plugin 1.7.2-SNAPSHOT (private-768cb40d-jenkins) we are use this goovy to do a sync:

      def p4_credential='xxxxxxxxxx'
      def friendly_stream = perforceStream.replaceAll('/','_')
      def ublox_utils
      node(slaveRestriction) {
      def workspace ='workspace/'friendly_stream'_'+env.EXECUTOR_NUMBER
      ws(workspace)
      {
      withEnv(["WORKSPACE=${pwd()}"]) {
      stage ("Clean structure")
      {
      p4sync charset: 'none', credential: p4_credential, populate: [$class: 'ForceCleanImpl', delete: true, modtime: true, pin: '', quiet: true], template: 'jenkins_bootstrap'
      ublox_utils=load('jenkins_bootstrap/utils.groovy');
      ublox_utils.clean_build_area();
      }
      stage ("sync code"){
      def P4_CHANGELIST=ublox_utils.stream_sync(perforceStream,p4_credential,perforceLabel)
      currentBuild.displayName = '#'env.BUILD_NUMBER'.'+P4_CHANGELIST
      if (perforceShelve != "")
      {
      currentBuild.displayName = currentBuild.displayName+"+${perforceShelve}"
      }
      }
      // load template groovy
      job=load(script);
      job.run_steps()
      }
      }
      }

      so we are using a template but in the log we see this:

      ... p4 client -o jenkins-JNLP4-connect_connection_from_gb-mlb-dt-043.cog.cognovo.com-10___ -
      p4 client o jenkins-JNLP4-connect_connection_from_gb-mlb-dt-043.cog.cognovo.com-10.20.4.36:65261-INTEGRATION-dev-rsqu__sit_int_psapp_test_harness-MAT2-New_Thread2_PIPELINE_USB_LARA_R312_New-Thread2_Tests-DSTREAM_MALF-Test_UBX_SUITE_LTE_PSAPP_CI_COMMIT_PSAPP_2_0_DSTREAM_MALF_NEW_LARA_R312 File name too long

      How is this being created given we have set to use a template?

      And we do need to manage large workspace names

          [JENKINS-45432] workspace name too long error when using a template

          Robert Squire added a comment -

          I have found a fix but not sure if this is what is supposed to be done.

          p4sync command was changed to:

          p4sync charset: 'none', credential: p4_credential, format: 'jenkins_bootstrap2', populate: [$class: 'ForceCleanImpl', delete: true, modtime: true, pin: '', quiet: true], template: 'jenkins_bootstrap'

          this now works for me

          Robert Squire added a comment - I have found a fix but not sure if this is what is supposed to be done. p4sync command was changed to: p4sync charset: 'none', credential: p4_credential, format: 'jenkins_bootstrap2', populate: [$class: 'ForceCleanImpl', delete: true, modtime: true, pin: '', quiet: true] , template: 'jenkins_bootstrap' this now works for me

          Karl Wirth added a comment -

          I have not been able to reproduce this. I'm not sure if the cause was environmental or related to the variable 'friendly_stream' in some way.

           

          I'm going to close the issue for now but if you'd like to investigate further we can do some live debugging on your systems and modify the Jenkinsfile to display more debugging information about the environment just before the sync.

          Karl Wirth added a comment - I have not been able to reproduce this. I'm not sure if the cause was environmental or related to the variable 'friendly_stream' in some way.   I'm going to close the issue for now but if you'd like to investigate further we can do some live debugging on your systems and modify the Jenkinsfile to display more debugging information about the environment just before the sync.

          Karl Wirth added a comment -

          Happy to reopen and work on it if it becomes a problem again.

          Karl Wirth added a comment - Happy to reopen and work on it if it becomes a problem again.

            p4karl Karl Wirth
            rob_squire Robert Squire
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: