Inital Scan of Perforce Repository Fails with A NumberFormatException

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

An error occurs for the same revision even if the scan is restarted:

2008-07-24 10:21:14,826 DEBUG [pool-2-thread-1] fisheye.app P4Process-finish - Exception processing command c:\program files\perforce\p4.exe -p <host>:1666 -u <username> -ztag changes -l //depot/...@10,210
java.lang.NumberFormatException: For input string: "comment blah comment more comment"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
	at java.lang.Long.parseLong(Long.java:403)
	at java.lang.Long.parseLong(Long.java:461)
	at com.cenqua.fisheye.perforce.client.P4Client$3.processGroup(P4Client.java:115)
	at com.cenqua.fisheye.perforce.client.P4Exec$6.processLine(P4Exec.java:328)
	at com.cenqua.fisheye.perforce.client.P4OutputLineProcessor.processOutput(P4OutputLineProcessor.java:36)
	at com.cenqua.fisheye.perforce.client.P4Exec$4.processOutput(P4Exec.java:186)

Diagnosis

Diagnostic Steps

  1. Run the following command outside of Fisheye:

    c:\program files\perforce\p4.exe -p <host>:1666 -u <username> -ztag changes -l //depot/...@10,210
    


    An output similar to below will be produced:

     	... change 100
     	... time 1124169874
     	... user parthak
     	... client ATLASSIAN
     	... status submitted
     	... desc Some description ba, bla, blah
     	... change comment
     	blah comment more comment
    
  2. Run the same command without the -ztagparameter:

    c:\program files\perforce\p4.exe -p <host>:1666 -u <username> changes -l //depot/...@10,210
    


    The command above will produce the following output:

     	Change 100 on 2005/08/15 by parthak@ATLASSIAN
    
     	Some description ba, bla, blah
     	... change comment
     	blah comment more comment
    

Notice the comment has the following "... change" String.

Cause

Fisheye sends the -ztag parameter to perforce and processes the output. The "... change" string is usually followed by a revision number, but in the case above it is included in the comment and followed by some comments. When Fisheye tries to process the result, it throws a NumberFormatException because it was actually given a string while expecting for a numerical result.

Resolution

Modify the comment to remove the "... change" string or modify it to prevent it from being processed.

For the case above, run the command below and modify the comment:

c:\program files\perforce\p4.exe -p <host>:1666 -u <username> change -f 100

Last modified on Jul 31, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.