Perforce builds fail due to special character in the client view

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

All Perforce builds end with the following error:

1 2 3 4 java.util.NoSuchElementException at java.util.StringTokenizer.nextToken(Unknown Source) at com.tek42.perforce.parse.AbstractPerforceTemplate.parseList(AbstractPerforceTemplate.java:62) at com.tek42.perforce.parse.Workspaces.getWorkspaceList(Workspaces.java:39)

Cause

Issue was due to a carraige character in the client view. As a result, Bamboo was unable to parse the output of p4 clients command. For example:

1 2 3 4 5 Client sr:VISTA-SANDEEP:LabOperations:rc_2.0.0 2011/04/19 root C:R&DPerforcep4dev.symyx.com_1666sr_SandeepLOI elease c_2.0.0 'Autogenerated clientspec. ' Client sr:VISTA-SANDEEP:NotebookStoryTests:rc_6.6.0 2010/10/07 root C:ProjectNotebook 'Autogenerated clientspec. ' Client sr_Sandeep 2011/02/21 root C:/R&D/Perforce/p4dev.symyx.com_1666/sr_Sandeep 'Created by sr. '

Resolution

We've made the parsing to be more defensive against special characters, but if you do encounter this error we recommend changing the client view to omit the carriage return character.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.