Errors getting changes for Perforce repository

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

Summary

Problem

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

1 2 3 4 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:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 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:

1 Unicode server permits only unicode enabled clients.

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

Solution

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:

    1 export P4CHARSET=utf8
  4. Start Bamboo Server.

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

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.