Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Proofbuild using Perforce and Cleaning of workspace #2514

wayne-fmh-com ·
We have begun testing proofbuilds with Perforce and in a fresh clean state the proofbuilds work fine. What we are seeing is that if files have to be reverted because of change then an error is subsequently logged that some files are read only and then a cleaning of the workspace occurs. The files will normally be ReadOnly because we are using Perforce which always leaves files in a ReadOnly status. Possibly unique to our situation is that we utilize two Perforce repositories in our builds. The first repository gets the solution project, the physical Visual Studio solution file is then read to determine addtional project dependencies which are then used by the second repository.

Log Record error about trying to revert the file when it is ReadOnly. This .csproj file was changed by a previous builder and it would need to be reverted for this build.
8:17:08,648 [master>ProofBuild>PerforceCheckoutDependenciesWithProofBuild@MSQBLDNODE1:8811] WARN - Error while reverting local change.
java.lang.RuntimeException: java.io.IOException: Destination 'E:\QB\workspace\FMH\Proofs\rel10\Web\WCFSoapWeb\Shared\FMH.Shared.Domain\FMH.Shared.Domain\FMH.Shared.Domain.csproj' exists but is read-only

Log record showing that the workspace is going to be cleaned. Now at this point the solution that was checked out by the first repository is deleted from the workspace and the build will fail because the solution no longer exits.
08:17:08,648 [master>ProofBuild>PerforceCheckoutDependenciesWithProofBuild@MSQBLDNODE1:8811] WARN - Cleaning the workspace to make sure the checkout operation is not affected by above error.

What is the best method to resolve this issue? I could make the first step in the build delete everything so it always gets everything from Perforce but that seems inefficient. Another option would be to mark evertyhing as writable and the mark it back but that will make Perforce complain about clobber writing a file since it expects files to be ReadOnly.

Thanks
Wayne
  • replies 3
  • views 2772
  • stars 0
robinshen ADMIN ·
Can you please show me the full stack trace for this error?
wayne-fmh-com ·
Here is the full stack trace from the "read only" error.

15:21:36,450 WARN - Error while reverting local change.
java.lang.RuntimeException: java.io.IOException: Destination 'E:\QB\workspace\FMH\Proofs\rel10\Batch\DocGenBatch\Shared\FMH.Shared.Domain\FMH.Shared.Domain\FMH.Shared.Domain.csproj' exists but is read-only
at com.pmease.quickbuild.util.FileUtils.copyFile(FileUtils.java:334)
at com.pmease.quickbuild.repositorysupport.Repository.revertLocalChange(Repository.java:276)
at com.pmease.quickbuild.plugin.scm.perforce.PerforceRepository$$EnhancerByCGLIB$$4433f73c.CGLIB$revertLocalChange$65(<generated>)
at com.pmease.quickbuild.plugin.scm.perforce.PerforceRepository$$EnhancerByCGLIB$$4433f73c$$FastClassByCGLIB$$ebc4aac4.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:269)
at com.pmease.quickbuild.plugin.scm.perforce.PerforceRepository$$EnhancerByCGLIB$$4433f73c.revertLocalChange(<generated>)
at com.pmease.quickbuild.repositorysupport.Repository.checkout(Repository.java:206)
at com.pmease.quickbuild.plugin.scm.perforce.PerforceRepository$$EnhancerByCGLIB$$4433f73c.CGLIB$checkout$73(<generated>)
at com.pmease.quickbuild.plugin.scm.perforce.PerforceRepository$$EnhancerByCGLIB$$4433f73c$$FastClassByCGLIB$$ebc4aac4.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:269)
at com.pmease.quickbuild.plugin.scm.perforce.PerforceRepository$$EnhancerByCGLIB$$4433f73c.checkout(<generated>)
at com.pmease.quickbuild.plugin.basis.checkout.CheckoutStep.run(CheckoutStep.java:78)
at com.pmease.quickbuild.plugin.basis.checkout.CheckoutStep$$EnhancerByCGLIB$$6136875d.CGLIB$run$0(<generated>)
at com.pmease.quickbuild.plugin.basis.checkout.CheckoutStep$$EnhancerByCGLIB$$6136875d$$FastClassByCGLIB$$ad2f32ec.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:269)
at com.pmease.quickbuild.plugin.basis.checkout.CheckoutStep$$EnhancerByCGLIB$$6136875d.run(<generated>)
at com.pmease.quickbuild.stepsupport.Step.execute(Step.java:501)
at com.pmease.quickbuild.stepsupport.StepExecutionJob.executeStepAwareJob(StepExecutionJob.java:30)
at com.pmease.quickbuild.stepsupport.StepAwareJob.executeBuildAwareJob(StepAwareJob.java:47)
at com.pmease.quickbuild.BuildAwareJob.execute(BuildAwareJob.java:61)
at com.pmease.quickbuild.grid.GridJob.run(GridJob.java:78)
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.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Destination 'E:\QB\workspace\FMH\Proofs\rel10\Batch\DocGenBatch\Shared\FMH.Shared.Domain\FMH.Shared.Domain\FMH.Shared.Domain.csproj' exists but is read-only
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:651)
at com.pmease.quickbuild.util.FileUtils.copyFile(FileUtils.java:332)
... 29 more
15:21:36,450 WARN - Cleaning the workspace to make sure the checkout operation is not affected by above error.
robinshen ADMIN ·
Looks like the .csproj file is overwritten by second p4 checkout after QB applies the local change. While we will change this to make QB being able to overwrite readonly files in next patch release (should be available in one week), you may try below work arounds right now:
1. configure the p4 repository used by QB to turn on the "allwrite" option.
2. configure your two p4 repositories to not overwriting files each other. This can be done by editing the destination path defined in repository to not overlapping.