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

Plugin does not work with read-only perforce replica

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • p4-plugin
    • None
    • Jenkins 2.7.3; p4-plugin 1.4.9

      Our Jenkins instance uses a read-only perforce replica.

      After updating the p4 plugin to v1.4.9, the error 'Replica does not support this command' for p4 revert is no longer quietly ignored and causes the Jenkins job to terminate.

      The full output is now:
      p4 revert [...]
      Replica does not support this command.
      ERROR: P4JAVA: Error(s):
      Replica does not support this command.

      This error now means that the plugin does not work with perforce replicas.

      Unfortunately, reverting to 1.4.8 is not an option, as we require one of the other changes in 1.4.9.

          [JENKINS-39824] Plugin does not work with read-only perforce replica

          Tom Hollis added a comment -

          I am also experiencing this problem on a build farm replica.

          We are running:
          P4D/LINUX26X86_64/2015.1/1415928 (2016/07/25)

          Tom

          Tom Hollis added a comment - I am also experiencing this problem on a build farm replica. We are running: P4D/LINUX26X86_64/2015.1/1415928 (2016/07/25) Tom

          Gaige Paulsen added a comment - - edited

          We are running into the same problem with 

          P4D/LINUX26X86_64/2016.2/1509269

          on a build farm replica configuration.

          Although the have list can be updated on a build-farm replica, there are no work-in-progress commands, so the default method for rollback by using `revert` does not work.

          I've had success so far setting the Perforce configuration to Sync Only.

          Gaige Paulsen added a comment - - edited We are running into the same problem with  P4D/LINUX26X86_64/2016.2/1509269 on a build farm replica configuration. Although the have list can be updated on a build-farm replica, there are no work-in-progress commands, so the default method for rollback by using `revert` does not work. I've had success so far setting the Perforce configuration to Sync Only.

          Paul Allen added a comment -

          I am unable to fix this issue due to the behaviour of a read-only replica server.

          As the name suggests the server is read-only, which includes client workspace creation/update and the have table.  If you want to sync from a read-only server you need to use a 'Static' Workspace (that has been pre-configured) and a 'Force Clean' Populate option where the have list is not updated ('Populate have list' not checked). 

          Paul Allen added a comment - I am unable to fix this issue due to the behaviour of a read-only replica server. As the name suggests the server is read-only, which includes client workspace creation/update and the have table.  If you want to sync from a read-only server you need to use a 'Static' Workspace (that has been pre-configured) and a 'Force Clean' Populate option where the have list is not updated ('Populate have list' not checked). 

          Timothy Smith added a comment -

          This still fails with a force clean sync. The plugin is currently unusable is a serious Perforce environment with read-only depots.

          I would suggest reporting errors that can be continued from rather than failing jobs.

          Rolling back.

          Timothy Smith added a comment - This still fails with a force clean sync. The plugin is currently unusable is a serious Perforce environment with read-only depots. I would suggest reporting errors that can be continued from rather than failing jobs. Rolling back.

          Karl Wirth added a comment -

          Thanks for highlighting this. I confirm that the 'Force' jobs still run 'p4 revert' on readonly and build farm replicas which is not a supported command.

           

          P4 Task: reverting all pending and shelved revisions.
          
          ... p4 revert /var/lib/jenkins/workspace/ReadOnly_FreeStyleJob/... +
          ERROR: P4JAVA: Error(s):
          Replica does not support this command.
          
          Finished: FAILURE
          

          Therefore the only job type that will work for these types is 'Sync Only' with 'Populate have list' unticked:

          The developer is not around at the moment so we'll investigate further in the new year.

           

          Karl Wirth added a comment - Thanks for highlighting this. I confirm that the 'Force' jobs still run 'p4 revert' on readonly and build farm replicas which is not a supported command.   P4 Task: reverting all pending and shelved revisions. ... p4 revert / var /lib/jenkins/workspace/ReadOnly_FreeStyleJob/... + ERROR: P4JAVA: Error(s): Replica does not support this command. Finished: FAILURE Therefore the only job type that will work for these types is 'Sync Only' with 'Populate have list' unticked: The developer is not around at the moment so we'll investigate further in the new year.  

          Paul Allen added a comment -

          I am unable to fix this issue due to the behaviour of a read-only replica server. 

          Paul Allen added a comment - I am unable to fix this issue due to the behaviour of a read-only replica server. 

          Hokwang Lee added a comment -

          p4paul 

          Hello.

          I am using Jenkins with P4 first time.

          I have master and one read-only replica and broker and one build farm replica.

          Did you mean that Jenkins admin should not use broker, read-only replica, build farm replica, right??

          Hokwang Lee added a comment - p4paul   Hello. I am using Jenkins with P4 first time. I have master and one read-only replica and broker and one build farm replica. Did you mean that Jenkins admin should not use broker, read-only replica, build farm replica, right??

          Karl Wirth added a comment -

          Hi horangs. The only option that will work is if you choose static pre-configured workspaces and the option:

          'Sync Only' with 'Populate have list' unticked:

          as mentioned above.

          For anything else P4Jenkins expects to be able to run non readonly commands so an 'edge' or 'forwarding replica' is required.

          Karl Wirth added a comment - Hi horangs . The only option that will work is if you choose static pre-configured workspaces and the option: 'Sync Only' with 'Populate have list' unticked: as mentioned above. For anything else P4Jenkins expects to be able to run non readonly commands so an 'edge' or 'forwarding replica' is required.

          Hokwang Lee added a comment -

          p4karl

          Thanks for your comment.

           

          But I can't understand well.

           

          I think process is like below,

          1. perforce create workspace for reading Jenkinsfile(s) and creating pipeline. (In this case, I want to create workspace and read it and delete workspace automatically)
          2. and then running pipeline of some branch,
          3. kubernetes create pod for this
          4. and perforce create workspace written in Jenkinsfile
          5. and sync file, compile, and delete workspace automatically I want 

          In this senario, why need master server ? I don't know which action is needed for workspace

          I just think create workspace and then sync and the delete it.

          and If so many jobs in Jenkins and scheduling very often, is that correct way ?

          I don't think so, Jenkins should use broker or build farm replica .

          Hokwang Lee added a comment - p4karl Thanks for your comment.   But I can't understand well.   I think process is like below, perforce create workspace for reading Jenkinsfile(s) and creating pipeline. (In this case, I want to create workspace and read it and delete workspace automatically) and then running pipeline of some branch, kubernetes create pod for this and perforce create workspace written in Jenkinsfile and sync file, compile, and delete workspace automatically I want  In this senario, why need master server ? I don't know which action is needed for workspace I just think create workspace and then sync and the delete it. and If so many jobs in Jenkins and scheduling very often, is that correct way ? I don't think so, Jenkins should use broker or build farm replica .

          Karl Wirth added a comment -

          Only just seen above comment. I beleive it's the revert that is blocking this.

           

          Note: Review builds are also not allowed on build-servers because the do not support unshelving:

          p4 unshelve -f -s568 -cdefault
          
          Replica does not support this command.
          
          P4JAVA: Replica does not support this command.
          P4 Task: attempt: 1
          ERROR: P4: Task Exception: hudson.AbortException: P4JAVA: Error(s):
          P4JAVA: Replica does not support this command.
          

          Karl Wirth added a comment - Only just seen above comment. I beleive it's the revert that is blocking this.   Note: Review builds are also not allowed on build-servers because the do not support unshelving: p4 unshelve -f -s568 -cdefault Replica does not support this command. P4JAVA: Replica does not support this command. P4 Task: attempt: 1 ERROR: P4: Task Exception: hudson.AbortException: P4JAVA: Error(s): P4JAVA: Replica does not support this command.

            Unassigned Unassigned
            dspencer12 Daniel Spencer
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: