[JIRA] (JENKINS-36911) Plugin does not work on Master / Slave Setup

9 views
Skip to first unread message

ebrahim.moshaya@cognitoiq.com (JIRA)

unread,
Jul 25, 2016, 6:34:01 AM7/25/16
to jenkinsc...@googlegroups.com
Ebrahim Moshaya created an issue
 
Jenkins / Bug JENKINS-36911
Plugin does not work on Master / Slave Setup
Issue Type: Bug Bug
Assignee: Rafael Pestano
Components: last-changes-plugin
Created: 2016/Jul/25 10:33 AM
Environment: Jenkins ver. 1.656
last-changes 1.0.1
Priority: Blocker Blocker
Reporter: Ebrahim Moshaya

This plugin does not work with Master / Slave Setup.... Only works with builds on master. If I run this with Master / Slave, I get the following error:ERROR: Build step failed with exception
java.lang.RuntimeException: No git or svn repository found at /var/lib/jenkins/workspace/Test/TestLastChangesPlugin
at com.github.jenkins.lastchanges.LastChangesPublisher.perform(LastChangesPublisher.java:109)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Build step 'Publish Last Changes' marked build as failure

It's clearly trying to look for that workspace on master and not the slave.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

rmpestano@gmail.com (JIRA)

unread,
Jul 25, 2016, 8:09:01 AM7/25/16
to jenkinsc...@googlegroups.com
Rafael Pestano commented on Bug JENKINS-36911
 
Re: Plugin does not work on Master / Slave Setup

Hi Ebrahim Moshaya,

looks like our slave test is not doing its job, I'll investigate ASAP.

ebrahim.moshaya@cognitoiq.com (JIRA)

unread,
Jul 25, 2016, 8:14:01 AM7/25/16
to jenkinsc...@googlegroups.com

Thanks Rafael, I really appreciate your help with this!

rmpestano@gmail.com (JIRA)

unread,
Jul 25, 2016, 10:18:01 AM7/25/16
to jenkinsc...@googlegroups.com
Rafael Pestano updated an issue
 
Change By: Rafael Pestano
Comment: Hi again [~emoshaya_cognitoiq],

I have just tested the plugin against a slave node and it seems to work. Can you share the complete execution log?

Also note that the plugin expects that your job does a *git clone* or *svn checkout* so it can read latest changes.

rmpestano@gmail.com (JIRA)

unread,
Jul 25, 2016, 10:18:01 AM7/25/16
to jenkinsc...@googlegroups.com

I have just tested the plugin against a slave node and it seems to work. Can you share the complete execution log?

Also note that the plugin expects that your job does a git clone or svn checkout so it can read latest changes.

rmpestano@gmail.com (JIRA)

unread,
Jul 25, 2016, 10:18:02 AM7/25/16
to jenkinsc...@googlegroups.com

ebrahim.moshaya@cognitoiq.com (JIRA)

unread,
Jul 25, 2016, 12:36:01 PM7/25/16
to jenkinsc...@googlegroups.com

Hi Rafael Pestano,

that is strange... I run the job which does a git clone on the master and it works successfully. However, Changing the job to execute on the slave with the exact same git configuration fails with the error I reported above... Not sure what to do beyond what is described in this Jira

ebrahim.moshaya@cognitoiq.com (JIRA)

unread,
Jul 25, 2016, 12:38:01 PM7/25/16
to jenkinsc...@googlegroups.com

Here is the job execution on the slave:

Started by user Ebrahim Moshaya
[EnvInject] - Loading node environment variables.
Building remotely on c4.8xlarge (i-3b25d6b7) (HighCPUMemoryBuilds linux c4.8xlarge centos) in workspace /var/lib/jenkins/workspace/Test/TestLastChangesPlugin
Cloning the remote Git repository
Cloning repository https://github.com/CognitoIQ/mobile-management-service.git
 > git init /var/lib/jenkins/workspace/Test/TestLastChangesPlugin # timeout=10
Fetching upstream changes from https://github.com/CognitoIQ/mobile-management-service.git
 > git --version # timeout=10
using .gitcredentials to set credentials
 > git config --local credential.username jenkins-cognito # timeout=10
 > git config --local credential.helper store --file=/tmp/git5901478933801406689.credentials # timeout=10
 > git -c core.askpass=true fetch --tags --progress https://github.com/CognitoIQ/mobile-management-service.git +refs/heads/*:refs/remotes/origin/*
 > git config --local --remove-section credential # timeout=10
 > git config remote.origin.url https://github.com/CognitoIQ/mobile-management-service.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url https://github.com/CognitoIQ/mobile-management-service.git # timeout=10
