无法使Jenkins perforce插件与ssh一起工作

无法使Jenkins perforce插件与ssh一起工作,jenkins,perforce,jenkins-plugins,Jenkins,Perforce,Jenkins Plugins,我不太熟悉Jenkins,但由于某些原因,我无法使Performce插件正常工作。我将列出问题和我尝试过的方法,以便更好地理解 詹金斯版本-1.561 Perforce插件版本-1.3.27(我在Jenkins中配置了Perforce路径) 系统-Ubuntu 10.04 问题: 在源代码管理的项目详细信息部分(当您尝试配置新作业时),我收到“无法根据depot检查工作区”错误 我通过选中“让Jenkins创建工作区”和“让Jenkins管理工作区视图”复选框,让Jenkins创建工作区并管理其

我不太熟悉Jenkins,但由于某些原因,我无法使Performce插件正常工作。我将列出问题和我尝试过的方法,以便更好地理解

詹金斯版本-1.561

Perforce插件版本-1.3.27(我在Jenkins中配置了Perforce路径)

系统-Ubuntu 10.04

问题:

在源代码管理的项目详细信息部分(当您尝试配置新作业时),我收到“无法根据depot检查工作区”错误

我通过选中“让Jenkins创建工作区”和“让Jenkins管理工作区视图”复选框,让Jenkins创建工作区并管理其视图

客户端视图类型是具有以下映射的视图映射:

//沙盒/srkamise///我知道,詹金斯/斯卡米斯/

我在启动jenkins之前加载了密钥,jenkins进程以我的用户身份运行(我确定)

此外,我使用了envirect插件,并在“为运行准备环境”下添加了SSD\u AGENT\u PID、SSH\u AUTH\u SOCK、P4USER、P4PORT环境参数。(我在没有envInject的情况下尝试过,但遇到了同样的问题)

当我仔细检查p4可执行文件的路径以及项目映射和向我的环境添加密钥时,它看起来像是一些身份验证问题

以下是指示运行失败的日志文件:

Started by user anonymous
[EnvInject] - Loading node environment variables.
[EnvInject] - Preparing an environment for the build.
[EnvInject] - Keeping Jenkins system variables.
[EnvInject] - Keeping Jenkins build variables.
[EnvInject] - Injecting as environment variables the properties content 
P4CONFIG=.perforce
P4PORT=rsh:ssh -q -a -x -l p4ssh -q -x xxx.xxx.com /bin/true
P4USER=ialok
SSH_AGENT_PID=25752
SSH_AUTH_SOCK=/tmp/keyring-7GAS75/ssh

[EnvInject] - Variables injected successfully.
[EnvInject] - Injecting contributions.
Building in workspace /var/lib/jenkins/jobs/fin/workspace
Using master perforce client: ialok_jenkins
[workspace] $ /usr/bin/p4 workspace -o ialok_jenkins
Changing P4 Client Root to: /var/lib/jenkins/jobs/fin/workspace
Changing P4 Client View from:


Changing P4 Client View to: 
  //sandbox/srkamise/... //ialok_jenkins/srkamise/...
Saving new client ialok_jenkins
[workspace] $ /usr/bin/p4 -s client -i
Caught exception communicating with perforce.  TCP receive failed. read: socket: Connection reset by peer
For Command: /usr/bin/p4 -s client -i 
With Data:
===================
Client: ialok_jenkins
Description: 
Root: /var/lib/jenkins/jobs/fin/workspace
Options: noallwrite clobber nocompress unlocked nomodtime rmdir
LineEnd: local
View:
  //sandbox/srkamise/... //ialok_jenkins/srkamise/...


===================
com.tek42.perforce.PerforceException:  TCP receive failed. read: socket: Connection reset by peer
For Command: /usr/bin/p4 -s client -i 
With Data:
===================
Client: ialok_jenkins
Description: 
Root: /var/lib/jenkins/jobs/fin/workspace
Options: noallwrite clobber nocompress unlocked nomodtime rmdir
LineEnd: local
View:
  //sandbox/srkamise/... //ialok_jenkins/srkamise/...


