Adding details.hasMoreTokens() at line 136 may fix it - I have not checked it of course.

Change By: Ajay Kanade (04/Sep/12 9:02 PM)
Environment: Perforce  2007  2010 .2
Description: Versions are:
Jenkins ver. 1.466.1
Perforce Plugin: 1.3.17

The  Hudson  perforce plug-in is currently throwing exceptions for any changelists which  contain  have jobs attached but *do not* have any  " reserved closed or fixed "  text in the changelist description  status associated .   This appears

I checked the code and seems like there is one more case
 to be  introduced  checked (<-- below):

// Line looks like:
// EXT-84 on 2007/09/25
 by  the p4v client when creating changelist descriptions  mwille *closed*
// or
// EXT-84 on 2007/09/25 *closed*
// or
// EXT-84 on 2007/09/25
// or
// EXT-84 on 2007/09/25 by mwille   <-- The new case

Adding details
.   Here is an example of a changelist which contains the problem hasMoreTokens  ( i ) at line 136 *may* fix it - I have not checked it of course . e. containing "Jobs fixed ..." in

Exception thrown by
 the  changelist description)  plugin is :

===== begin
 output of "p4 describe -s 470718  =====
[xyz] $ p4 describe -s 51820
Caught exception communicating with perforce. Failed to retrieve changelist.
Response from perforce was:
Change  470718  51820  by  someuser  me @ someclient my_workspace  on  2010  2012 / 10 09 / 01 15 05 04 : 32 31 : 59 37

        Additional logic for org assoc validations at doc import time. jenkins test

        Jobs fixed ...

Jobs fixed ...

SDRLS98139
job000162  on  2010  2012 / 10 08 / 01 25  by  pdbugs *closed*  p4dtguser

Test it thoroughly. 

Affected files ...

... //
depotxyz Main / fileabc Tools/bar.txt # 6 17  edit
====== end output of "p4 describe -s 470718 ======
com.tek42.perforce.PerforceException: Failed to retrieve changelist.
In this case, the Hudson Response from  perforce  plug-in fails and throws an exception  was :

18
Change 51820 by me@my_workspace on 2012/09/05 04 : 16 31 : 46  [5 37

jenkins test

Jobs fixed
. 5_Continuous_Build] $ ..

job000162 on 2012
 / usr 08 / local/bin/p4 describe -s 470718 25 by p4dtguser
18:16:46  Caught exception communicating with perforce
Test it thoroughly
.  Failed to retrieve changelist  

Affected files
. com . tek42 . perforce

. PerforceException: Failed to retrieve changelist . . //Main/Tools/bar.txt#17 edit
18:16:46

   at com.tek42.perforce.parse.ChangelistBuilder.build(ChangelistBuilder.java: 185 207 )
18:16:46    at com.tek42.perforce.parse.Changes.getChangelist(Changes.java: 63 71 )
18:16:46    at com.tek42.perforce.parse.Changes.getChangelistsFromNumbers(Changes.java: 381 433 )
18:16:46    at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java: 552 924 )
18:16:46    at hudson.model.AbstractProject.checkout(AbstractProject.java: 1082 1226 )
18:16:46    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java: 479 586 )
18:16:46    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java: 411 475 )
18:16:46    at hudson.model.Run.run(Run.java: 1273 1438 )
18:16:46    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
18:16:46    at hudson.model.ResourceController.execute(ResourceController.java:88)
18:16:46    at hudson.model.Executor.run(Executor.java: 137 239 )
18:16:46   Caused by: java.util.NoSuchElementException
18:16:46    at java.util.StringTokenizer.nextToken( StringTokenizer.java:332 Unknown Source )
18:16:46    at com.tek42.perforce.parse.ChangelistBuilder.build(ChangelistBuilder.java: 120 136 )
18:16:46    ... 10 more

The problem exists because the StringTokenizer used inside the ChangelistBuilder class also considers tabs as a delimiter when parsing the output of the "p4 describe" command
ERROR: Unable to communicate with perforce .   This means that the parser is incapable of using the indenting provided by the "p4 describe" output  Failed  to  distinguish between keywords generated by the Perforce server and keyword text that is part of the  retrieve  changelist  description .
Response from perforce was:

Steps to reproduce
Change 51820 by me@my_workspace on 2012/09/05 04 : 31:37
1)  Create a changelist which contains "
jenkins test

Jobs fixed ... " within the changelist description
2)  Create a Hudson job which syncs from Perforce  (i
job000162 on 2012/08/25 by p4dtguser

Test it thoroughly
. e. Poll SCM)

When the job attempts to obtain changelist information for the changelist which contains "Jobs fixed Affected files  ... " in the changelist description, it will throw an exception and will fail to advance to the next changelist

.   This effectively causes the job to continually fail at the same point, unable to obtain information about subsequent changelists . . //Main/Tools/bar.txt#17 edit

===== end =====

Thanks.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to