Fetching upstream changes from https://github.com/CognitoIQ/mobile-management-service.git
using .gitcredentials to set credentials
 > git config --local credential.username jenkins-cognito # timeout=10
 > git config --local credential.helper store --file=/tmp/git4493221226708420022.credentials # timeout=10
 > git -c core.askpass=true fetch --tags --progress https://github.com/CognitoIQ/mobile-management-service.git +refs/heads/*:refs/remotes/origin/*
 > git config --local --remove-section credential # timeout=10
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 1cf6b4e590239fdfc94286b5a2d90b81636a6001 (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 1cf6b4e590239fdfc94286b5a2d90b81636a6001
First time build. Skipping changelog.
ERROR: Build step failed with exception
java.lang.RuntimeException: No git or svn repository found at /var/lib/jenkins/workspace/Test/TestLastChangesPlugin
	at com.github.jenkins.lastchanges.LastChangesPublisher.perform(LastChangesPublisher.java:109)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
	at hudson.model.Build$BuildExecution.post2(Build.java:185)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
	at hudson.model.Run.execute(Run.java:1763)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:410)
Build step 'Publish Last Changes' marked build as failure
[BFA] Scanning build for known causes...
[BFA] Found failure cause(s):
[BFA] Build Step Failure from category BuildStep
[BFA] Done. 0s
Collecting metadata...
Metadata collection done.
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Finished: FAILURE

rmpestano@gmail.com (JIRA)

unread,
Jul 25, 2016, 12:55:04 PM7/25/16
to jenkinsc...@googlegroups.com

No problem we will figure it out.

I have tested it on windows and started the agent via webstart on the same machine, here is my console output:

Iniciado pelo usuário admin
Construindo remotamente em slave-test no workspace C:\Users\rafael-pestano\workspace\teste
 > git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git.exe config remote.origin.url https://github.com/jenkinsci/last-changes-plugin # timeout=10
Fetching upstream changes from https://github.com/jenkinsci/last-changes-plugin
 > git.exe --version # timeout=10
 > git.exe -c core.askpass=true fetch --tags --progress https://github.com/jenkinsci/last-changes-plugin +refs/heads/*:refs/remotes/origin/*
 > git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
 > git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision d13656b1a85833d1fe3f343ebe3369bc70277fb3 (refs/remotes/origin/master)
 > git.exe config core.sparsecheckout # timeout=10
 > git.exe checkout -f d13656b1a85833d1fe3f343ebe3369bc70277fb3
 > git.exe rev-list d13656b1a85833d1fe3f343ebe3369bc70277fb3 # timeout=10
Publishing build last changes...
Last changes published successfully!
Finished: SUCCESS

Note that agent workspace is on C:\Users\rafael-pestano\workspace\teste directory.

here is when the build is done on master:

Iniciado pelo usuário admin
Construindo no master no workspace C:\Users\rafael-pestano\.jenkins\workspace\teste
 > git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git.exe config remote.origin.url https://github.com/jenkinsci/last-changes-plugin # timeout=10
Fetching upstream changes from https://github.com/jenkinsci/last-changes-plugin
 > git.exe --version # timeout=10
 > git.exe -c core.askpass=true fetch --tags --progress https://github.com/jenkinsci/last-changes-plugin +refs/heads/*:refs/remotes/origin/*
 > git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
 > git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision d13656b1a85833d1fe3f343ebe3369bc70277fb3 (refs/remotes/origin/master)
 > git.exe config core.sparsecheckout # timeout=10
 > git.exe checkout -f d13656b1a85833d1fe3f343ebe3369bc70277fb3
 > git.exe rev-list d13656b1a85833d1fe3f343ebe3369bc70277fb3 # timeout=10
Publishing build last changes...
Last changes published successfully!
Finished: SUCCESS

master workspace is on C:\Users\rafael-pestano\.jenkins\workspace\teste directory.

I've tested on latest jenkins (2.13). I will test on linux as soon I get home and also try to run agent on a different machine.

rmpestano@gmail.com (JIRA)

unread,
Jul 25, 2016, 1:17:01 PM7/25/16
to jenkinsc...@googlegroups.com

Hi Daniel Beck and Oleg Nenashev,

Any idea why this code is failing to read slave workspace in some cases?

Thanks in advance.

dbeck@cloudbees.com (JIRA)

unread,
Jul 25, 2016, 4:31:01 PM7/25/16
to jenkinsc...@googlegroups.com

Rafael Pestano All code is executed on the master unless explicitly wrapped in a callable and sent to the slave over the remoting channel. If you want to work with files on the slave, use FilePath methods, those automatically work on slaves. File won't.

Example: workspace.child(".git").exists()

Learn more: https://wiki.jenkins-ci.org/display/JENKINS/Making+your+plugin+behave+in+distributed+Jenkins

rmpestano@gmail.com (JIRA)

unread,
Jul 25, 2016, 7:58:01 PM7/25/16
to jenkinsc...@googlegroups.com

rmpestano@gmail.com (JIRA)

unread,
Jul 25, 2016, 8:07:01 PM7/25/16
to jenkinsc...@googlegroups.com
Rafael Pestano started work on Bug JENKINS-36911
 
Change By: Rafael Pestano
Status: Open In Progress

rmpestano@gmail.com (JIRA)

unread,
Jul 25, 2016, 8:32:01 PM7/25/16
to jenkinsc...@googlegroups.com
Rafael Pestano edited a comment on Bug JENKINS-36911
Thank you very much [~danielbeck].

[~emoshaya_cognitoiq], can you test with latest snapshot? it is available here: http://maven.jenkins-ci.org:8081/content/repositories/snapshots/org/jenkins-ci/plugins/last-changes/1.0.2-SNAPSHOT/last-changes-1.0.2-
20160725 20160726 . 235345 002612 - 1 2 .hpi

(JIRA)

unread,
Jul 25, 2016, 10:36:01 PM7/25/16
to jenkinsc...@googlegroups.com
Anonymous updated Bug JENKINS-36911
 
Change By: Anonymous
Status: In Progress Review

ebrahim.moshaya@cognitoiq.com (JIRA)

unread,
Jul 26, 2016, 4:10:01 AM7/26/16
to jenkinsc...@googlegroups.com
Ebrahim Moshaya commented on Bug JENKINS-36911
 
Re: Plugin does not work on Master / Slave Setup

Hi Rafael Pestano I just tested your snapshot and it now works with Master / Slave setup. Thank you very much for this!

dbeck@cloudbees.com (JIRA)

unread,
Jul 26, 2016, 5:20:01 AM7/26/16
to jenkinsc...@googlegroups.com

rmpestano@gmail.com (JIRA)

unread,
Jul 26, 2016, 5:37:01 AM7/26/16
to jenkinsc...@googlegroups.com
Rafael Pestano resolved as Fixed
Change By: Rafael Pestano
Status: In Progress Resolved
Resolution: Fixed

rmpestano@gmail.com (JIRA)

unread,
Jul 26, 2016, 5:37:05 AM7/26/16
to jenkinsc...@googlegroups.com
Rafael Pestano commented on Bug JENKINS-36911
 
Re: Plugin does not work on Master / Slave Setup

Thank you for your feedback, 1.0.2 should be released soon.

ebrahim.moshaya@cognitoiq.com (JIRA)

unread,
Jul 26, 2016, 8:07:01 AM7/26/16
to jenkinsc...@googlegroups.com

Hi @rmpestano again. Sorry but I have bad news. Your snapshot worked fine with freestyle projects. But I just tested a Maven project and a MultiJob Project https://wiki.jenkins-ci.org/display/JENKINS/Multijob+Plugin and unfortunately I'm getting the same issue as last time in that it can't find the .git directory in the workspace even though it's there.

Publishing build last changes...
ERROR: Last Changes NOT published due to the following error: Source '/var/lib/jenkins/workspace/PGS/RealTimeMessaging/RTM-ME-Provider/RTM-ME-Provider-Pipeline/.git' does not exist

rmpestano@gmail.com (JIRA)

unread,
Jul 26, 2016, 8:19:01 AM7/26/16
to jenkinsc...@googlegroups.com

Hi Ebrahim Moshaya, can you confirm that It is working for freestyle projects in master/slave setup?

I will investigate it.

rmpestano@gmail.com (JIRA)

