无法使Jenkins perforce插件与ssh一起使用 [英] Not able to make Jenkins perforce plugin to work with ssh

查看:78
本文介绍了无法使Jenkins perforce插件与ssh一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am not quite familiar with Jenkins but for some reason I am not able to make the perforce plugin to work. I will list down the problem and what I have tried so as to get a better understanding.

Jenkins版本-1.561

Jenkins Version - 1.561

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

Perforce Plugin Version - 1.3.27 (I have perforce path configured in Jenkins)

系统-Ubuntu 10.04

System - Ubuntu 10.04

问题:

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

In the Source Code Management's Project Details section ( when you try to configure a new job ) I get "Unable to check workspace against depot" error.

P4PORT(hostname:port) - rsh:ssh -q -a -x -l p4ssh -q -x xxx.xxx.com /bin/true
Username              - ialok
Password              - N.A (Connection to SCM is via key authentication so left it blank)
Workspace(client)     - ialok_jenkins

我让Jenkins通过选中让Jenkins创建工作空间" 让Jenkins管理工作空间视图"

I let Jenkins create workspace and manage its view by checking the checkbox for both "Let Jenkins Create Workspace" and "Let Jenkins Manage Workspace View"

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

Client View Type is a View Map with the following mapping:

//sandbox/srkamise/...//ialok_jenkins/srkamise/...

//sandbox/srkamise/... //ialok_jenkins/srkamise/...

在启动jenkins之前,我已经加载了密钥,并且jenkins进程以我的用户(ialok)的身份运行

I have the keys loaded prior to starting jenkins and the jenkins process runs as my user (ialok)

~$ ps aux | grep jenkins
ialok    16608  0.0  0.0  14132   552 ?        Ss   11:08   0:00 /usr/bin/daemon --name=ialok --inherit --env=JENKINS_HOME=/var/lib/jenkins --output=/var/log/jenkins/jenkins.log --pidfile=/var/run/jenkins/jenkins.pid -- /usr/bin/java -Djava.awt.headless=true -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1
ialok    16609  1.0 13.9 1448716 542156 ?      Sl   11:08   1:04 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1

此外,我使用了 envInject 插件和正在为运行准备环境" 我添加了 SSD_AGENT_PID SSH_AUTH_SOCK P4USER P4PORT 环境参数. (我确实在没有envInject的情况下尝试过,但遇到了同样的问题)

Additionally, I used envInject plugin and "Under Prepare an environment for the run" I added SSD_AGENT_PID, SSH_AUTH_SOCK, P4USER, P4PORT environment parameters. (I did try without envInject but faced the same issue)

在我仔细检查了p4可执行文件的路径以及项目映射和环境密钥的添加之后,似乎出现了一些身份验证问题.

It looks like some authentication problem as I double checked the path to p4 executable along with the project mapping and addition of keys to my environment.

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

Here is the log file indicating a failed run:

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

推荐答案

P4PORT通常为'hostname.port'形式.例如:

The P4PORT typically is of the form 'hostname.port'. Examples would be:

workshop.perforce.com:1666

myserver.mycompany.net:2500

以下是一些文档: http://www.perforce. com/perforce/doc.current/manuals/cmdref/P4PORT.html

这篇关于无法使Jenkins perforce插件与ssh一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