Errors getting changes for Perforce repository

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

Problem

Builds does not start and display the following error message in Bamboo:

Project - Plan › PROJ-PLAN-176 : Errors getting changes for PROJ-PLAN-176
(com.atlassian.bamboo.repository.RepositoryException : java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: Could not retrieve changelogs from perforce)
(19 Aug 2016, 9:56:53 AM)
View error details Clear error from log 

The following appears in the $BAMBOO_HOME/logs/atlassian-bamboo.log file:

2016-08-18 15:39:55,146 ERROR [3-DelayedChangeDetectionThread:pool-7-thread-1] [ChainExecutionManagerImpl] Errors getting changes for PROJ-PLAN-176
com.atlassian.bamboo.repository.RepositoryException: java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: Could not retrieve changelogs from perforce
    at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuildInternal(DefaultChangeDetectionManager.java:373)
    at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:261)
    at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:160)
    at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectAllChangesSinceLastBuild(DefaultChangeDetectionManager.java:126)
    at com.atlassian.bamboo.v2.trigger.ManualBuildDetectionAction.performDelayedChangeDetection(ManualBuildDetectionAction.java:173)
        ...
Caused by: java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: Could not retrieve changelogs from perforce
    at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:132)
    at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:88)
    at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:191)
    at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:176)
    at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectionChangesWithRetry(DefaultChangeDetectionManager.java:476)
    at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesAfterQuietPeriod(DefaultChangeDetectionManager.java:430)
    at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuildInternal(DefaultChangeDetectionManager.java:317)
    ... 33 more
Caused by: com.atlassian.bamboo.repository.RepositoryException: Could not retrieve changelogs from perforce
    at com.atlassian.bamboo.repository.perforce.PerforceManager.getChangeNumbersFromRevision(PerforceManager.java:478)
    at com.atlassian.bamboo.repository.perforce.PerforceRepository.collectChangesSinceLastBuild(PerforceRepository.java:155)
    at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager$1.call(DefaultChangeDetectionManager.java:481)
    at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager$1.call(DefaultChangeDetectionManager.java:477)
    at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:108)
    ... 39 more
Caused by: com.tek42.perforce.PerforceException: Unable to parse output for change numbers.  Output: Unicode server permits only unicode enabled clients.

    at com.tek42.perforce.parse.Changes.getChangeNumbersFrom(Changes.java:157)
    at com.atlassian.bamboo.repository.perforce.PerforceManager.getChangeNumbersFromRevision(PerforceManager.java:466)
    ... 43 more
Caused by: java.lang.NumberFormatException: For input string: "server"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:492)
    at java.lang.Integer.<init>(Integer.java:677)
    at com.tek42.perforce.parse.Changes.getChangeNumbersFrom(Changes.java:152)
    ... 44 more

Diagnosis

Diagnostic Steps

Add an additional environment variable in the Perforce repository configuration inside Bamboo of P4CHARSET=utf8 (For a complete list of valid P4CHARSET values, issue the command p4 help charset). This should fix the issue for that particular plan/repository.

Cause

For Perforce services operating in Unicode mode, P4CHARSET must either be set to auto or be set to some value (other than none) on user machines. If P4CHARSET is unset, but the service is operating in Unicode mode, Perforce applications return the following error message:

Unicode server permits only unicode enabled clients.

More information about this can also be found inside Perforce's website at the P4CHARSET page.

Workaround

The suggestion inside the Diagnostic Steps section will fix the problem for one repository. If updating every repository configuration is not an option, it is possible to update the setenv.sh file and have the setting applied across the entire Bamboo instance.

  1. Stop Bamboo Server.
  2. Open up the $BAMBOO_INSTALL/bin/setenv.sh file.
  3. Add the following to the file:

    export P4CHARSET=utf8
  4. Start Bamboo Server.

You should be able to checkout your Perforce repositories successfully after that.

 

Last modified on Aug 23, 2016

Was this helpful?

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