Re: Build Flow Plugin and SVN revision

2012-08-10 Thread Tomek Kaczanowski
ok, got it:

b = build( my-build )
out.println b.build.properties.environment['SVN_REVISION']


Re: Is it possible to reload a job configuration without restarting?

2012-08-10 Thread Christian Wolfgang
Thank you for your reply. Now I have some reading.

Preferably UI, but if I can do it programmatically it's ok.


On Thu, Aug 9, 2012 at 12:06 PM, Michaël Pailloncy mpapo@gmail.com wrote:
  A similar subject has been create :
 http://jenkins.361315.n4.nabble.com/Reload-Job-config-xml-programmatically-td4636146.html
 Your need is to reload it programmatically ? Or with the Jenkins UI ?



 2012/8/9 Christian Wolfgang c...@praqma.net

 Hi.

 Is it possible to reload a job configuration without restarting?
 I know, that I can reload all configurations, but I need to reload a
 specific job's configuration.

 Thanks

 Christian




NPE when adding/changing a TimerTrigger via groovy

2012-08-10 Thread Dirk Kuypers
Hi,

I am generating/changing lots of regression test jobs via groovy to
keep our build machines chewing during the night. Yesterday I had to
change some parameters in our jobs but the existing cron section
stayed the same. When diffing the config file it shows my changes, the
trigger section stayed the same. I did not restart Jenkins yesterday
evening and found that no job got scheduled during the night.

This is the error I got:
Aug 09, 2012 9:00:07 PM hudson.triggers.Trigger checkTriggers
WARNING: hudson.triggers.TimerTrigger.run() failed for XYZ_Tests
java.lang.NullPointerException
at hudson.triggers.TimerTrigger.run(TimerTrigger.java:53)
at hudson.triggers.Trigger.checkTriggers(Trigger.java:259)
at hudson.triggers.Trigger$Cron.doRun(Trigger.java:207)
at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)

When I re-edit the file by hand via Web UI and save, it works.

Trying if a Jenkins restart solves the problem is on my agenda, but
can not been done now.;-)

Is this problem known to some-one? Am I doing something wrong or Is
this worth a JIRA ticket?

BR
Dirk


Getting jenkins to restart using the proper `rc.d start jenkins` script which loads wrapper.conf

2012-08-10 Thread Calvin Cheng
Hello,

I have this problem for the longest time but never got around to fixing it 
until recently.

I am running jenkins on winstone with java wrapper.

In my wrapper.conf, we have set 8070 as the http port that our jenkins 
instance listens to.

When starting or restarting my jenkins instance manually from command line, 
e.g. rc.d start jenkins, everything works as expected and my instance is 
launched and bound to the 8070 port.

However, after I have installed a jenkins plugin and selected the go into 
automatic restart after plugin install, my jenkins instance gets started 
up on *port 32000*. I am not sure why this happens and everytime this 
happens, I have to - in command line - manually stop my jenkins instance 
and start it again.

Is there a configuration that I need to set to ensure that my jenkins - 
when restarted from its interface - uses the java wrapper service (which 
contains the correct port - 8070)?

I have also just posted up this question on stackoverflow so if you are an 
SO user, I am also tracking replies here - 
http://stackoverflow.com/questions/11886538/jenkins-restart-with-wrong-port-after-plugin-install

Thanks!
Calvin


Re: backup/restore publish over ssh servers

2012-08-10 Thread Brant Boehmann
Thanks! Worked perfect!

On Thu, Aug 9, 2012 at 7:55 PM, Christopher Orr ch...@orr.me.uk wrote:

 Hi there,


 On 08/09/2012 09:33 PM, Brant Boehmann wrote:

 I am using the publish over ssh plugin. I have roughly 100 different
 servers configured for various applications to get automatically
 deployed to in a development environment.
 We have outgrown our Jenkins environment and are configuring a new
 environment using EC2. I'd like to somehow export all the existing ssh
 server configuration from our current jenkins instance (v1.455) and
 import them into our new EC2 based jenkins server (v1.475).

 I do not want to simply override all of the new server configuration as
 we wanted to start fresh, but I do need to get the ssh servers moved over.


 The server configurations in your existing Jenkins instance should be
 stored in $JENKINS_HOME/org.jenkins-ci.**plugins.publish-over-ssh.xml

 You may be able to copy that file directly to your new installation.

 Regards,
 Chris



Re: Build step 'Execute Windows batch command' marked build as failure

2012-08-10 Thread j.barrett strausser
1. There is a single executor running on the machine. There is no issue
with multiple powershell sessions at the same time. It just creates a new
powershell process.

2.That path exists even when the script fails.

3. There isn't anything in the script that returns 2. The way that I
structure my powershell is to catch an unhandled exceptions in the
outermost catch I will set an exit code that is quite high, say 1500, I'll
return this as last exit code.


-barrett

On Thu, Aug 9, 2012 at 11:48 PM, Scott Evans milwrd...@gmail.com wrote:

 Grasping at straws here late at night -

 1. Do you have multiple builds running in separate agents at the same
 time, or just one agent active?  Do you have anything else running
 that might be using powershell at the same time?  I've not used it so
 I don't know how it works if you try and spawn multiple powershell
 sessions at the same time.

 2. It looks like you're calling
 C:\JenkinsHome\Slave\workspace\Job1\Job2\script.ps1 in a successful
 run.  Does that file/path exist in situations when it fails?  It seems
 a bit odd that it's Job1\Job2 in the path, but perhaps that is as
 intended.

 3. Is there anything within the powershell script itself (script.ps1)
 that might be returning an exit code of 2?  By default, from what
 Google is telling me, powershell defaults to returning either 0
 (success) or 1 (failure).  Unless I'm not finding accurate information
 (which is entirely possible), I'm wondering if something else is
 kicking it to a 2 exit code other than powershell itself.

 -Scott


 On Thu, Aug 9, 2012 at 10:21 PM, j.barrett strausser
 j.barrett.straus...@gmail.com wrote:
  Same box. A failed build tends to be followed by a successful build.
 Hence,
  I was thinking making there is some resource contention taking place.
 
  Again from my log snippet I really feel there is an issue spawning the
  powershell session.
 
  -barrett
 
  On Thu, Aug 9, 2012 at 11:10 PM, Scott Evans milwrd...@gmail.com
 wrote:
 
  Just a thought - are the successes and failures both running on the
  same agent box?  If not, then perhaps one is configured differently
  than the other.
 
  Scott
 
  On Thu, Aug 9, 2012 at 9:04 PM, j.barrett strausser
  j.barrett.straus...@gmail.com wrote:
   That's absolutely the reason it is being marked as failure. Jenkins
   interprets non-zero codes as failure. The question is why it exits
 with
   2 to
   begin with.
   The batch file is just wrapping a call to powershell but when it fails
   it
   appears to never even make the call to poweshell.
  
  
   On Thu, Aug 9, 2012 at 5:49 PM, Sami Tikka sjti...@gmail.com wrote:
  
   This is just a wild guess because I do not use windows: Could it be
   Jenkins aborts the build when it sees the exit 2 ?
  
   For Linux and Mac versions of Jenkins it is a sign of failure when a
   build
   script exits with non-zero exit code.
  
   -- Sami
  
   bearrito j.barrett.straus...@gmail.com kirjoitti 9.8.2012 kello
   20.59:
  
   Jenkins will randomly not execute batch files as part of the build.
  
   In the failing case I get a message like :
  
   18:01:43  C:\JenkinsHome\Slave\workspace\Job1exit 2
   18:01:44  Build step 'Execute Windows batch command' marked build as
   failure
  
  
   In the successful case I get
  
  
   11:40:37  C:\JenkinsHome\Slave\workspace\Job1lexit 0
   11:40:37  [SrcInfrastructureYellowSql] $ powershell.exe 
   'C:\Users\#Jenkins\AppData\Local\Temp\hudson5725866031798325048.ps1'
   11:40:53  [SrcInfrastructureYellowSql] $ cmd /c call
   C:\Users\#Jenkins\AppData\Local\Temp\hudson2668871926239131897.bat
   11:40:53
   11:40:53  C:\JenkinsHome\Slave\workspace\Job1powershell.exe 
   {C:\JenkinsHome\Slave\workspace\Job1\Job2\script.ps1; exit
   $lastexitcode}
  
  
   It seems as though the powershell session is not able to be started?
  
   Any hints on this?
  
  
  
  
 
 



RE: Immortal phantom build

2012-08-10 Thread William Soula
Is it possible to just delete the build?  I've seen builds from other jobs show 
up in a different job's list and since the build number was much higher it hid 
the test failures in the real build because it was the lastSuccessfulBuild due 
to the build number being so big.  I solved that problem by just deleting the 
offending build and it didn't affect the job the phantom build came from.  But 
you might not have the delete button since the phantom job is running.

-Original Message-
From: jenkinsci-users@googlegroups.com 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of Richard Bywater
Sent: Friday, August 10, 2012 12:36 AM
To: jenkinsci-users@googlegroups.com
Subject: Re: Immortal phantom build

I think the last few times that's happened to me its been memory related (e.g. 
out of PermGen). Think it spat some errors out to the Winstone wrapper.log.

Possibly not related to your issue but just in case...

Cheers
Richard.

On Fri, Aug 10, 2012 at 11:44 AM, Cliffano Subagio cliff...@gmail.com wrote:
 Hi,

 One of my Jenkins jobs is running (the job page showing a build in 
 progress), but the console output page only shows the spinning wheel 
 without anything else On the dashboard page, none of the executors is 
 running that job, all executors on all slaves are idle.

 I got the /threadDump output when it happened, nothing obvious that 
 screams error there.
 Any suggestion where else I should look to investigate what's causing 
 this problem?

 I can't stop that phantom job in progress, clicked the red x button 
 and the build stayed in progress.

 This is blocking the next build for the same job, which in turn blocks 
 my delivery pipeline.
 This happened few times before for the past few months, the workaround 
 was to restart the master, but it's obviously not our preference since 
 it takes a while to start back up.


 Cheers,
 Cliff.


Re: Issue getting RVM working

2012-08-10 Thread R. Tyler Croy

On Thu, 09 Aug 2012, de Herdt Arne wrote:

 Hello,
 
 I'm currently in the process of setting up a Jenkins instance on Debian to 
 have our team play around and see how we can work with Jenkins.
 I have configured a Ruby plan that is able to checkout the source from our 
 git, the problem is getting the ruby tests running. It keeps getting stuck on 
 RVM, and I have no idea what is going wrong.
 
 When I log in manually on the box, RVM etc is all working, but this is what I 
 get in the log output of the Jenkins project:


It sounds like you've not up RVM for the Jenkins user specifically. The script
is failing to find /var/lib/jenkins/.rvm/scripts/rvm, where
/var/lib/jenkins is the Jenkins user's home directory.


You might try sudo'ing to the `jenkins` user and installing RVM there


- R. Tyler Croy
--
Code: http://github.com/rtyler
 Chatter: http://twitter.com/agentdero
  rty...@jabber.org


signature.asc
Description: Digital signature


Re: Immortal phantom build

2012-08-10 Thread Cliffano Subagio
The weird thing is that all slaves were still working and I could build
other jobs, so if it's memory related issue, then it might affect that
particular phantom build.
The other problem is on identifying which slave is having the problem. I
checked the logs of each one, and didn't find any error.
Thanks for pointing it though, I'll keep an eye on memory usage.

Cheers,
Cliff.

On Fri, Aug 10, 2012 at 3:36 PM, Richard Bywater rich...@byh2o.com wrote:

 I think the last few times that's happened to me its been memory
 related (e.g. out of PermGen). Think it spat some errors out to the
 Winstone wrapper.log.

 Possibly not related to your issue but just in case...

 Cheers
 Richard.

 On Fri, Aug 10, 2012 at 11:44 AM, Cliffano Subagio cliff...@gmail.com
 wrote:
  Hi,
 
  One of my Jenkins jobs is running (the job page showing a build in
  progress), but the console output page only shows the spinning wheel
 without
  anything else
  On the dashboard page, none of the executors is running that job, all
  executors on all slaves are idle.
 
  I got the /threadDump output when it happened, nothing obvious that
 screams
  error there.
  Any suggestion where else I should look to investigate what's causing
 this
  problem?
 
  I can't stop that phantom job in progress, clicked the red x button and
 the
  build stayed in progress.
 
  This is blocking the next build for the same job, which in turn blocks my
  delivery pipeline.
  This happened few times before for the past few months, the workaround
 was
  to restart the master, but it's obviously not our preference since it
 takes
  a while to start back up.
 
 
  Cheers,
  Cliff.



Re: Immortal phantom build

2012-08-10 Thread Cliffano Subagio
Do you mean kill the build by deleting something directly on the filesystem?
I tried stopping the build (the red x icon next to the progress bar), but
it didn't do anything, phantom build kept going.

I wonder what's causing the job to think that there's a build running (job
page showing a running phantom build) when Jenkins itself doesn't
(dashboard page shows all executors being idle). Surely there's an endpoint
that displays the build status, perhaps the dashboard page is retrieving
the build status from a different endpoint to the job page's.

Cheers,
Cliff.

On Fri, Aug 10, 2012 at 11:54 PM, William Soula 
william.so...@drillinginfo.com wrote:

 Is it possible to just delete the build?  I've seen builds from other jobs
 show up in a different job's list and since the build number was much
 higher it hid the test failures in the real build because it was the
 lastSuccessfulBuild due to the build number being so big.  I solved that
 problem by just deleting the offending build and it didn't affect the job
 the phantom build came from.  But you might not have the delete button
 since the phantom job is running.

 -Original Message-
 From: jenkinsci-users@googlegroups.com [mailto:
 jenkinsci-users@googlegroups.com] On Behalf Of Richard Bywater
 Sent: Friday, August 10, 2012 12:36 AM
 To: jenkinsci-users@googlegroups.com
 Subject: Re: Immortal phantom build

 I think the last few times that's happened to me its been memory related
 (e.g. out of PermGen). Think it spat some errors out to the Winstone
 wrapper.log.

 Possibly not related to your issue but just in case...

 Cheers
 Richard.

 On Fri, Aug 10, 2012 at 11:44 AM, Cliffano Subagio cliff...@gmail.com
 wrote:
  Hi,
 
  One of my Jenkins jobs is running (the job page showing a build in
  progress), but the console output page only shows the spinning wheel
  without anything else On the dashboard page, none of the executors is
  running that job, all executors on all slaves are idle.
 
  I got the /threadDump output when it happened, nothing obvious that
  screams error there.
  Any suggestion where else I should look to investigate what's causing
  this problem?
 
  I can't stop that phantom job in progress, clicked the red x button
  and the build stayed in progress.
 
  This is blocking the next build for the same job, which in turn blocks
  my delivery pipeline.
  This happened few times before for the past few months, the workaround
  was to restart the master, but it's obviously not our preference since
  it takes a while to start back up.
 
 
  Cheers,
  Cliff.



My jenkins asks me to report here a possible bug

2012-08-10 Thread Francisco Alejandro Lozano López


ERROR: Processing failed due to a bug in the code. Please report this to 
jenkinsci-us...@googlegroups.comjava.lang.NullPointerException 
http://stacktrace.jenkins-ci.org/search?query=java.lang.NullPointerException  
at hudson.model.listeners.RunListener.all(RunListener.java:216) 
http://stacktrace.jenkins-ci.org/search/?query=hudson.model.listeners.RunListener.allentity=method
at 
hudson.model.listeners.RunListener.fireFinalized(RunListener.java:196) 
http://stacktrace.jenkins-ci.org/search/?query=hudson.model.listeners.RunListener.fireFinalizedentity=method
at hudson.model.Run.onEndBuilding(Run.java:1616) 
http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Run.onEndBuildingentity=method
at hudson.model.Run.execute(Run.java:1560) 
http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Run.executeentity=method
at hudson.maven.MavenBuild.access$600(MavenBuild.java:83) 
http://stacktrace.jenkins-ci.org/search/?query=hudson.maven.MavenBuild.access$600entity=method
at hudson.maven.MavenBuild$ProxyImpl2.close(MavenBuild.java:545) 
http://stacktrace.jenkins-ci.org/search/?query=hudson.maven.MavenBuild$ProxyImpl2.closeentity=method
at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:106) 
http://stacktrace.jenkins-ci.org/search/?query=hudson.maven.AbstractMavenBuilder.endentity=method
at 
hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:794)
 
http://stacktrace.jenkins-ci.org/search/?query=hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRunentity=method
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499) 
http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractBuildExecution.runentity=method
at hudson.model.Run.execute(Run.java:1488) 
http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Run.executeentity=method
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477) 
http://stacktrace.jenkins-ci.org/search/?query=hudson.maven.MavenModuleSetBuild.runentity=method
at hudson.model.ResourceController.execute(ResourceController.java:88) 
http://stacktrace.jenkins-ci.org/search/?query=hudson.model.ResourceController.executeentity=method
at hudson.model.Executor.run(Executor.java:236) 
http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Executor.runentity=method