Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-17628

Import into Oracle DB fail when there is truncated data for FAILURE_REASON in MERGE_RESULT table

    XMLWordPrintable

Details

    Description

      Summary

      Import into Oracle fail when there is truncated data for FAILURE_REASON in MERGE_RESULT table.

      Steps to Reproduce

      1. Setup Bamboo using HSQLDB
      2. Create a plan with auto merge enabled in its branch plan
      3. Replicate a conflict merge so that the git error message has more than 4000 characters.
      4. Run the branch plan. The build should fail with a long failure reason in Branch Integration Details
      5. Create a export with the build results
      6. Import the export into a instance connected to Oracle DB

      Expected Results

      Import successful as the failure reason message should have been truncated as per the fix -BAM-12128-

      Actual Results

      The below exception is thrown in the atlassian-bamboo.log file:

      2016-05-31 15:31:22,472 ERROR [http-nio-8085-exec-7] [JDBCExceptionReporter] ORA-01461: can bind a LONG value only for insert into a LONG column
      

      Notes

      • Possible that the horizontal ellipsis character that is added after data truncation is stored as more than 1 byte in the DB.
      • Error only occurs in Oracle DB. Import works for MySQL db.
      • is stored as 3 bytes in the database. MySQL returns a length of 3 but a char_length of 1 for . However, this value is only accurate if the query from the columns. length("…") returns 1.

       

      • Check if VARCHAR2 columns in Oracle database have length defined in characters and not bytes, e.g. the MERGE_RESULT.FAILURE_REASON should have:
      "FAILURE_REASON" VARCHAR2(4000 CHAR)

      Workaround

      1. Stop Bamboo
      2. Edit the database and remove any occurrence of (\u2026 in HSQLDB) in the merge_result table
        Always take a dump or backup of the database before attempting manual edit
      3. Perform the export

      Attachments

        Issue Links

          Activity

            People

              mgardias Marcin Gardias
              dlee@atlassian.com Deric Lee (Inactive)
              Votes:
              3 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: