Bamboo repository-stored specs scan fails with "ProcessTimeoutException: process timed out"

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

Summary

Bamboo repository-stored specs scan fails with "ProcessTimeoutException: process timed out".

Environment

This is seen in 8.2.4 with Bamboo Java specs but applies to all supported versions of Bamboo with Bamboo specs. This is observed in repository-stored specs with a large number of jobs or plans to publish in Bamboo.

Diagnosis

During the specs scan the following error will be shown in the logs of the failed Specs execution:

08-Sep-2022 14:58:52	Caused by: com.atlassian.utils.process.ProcessTimeoutException: process timed out

The following log entries can be found in <Bamboo-home>/logs/atlassian-bamboo.log file:

08-Sep-2022 14:58:52	Unable to scan repository BAM / BAM-tests (23199747) for Bamboo Specs
08-Sep-2022 14:58:52	com.atlassian.bamboo.repository.RepositoryException: Unable to scan repository BAM / BAM-tests (23199747) for Bamboo Specs
.....
08-Sep-2022 14:58:52	Caused by: com.atlassian.utils.process.ProcessTimeoutException: process timed out

Cause

There's a default/ hard coded timeout of 60 seconds for repository-stored specs operations in Bamboo. If the repository-stored specs size is big and consists of large number of jobs or plans, then Bamboo will take more time to publish those which result in timeout exception if the specs scan couldn't complete in default time of 60 seconds.

Solution

There is a system property bamboo.repository.stored.specs.timeout_seconds to set the timeout on commands executed in the repository stored specs feature. Increasing the default timeout by adding the bamboo.repository.stored.specs.timeout_seconds system property to the Bamboo JVM will fix the issue. Please follow the below steps:

If you run Bamboo as a Windows Service, the steps to configure the property are different. Please refer to Configuring your system properties | Windows service for details on how to add the property below to your Bamboo instance.


  1. Backup and edit the BAMBOO_INSTALL/bin/setenv.sh file.
  2. Add the following property to the JVM_SUPPORT_RECOMMENDED_ARGS line in the setenv file, replacing Time_valueinseconds with a value higher than 60(seconds) that meets your YAML Specs file needs: 

    -Dbamboo.repository.stored.specs.timeout_seconds=Time_valueinseconds
  3. For example: "-Dbamboo.repository.stored.specs.timeout_seconds=180"(the number is in seconds). This would give you 3 minutes instead of just one.

    setenv.sh
    #  Occasionally Atlassian Support may recommend that you set some specific JVM arguments.  You can use this variable below to do that.
    #
    : ${JVM_SUPPORT_RECOMMENDED_ARGS:="-Dbamboo.repository.stored.specs.timeout_seconds=180"}
    #
    #  Uncomment the line below to enable the Byteman agent.
  4. Restart Bamboo so the changes are reflected.
  5. You can double-check if the property has been picked up by Bamboo by going to Bamboo Administration > Overview > System information and looking for it in the Environment variables section:

  6. Run your Specs again and it should now succeed (as long as the Bamboo able to process the specs within the new value timeout set). 
Last modified on Mar 30, 2023

Was this helpful?

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