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

When Importing external repositories, the username placed in the logs is not necessarily the user who performed the import

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Low
    • 5.0.0
    • 4.13.0
    • None
    • None

    Description

      Please consider improving the logs that are written when there is an error importing an external git repository.

      A user recently entered an URL that was unreachable from the Bitbucket Server. There error message in the logs was

      2017-03-15 14:30:31,817 DEBUG \[pool-6-thread-6] USERNAME_X@somedomain.com @1QOQFXAx1185x347398x0 1i21hy1 999.999.999.999,10.20.300.1 "POST /rest/importer/latest/projects/<PROJ_SLUG>/import/repos HTTP/1.1" c.a.bitbucket.scm.BaseCommand Executed /usr/bin/git \-c gc.auto=0 fetch \-\-force \-\-prune \-\-progress http://<USERNAME>@<SOMEURL>/<PATH>/<REPO>.git \+refs/\*:refs/\*\\ com.atlassian.bitbucket.scm.CommandFailedException: '/usr/bin/git \-c gc.auto=0 fetch \-\-force \-\-prune \-\-progress http://<USERNAME>@<SOMEURL>/<PATH>/<REPO>.git \+refs/\*:refs/\*' exited with code 128 saying: fatal: unable to access 'http://<USERNAME>@<SOMEURL>/<PATH>/<REPO>.git/': Could not resolve host: SOMEURL
      

      The Problem is, USERNAME_X was not the person who was performing the import. The import was being performed by USERNAME_A who is in a completely different department.

      Turns out though that USERNAME_X was likely the first person to have performed a completely different import of a completely different external repository several days earlier, and after a Bitbucket server restart.

      Working with support, the response from development was:

      When you're on a thread pool thread (which [pool-6-thread-6] is), you generally can't "trust" the username. Quite often, that username was captured when that pool thread was first created and is never updated after that

      If this is the case, an individual username should have never been attributed to the thread and some internal identifier, or no username at all would be preferable to using an incorrect name

      Please consider improving the information that is written to the logs so that activities are not incorrectly attributed to the wrong user.

      Attachments

        Activity

          People

            fdoherty@atlassian.com Frank Doherty
            cdrummond Craig Drummond
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: