Unable to Add a Label to an Attachment

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

Symptoms

The following appears in the atlassian-confluence.log:

1 2 3 2014-07-04 14:12:16,842 ERROR [http-apr-8080-exec-10] [confluence.ui.rest.LoggingExceptionMapper] toResponse Exception while processing REST request: Hibernate operation: could not insert: [com.atlassian.confluence.labels.Labelling#37289987]; SQL []; Column 'CONTENTID' cannot be null; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'CONTENTID' cannot be null

Solution

In this case, labeling does not mean the label table. It means the content_label table.

Resolution

  • Please ensure that you backup your database before making any modifications

  • Run the following query against the database:

    1 alter table content_label modify contentid bigint(20) null ;

    ⚠️ If you are unsure of the database connection parameters, refer to How to find Confluence's database connection parameters.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.