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

Bitbucket Get tag API gives empty response body on 404

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 9.4.8, 9.4.11
    • API - REST
    • None

      Issue Summary

      Bitbucket Get tag API isn't behaving as expected, the API returns a 404 status code without the expected JSON response when the tag doesn't exist. As per our API docs, the 404 should be returned when "The specified tag does not exist", but that's not happening and there's an empty response in case the tag doesn't exist.

      Steps to Reproduce

      1. Created a tag called release-tag.
      2. Ran the below API for a tag that doesn't exist:
        curl -I -u admin --request GET \
          --url 'https://{baseurl}/projects/FIR/repos/avengers-repo/tags/new-tag' \
          --header 'Accept: application/json;charset=UTF-8'
        Enter host password for user 'admin':
        HTTP/1.1 404
        Date: Mon, 22 Sep 2025 06:02:16 GMT
        Transfer-Encoding: chunked
        Connection: keep-alive
        Set-Cookie: INGRESSCOOKIE=9b7d1ee375fc7c3677f0f6b1b6e59071|720acc58e4038854b40f095cb766f636; Path=/; HttpOnly
        X-AREQUESTID: @1SU4UN1x362x7573x0
        X-AUSERID: 2
        X-AUSERNAME: admin
        Cache-Control: no-cache, no-transform
        Vary: X-AUSERNAME
        Vary: X-AUSERID
        Vary: Cookie
        X-Content-Type-Options: nosniff 

        "-I" is to get the response code. Notice that the response code is 404 but the response body is empty.

      Expected Results

      If the tag doesn't exist, the GET query should return 404 with "The specified tag does not exist. in the response body

      Actual Results

      The GET query returns 404 but an empty response body.

      Workaround

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

              Unassigned Unassigned
              04f11a9d4cc8 Apoorva
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: