Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-36946

Database Constraint Checker has mismatched definitions for expected non-nullable and actual nullable

    XMLWordPrintable

Details

    Description

      This bug report relates to warnings logged by the Database Constraint Checker which was introduced in Confluence 5.7.

      Cause

      This particular warning occurs because there is a column in the database which should not allow null values, but does.

      This warning has been encountered on these columns:

      • content_label.labelid
      • logininfo.username
      • confversion.buildnumber
      • content_perm.cp_type
      • trustedapp.public_key_id

      These warnings appear in the logs:

      Column [labelid] of table [content_label] has mismatched definitions for expected [Column content_label.labelid int8 non-nullable] and actual [Column content_label.labelid int8(19) nullable]
      
      Column [username] of table [logininfo] has mismatched definitions for expected [Column logininfo.username varchar(255) non-nullable] and actual [Column logininfo.username varchar(255) nullable]
      
      Column [buildnumber] of table [confversion] has mismatched definitions for expected [Column confversion.buildnumber int4 non-nullable] and actual [Column confversion.buildnumber int4(10) nullable]
      
      Column [cp_type] of table [content_perm] has mismatched definitions for expected [Column content_perm.cp_type varchar(10) non-nullable] and actual [Column content_perm.cp_type varchar(10) nullable]
      
      Column [public_key_id] of table [trustedapp] has mismatched definitions for expected [Column trustedapp.public_key_id int8 non-nullable] and actual [Column trustedapp.public_key_id int8(19) nullable]
      

      Impact

      When Confluence retrieves information from these columns, it expects a real value. If your database allows null values in these columns, you could end up with inconsistent data in the database that can cause other problems later on, eg during upgrades, or during general use. Usually these will manifest in the form of NullPointerExceptions.

      Resolution

      In many cases these warnings can be ignored. Often, Confluence's code will also be null-safe, which means that it may never attempt to enter a null into these columns. However, there is always a risk of data becoming inconsistent through bugs or manual changes, and these constraints help to guard against that.

      To resolve these warnings, you will need to change the schema of your database to specify that each column should be non-nullable. The way you would achieve this varies across each database system, so refer to the official documentation for your database.

      NB: If there are any nulls in this column already, those rows will need to be removed/cleaned before you can achieve this. Please feel free to contact Support for help with this.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dunterwurzacher Denise Unterwurzacher [Atlassian] (Inactive)
              Votes:
              7 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated: