How to identify build results for variable that has a length greater than 4000

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

On Bamboo versions older than 7.1.1, the database might have issues with the length of the variable column of the build result table for PostgresSQL.

This is related to the bug below:

BAM-21059 - All VARIABLE_VALUE columns should use clob instead of varchar(4000)

Diagnosis

1 Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(4000)

This error suggests that there's a value in the source that is greater than 4000 characters which is the column size limit in PostgreSQL.

Information

This query identifies on build result the variable that has a length greater than 4000.

1 2 3 4 SELECT brs.BUILD_KEY, brs.BUILD_NUMBER, vc.VARIABLE_KEY from BUILDRESULTSUMMARY brs JOIN VARIABLE_CONTEXT vc on brs.BUILDRESULTSUMMARY_ID=vc.BUILDRESULTSUMMARY_ID where length(vc.VARIABLE_VALUE) >= 4000;

This query was tested against PostgresSQL. It might need to change it accordingly to your DBMS. 

In addition, the query below will return the variable type and size for the table VARIABLE_CONTEXT and row VARIABLE_VALUE. That way it can be compared to the other database table information that is being migrated to.

1 SELECT * FROM <DB-NAME>.INFORMATION_SCHEMA.COLUMNS ORDER BY TABLE_NAME

⚠️Replace <DB-NAME> accordingly to the Bamboo database name.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.