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

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

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 - Getting issue details... STATUS

Diagnosis

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.

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.

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

(warning)Replace <DB-NAME> accordingly to the Bamboo database name.

Last modified on Oct 29, 2021

Was this helpful?

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