unread,
Jul 26, 2016, 8:35:01 AM7/26/16
to jenkinsc...@googlegroups.com
Rafael Pestano edited a comment on Bug JENKINS-36911
Hi [~emoshaya_cognitoiq], can you confirm that It is working for freestyle projects in master/slave setup?

I will investigate
it maven projects .

rmpestano@gmail.com (JIRA)

unread,
Jul 26, 2016, 8:51:02 AM7/26/16
to jenkinsc...@googlegroups.com

For me it still works with maven builds in master slave but I'm on a windows box here.

I suspect it is a permission issues cause the if statement at [1] passes for you but looks like it is failling to copy to master workspace on [2].

The only strange thing to me is that it works for freestyle projecs.

[1] https://github.com/jenkinsci/last-changes-plugin/blob/5eaf771e9ffb0d613ab1ed9723a973f2e319c874/src/main/java/com/github/jenkins/lastchanges/LastChangesPublisher.java#L103
[2] https://github.com/jenkinsci/last-changes-plugin/blob/5eaf771e9ffb0d613ab1ed9723a973f2e319c874/src/main/java/com/github/jenkins/lastchanges/LastChangesPublisher.java#L116

rmpestano@gmail.com (JIRA)

unread,
Jul 26, 2016, 8:51:03 AM7/26/16
to jenkinsc...@googlegroups.com

rmpestano@gmail.com (JIRA)

unread,
Jul 26, 2016, 8:57:01 AM7/26/16
to jenkinsc...@googlegroups.com
Rafael Pestano edited a comment on Bug JENKINS-36911
For me it still works with maven builds in master slave but I'm on a windows box here.

I suspect it is a permission issues cause the if statement at [1] passes for you but looks like it is failling to copy to master workspace on [2] (probably because of the new File() ;( ) .

rmpestano@gmail.com (JIRA)

unread,
Jul 26, 2016, 10:39:01 AM7/26/16
to jenkinsc...@googlegroups.com

ebrahim.moshaya@cognitoiq.com (JIRA)

unread,
Jul 26, 2016, 6:33:01 PM7/26/16
to jenkinsc...@googlegroups.com
Ebrahim Moshaya updated an issue
 
Change By: Ebrahim Moshaya
Attachment: screenshot-1.png

ebrahim.moshaya@cognitoiq.com (JIRA)

unread,
Jul 26, 2016, 6:35:01 PM7/26/16
to jenkinsc...@googlegroups.com
Ebrahim Moshaya commented on Bug JENKINS-36911
 
Re: Plugin does not work on Master / Slave Setup

Hi Rafael Pestano, your latest snapshot works with Maven projects now only if we checkout or do a git clone from the root of the Workspace. However, if we use git's additional behaviors "Check out to a sub-directory" as we have setup in our maven builds.

Then the plugin cannot locate the git repo because the clone is in a directory in the WORKSPACE.... Can't your plugin do a recursive check of the .git directory from $WORKSPACE?

java.lang.RuntimeException: No git or svn repository found at /var/lib/jenkins/workspace/Test/TestLastChangesPlugin-Maven
at com.github.jenkins.lastchanges.LastChangesPublisher.perform(LastChangesPublisher.java:103)


at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)

at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1047)


at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)

at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)


at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)

rmpestano@gmail.com (JIRA)

unread,
Jul 26, 2016, 7:15:02 PM7/26/16
to jenkinsc...@googlegroups.com
Rafael Pestano stopped work on Bug JENKINS-36911
 
Change By: Rafael Pestano
Resolution: Fixed
Status: In Progress Open

rmpestano@gmail.com (JIRA)

unread,
Jul 26, 2016, 7:15:02 PM7/26/16
to jenkinsc...@googlegroups.com
Rafael Pestano resolved as Fixed
Change By: Rafael Pestano
Status: Open Resolved
Resolution: Fixed

rmpestano@gmail.com (JIRA)

unread,
Jul 26, 2016, 7:15:02 PM7/26/16
to jenkinsc...@googlegroups.com

rmpestano@gmail.com (JIRA)

unread,
Jul 26, 2016, 7:25:01 PM7/26/16
to jenkinsc...@googlegroups.com
Rafael Pestano commented on Bug JENKINS-36911
 
Re: Plugin does not work on Master / Slave Setup

Hi Ebrahim Moshaya, I think it is possible to support sub directories, I've created an issue for this: https://issues.jenkins-ci.org/browse/JENKINS-36971.

Thanks for your feedback.

Reply all
Reply to author
Forward
0 new messages