===================

    at com.tek42.perforce.parse.AbstractPerforceTemplate.saveToPerforce(AbstractPerforceTemplate.java:270)
    at com.tek42.perforce.parse.Workspaces.saveWorkspace(Workspaces.java:77)
    at hudson.plugins.perforce.PerforceSCM.saveWorkspaceIfDirty(PerforceSCM.java:1787)
    at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:895)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1251)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
    at hudson.model.Run.execute(Run.java:1709)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:231)
ERROR: Unable to communicate with perforce.  TCP receive failed. read: socket: Connection reset by peer
For Command: /usr/bin/p4 -s client -i 
With Data:
===================
Client: ialok_jenkins
Description: 
Root: /var/lib/jenkins/jobs/fin/workspace
Options: noallwrite clobber nocompress unlocked nomodtime rmdir
LineEnd: local
View:
  //sandbox/srkamise/... //ialok_jenkins/srkamise/...


===================

Finished: FAILURE

端口的格式通常为“hostname.port”。例如:

workshop.perforce.com:1666

myserver.mycompany.net:2500

以下是一些文档:

尝试自己设置视图,不要让Jenkins控制它。它看起来像tek42包装器+一个rsh端口+读取STDIN(the-i命令)==pain。如果您自己管理客户机,则根本不需要运行带有-i标志的命令。看起来像是黑客,但我在这里对scm没有任何控制权。
Started by user anonymous
[EnvInject] - Loading node environment variables.
[EnvInject] - Preparing an environment for the build.
[EnvInject] - Keeping Jenkins system variables.
[EnvInject] - Keeping Jenkins build variables.
[EnvInject] - Injecting as environment variables the properties content 
P4CONFIG=.perforce
P4PORT=rsh:ssh -q -a -x -l p4ssh -q -x xxx.xxx.com /bin/true
P4USER=ialok
SSH_AGENT_PID=25752
SSH_AUTH_SOCK=/tmp/keyring-7GAS75/ssh

[EnvInject] - Variables injected successfully.
[EnvInject] - Injecting contributions.
Building in workspace /var/lib/jenkins/jobs/fin/workspace
Using master perforce client: ialok_jenkins
[workspace] $ /usr/bin/p4 workspace -o ialok_jenkins
Changing P4 Client Root to: /var/lib/jenkins/jobs/fin/workspace
Changing P4 Client View from:


Changing P4 Client View to: 
  //sandbox/srkamise/... //ialok_jenkins/srkamise/...
Saving new client ialok_jenkins
[workspace] $ /usr/bin/p4 -s client -i
Caught exception communicating with perforce.  TCP receive failed. read: socket: Connection reset by peer
For Command: /usr/bin/p4 -s client -i 
With Data:
===================
Client: ialok_jenkins
Description: 
Root: /var/lib/jenkins/jobs/fin/workspace
Options: noallwrite clobber nocompress unlocked nomodtime rmdir
LineEnd: local
View:
  //sandbox/srkamise/... //ialok_jenkins/srkamise/...


===================
com.tek42.perforce.PerforceException:  TCP receive failed. read: socket: Connection reset by peer
For Command: /usr/bin/p4 -s client -i 
With Data:
===================
Client: ialok_jenkins
Description: 
Root: /var/lib/jenkins/jobs/fin/workspace
Options: noallwrite clobber nocompress unlocked nomodtime rmdir
LineEnd: local
View:
  //sandbox/srkamise/... //ialok_jenkins/srkamise/...


===================

    at com.tek42.perforce.parse.AbstractPerforceTemplate.saveToPerforce(AbstractPerforceTemplate.java:270)
    at com.tek42.perforce.parse.Workspaces.saveWorkspace(Workspaces.java:77)
    at hudson.plugins.perforce.PerforceSCM.saveWorkspaceIfDirty(PerforceSCM.java:1787)
    at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:895)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1251)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
    at hudson.model.Run.execute(Run.java:1709)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:231)
ERROR: Unable to communicate with perforce.  TCP receive failed. read: socket: Connection reset by peer
For Command: /usr/bin/p4 -s client -i 
With Data:
===================
Client: ialok_jenkins
Description: 
Root: /var/lib/jenkins/jobs/fin/workspace
Options: noallwrite clobber nocompress unlocked nomodtime rmdir
LineEnd: local
View:
  //sandbox/srkamise/... //ialok_jenkins/srkamise/...


===================

Finished: FAILURE
workshop.perforce.com:1666

myserver.mycompany.net:2500