Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-19581

Unable to export repositories with pull requests that have resolved comments

XMLWordPrintable

      Issue Summary

      When exporting repositories via `POST <bitbucket_url>/rest/api/1.0/migration/exports`, if the repository contains pull requests with resolved comments where the resolver_id is `null`, the export fails. 

      Note: This behaviour was introduced in BB 8.19.6. BB 8.19.5 is not affected.

      Steps to Reproduce

      1. Create a resolved comment on a pull request
      2. Modify the resolver_id to be null in the database e.g.:
      update bb_comment_thread set resolver_id = null where id='62';
      commit; 

            3. Run an export for this repository via POST <bitbucket_url>/rest/api/1.0/migration/exports

      Expected Results

      Export completes successfully with resolved status

      Actual Results

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

      2024-08-21 14:34:32,906 INFO  [dc-migration:thread-1] admin @ADMOHIx874x85x0 0:0:0:0:0:0:0:1 "POST /rest/api/1.0/migration/exports HTTP/1.1" c.a.s.i.m.DefaultExportService Export job '82' has started.
      2024-08-21 14:35:33,375 ERROR [dc-migration:thread-1] admin @ADMOHIx874x85x0 0:0:0:0:0:0:0:1 "POST /rest/api/1.0/migration/exports HTTP/1.1" c.a.s.i.m.DefaultExportContext Error registered for job 82 of type com.atlassian.bitbucket.migration.export (RUNNING) against pr: PROJECT_1/rep_1[1]#1: Exception executing callback 'export' on 'class com.atlassian.stash.internal.migration.entity.pull.PullRequestExporter': 'Cannot invoke "com.atlassian.stash.internal.user.InternalApplicationUser.getId()" because the return value of "com.atlassian.stash.internal.comment.InternalCommentThread.getResolver()" is null'
      java.lang.NullPointerException: Cannot invoke "com.atlassian.stash.internal.user.InternalApplicationUser.getId()" because the return value of "com.atlassian.stash.internal.comment.InternalCommentThread.getResolver()" is null
      	at com.atlassian.stash.internal.migration.entity.comment.CommentThreadMetadata.<init>(CommentThreadMetadata.java:56)
      	at com.atlassian.stash.internal.migration.entity.comment.RootCommentMetadata.<init>(RootCommentMetadata.java:43)
      	at com.atlassian.stash.internal.migration.entity.pull.PullRequestCommentAddedActivityMetadata.<init>(PullRequestCommentAddedActivityMetadata.java:50)
      
      ...
      2024-08-21 14:35:33,382 INFO  [dc-migration:thread-1] admin @ADMOHIx874x85x0 0:0:0:0:0:0:0:1 "POST /rest/api/1.0/migration/exports HTTP/1.1" c.a.s.i.m.DefaultExportService Export job '82' has completed with errors. 

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

              95e5dd71de92 David Zhu (Inactive)
              ysun Yingran Sun
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: