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

Adding a new file while resolving a merge conflict causes a 500 error when that file is opened in Bitbucket Server

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Low
    • None
    • 4.6.1, 4.6.2
    • None

    Description

      Summary

      If a new file is created and added in the same commit where a merge conflict is being resolved, that new file will fail to open in the browser. Attempting to open the file returns a 500 error to the user, and generates a NullPointerException in the logs.

      Steps to Reproduce

      1. Attempt to merge a branch on the command line that will generate a merge conflict.
      2. Create a new file.
      3. git add the file(s) containing conflicts to resolve the conflict.
      4. git add the new file.
      5. Commit the changes.
      6. Push the changes.
      7. Navigate to the repository in the browser, and open the newly created file.

      Expected Results

      The contents of the file are displayed.

      Actual Results

      The user receives a 500 error in the browser.
      The below exception is thrown in the atlassian-bitbucket.log file:

      2016-05-31 15:32:19,930 WARN  [http-nio-7990-exec-7] smaruvada @3H8VA8x932x688x0 10mi4n 192.168.10.1 "GET /projects/META/repos/puppets/browse/crash2 HTTP/1.1" c.a.s.i.w.s.f.AvatarUrlFunction Error getting avatar URL for null
      java.lang.NullPointerException: person
      	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:226) ~[guava-18.0.jar:na]
      	at com.atlassian.stash.internal.avatar.ConfigurableAvatarService.getUrlForPerson(ConfigurableAvatarService.java:199) ~[bitbucket-service-impl-4.6.1.jar:na]
      	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) ~[atlassian-plugins-core-4.1.8.jar:na]
      	at com.atlassian.stash.internal.web.soy.functions.AvatarUrlFunction.getUrl(AvatarUrlFunction.java:80) [classes/:na]
      	at com.atlassian.stash.internal.web.soy.functions.AvatarUrlFunction.apply(AvatarUrlFunction.java:67) [classes/:na]
      	at com.atlassian.stash.internal.web.soy.functions.AvatarUrlFunction.apply(AvatarUrlFunction.java:23) [classes/:na]
      	at com.atlassian.soy.impl.modules.SoyJavaFunctionAdapter.computeForJava(SoyJavaFunctionAdapter.java:34) [soy-template-plugin-4.3.0.jar:na]
      

      Notes

      This case was tested by multiple customers in version 4.3.2, and the issue did not exist.

      Workaround

      1. Commit new files in a separate commit from the merge commit. One customer has merge commits already imported from a forked repository, however, and cannot use this workaround.
      2. Create a new commit for all the files that are inaccessible. The files will be accessible after pushing this commit.

      Attachments

        1. atlassian-bitbucket-debug.log
          29 kB
        2. error.png
          error.png
          132 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              smaruvada Shashank Maruvada
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: