簡體   English   中英

無法使 Jenkins perforce 插件與 ssh 一起使用

[英]Not able to make Jenkins perforce plugin to work with ssh

我對 Jenkins 不太熟悉,但由於某種原因,我無法使 perforce 插件工作。 我將列出問題和我嘗試過的內容,以便更好地理解。

詹金斯版本 - 1.561

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

系統 - Ubuntu 10.04

問題:

在源代碼管理的項目詳細信息部分(當您嘗試配置新作業時),我收到“無法根據倉庫檢查工作區”錯誤。

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 管理工作區視圖”復選框來管理其視圖

客戶端視圖類型是具有以下映射的視圖映射:

//沙箱/srkamise/... //ialok_jenkins/srkamise/...

我在啟動 jenkins 之前加載了密鑰,並且 jenkins 進程以我的用戶身份運行(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_PIDSSH_AUTH_SOCKP4USERP4PORT環境參數。 (我確實在沒有 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

P4PORT 通常采用“hostname.port”形式。 例如:

workshop.perforce.com:1666

myserver.mycompany.net:2500

這里有一些文檔: http : //www.perforce.com/perforce/doc.current/manuals/cmdref/P4PORT.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM