无法使用Jenkins的perforce插件同步源代码

时间:2015-07-07 19:02:48

标签: jenkins jenkins-plugins perforce jenkins-cli

我正在尝试从perforce同步我的源代码,使用Jenkins的perforce插件并且它失败了,这是控制台输出:

Started by user anonymous
Building in workspace /home/var/.jenkins/jobs/Perforce-Test/workspace
Using master perforce client: Perforce-Test
[workspace] $ /usr/bin/p4 workspace -o Perforce-Test
[workspace] $ /usr/bin/p4 login -a -p
[workspace] $ /usr/bin/p4 -P 5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX9 workspace -o Perforce-Test
Changing P4 Client View from:
//depot/perf/main/solution/... //Perforce-Test/perf/main/solution/...

Changing P4 Client View to: 
  //depot/perf/main/solution/Main-Code/... //Perforce-Test/perf/main/solution/Main-Code/...
Saving modified client Perforce-Test
[workspace] $ /usr/bin/p4 -P 5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX9 -s client -i
Last build changeset: 0
[workspace] $ /usr/bin/p4 -P 5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX9 changes -s submitted -m 1 //Perforce-Test/...
Failed to get last submitted changeset in the view, falling back to change counter. Error was: No output for: /usr/bin/p4 -P 5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX9 changes -s submitted -m 1 //Perforce-Test/... 
[workspace] $ /usr/bin/p4 -P 5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX9 counter change
[workspace] $ /usr/bin/p4 -P 5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX9 -s changes -s submitted //Perforce-Test/...@3691614,@3691663
Sync'ing workspace to changelist 3691663 (forcing sync of unchanged files).
[workspace] $ /usr/bin/p4 -P 5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX9 -s sync -f //Perforce-Test/...@3691663
Caught exception communicating with perforce. Errors encountered while force syncing: error: //Perforce-Test/...@3691663 - protected namespace - access denied.
com.tek42.perforce.PerforceException: Errors encountered while force syncing: error: //Perforce-Test/...@3691663 - protected namespace - access denied.

    at com.tek42.perforce.parse.Workspaces.syncTo(Workspaces.java:167)
    at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:1126)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1270)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531)
    at hudson.model.Run.execute(Run.java:1741)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:374)
ERROR: Unable to communicate with perforce. Errors encountered while force syncing: error: //Perforce-Test/...@3691663 - protected namespace - access denied.

Finished: FAILURE

我附上了我的工作屏幕截图。谁能让我知道可能是什么问题?这是我的用户的问题吗?当我尝试使用perforce视图客户端创建新工作区并同步最新代码时,使用相同的用户,它可以正常工作。

Perforce Job Screen Shot

1 个答案:

答案 0 :(得分:1)

错误消息:

//Perforce-Test/...@3691663 - protected namespace - access denied.

表示您没有权限尝试同步的文件。如果您使用的用户名是“anonymous”,如输出所示,请检查保护表以查看该用户是否拥有您尝试同步的文件的权限(如果有基于IP的保护,请检查它们建立机器的IP)。

如果您不确定此作业运行的Perforce用户名,快速测试方法可能是删除“Perforce-Test”客户端,因为看起来该插件会重新创建它(此时用户名)将显示在客户端的Owner字段中)。您还可以检查Perforce服务器的日志,以查看正在运行这些命令的用户。