self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

duplicate release cannot be shown or deleted

Open fnep opened this issue 1 year ago • 13 comments

Environment

self-hosted (https://develop.sentry.dev/self-hosted/)

Steps to Reproduce

Unfortunately, i don't know how, but i managed to create the same release twice.

Now if i try to open the release details in the web interface (do delete it for example), i get a 500 error from the backend.

Deleting the release via cli is also only showing it gets a 500 error.

Expected Result

The release should be shown and i should be able to delete it (or better both). I should not be able to add it twice.

Actual Result

from the cli (sentry-cli releases delete v5.1.1-dev-162-g69352048c1)

  DEBUG   2024-06-13 19:58:59.176088 +02:00 sentry-cli version: 2.20.1, platform: "darwin", architecture: "arm64"
  INFO    2024-06-13 19:58:59.176213 +02:00 sentry-cli was invoked with the following command line: "/Users/fnk/XXXXXX/Development/YYYYY/html/node_modules/@sentry/cli/sentry-cli" "--auth-token=XXX" "--log-level=DEBUG" "releases" "delete" "v5.1.1-dev-162-g69352048c1"
  DEBUG   2024-06-13 19:58:59.176342 +02:00 request DELETE https://sentry.internal.XXXXXX.de/api/0/projects/XXXXXX/YYYYY/releases/v5.1.1-dev-162-g69352048c1/
  DEBUG   2024-06-13 19:58:59.176356 +02:00 using token authentication
  DEBUG   2024-06-13 19:58:59.176362 +02:00 retry number 0, max retries: 0
  DEBUG   2024-06-13 19:58:59.430232 +02:00 > DELETE /api/0/projects/XXXXXX/YYYYY/releases/v5.1.1-dev-162-g69352048c1/ HTTP/1.1
  DEBUG   2024-06-13 19:58:59.430254 +02:00 > Host: sentry.internal.XXXXXX.de
  DEBUG   2024-06-13 19:58:59.430258 +02:00 > Accept: */*
  DEBUG   2024-06-13 19:58:59.430260 +02:00 > Connection: TE
  DEBUG   2024-06-13 19:58:59.430263 +02:00 > TE: gzip
  DEBUG   2024-06-13 19:58:59.430265 +02:00 > User-Agent: sentry-cli/2.20.1
  DEBUG   2024-06-13 19:58:59.430490 +02:00 > Authorization: Bearer sntryu_f***
  DEBUG   2024-06-13 19:58:59.648018 +02:00 < HTTP/1.1 500 Internal Server Error
  DEBUG   2024-06-13 19:58:59.648043 +02:00 < Server: nginx
  DEBUG   2024-06-13 19:58:59.648052 +02:00 < Date: Thu, 13 Jun 2024 17:58:59 GMT
  DEBUG   2024-06-13 19:58:59.648058 +02:00 < Content-Type: application/json
  DEBUG   2024-06-13 19:58:59.648064 +02:00 < Content-Length: 72
  DEBUG   2024-06-13 19:58:59.648070 +02:00 < Connection: keep-alive
  DEBUG   2024-06-13 19:58:59.648076 +02:00 < Allow: GET, PUT, DELETE, HEAD, OPTIONS
  DEBUG   2024-06-13 19:58:59.648082 +02:00 < Access-Control-Allow-Methods: GET, PUT, DELETE, HEAD, OPTIONS
  DEBUG   2024-06-13 19:58:59.648097 +02:00 < Access-Control-Allow-Headers: X-Sentry-Auth, X-Requested-With, Origin, Accept, Content-Type, Authentication, Authorization, Content-Encoding, sentry-trace, baggage, X-CSRFToken
  DEBUG   2024-06-13 19:58:59.648104 +02:00 < Access-Control-Expose-Headers: X-Sentry-Error, X-Sentry-Direct-Hit, X-Hits, X-Max-Hits, Endpoint, Retry-After, Link
  DEBUG   2024-06-13 19:58:59.648110 +02:00 < Access-Control-Allow-Origin: *
  DEBUG   2024-06-13 19:58:59.648115 +02:00 < Vary: Accept-Language, Cookie
  DEBUG   2024-06-13 19:58:59.648121 +02:00 < Content-Language: en
  DEBUG   2024-06-13 19:58:59.648126 +02:00 < X-Frame-Options: deny
  DEBUG   2024-06-13 19:58:59.648532 +02:00 < X-Content-Type-Options: nosniff
  DEBUG   2024-06-13 19:58:59.648539 +02:00 < X-XSS-Protection: 1; mode=block
  DEBUG   2024-06-13 19:58:59.648547 +02:00 < Content-Security-Policy-Report-Only: worker-src 'none'; connect-src 'self' *.algolia.net *.algolianet.com *.algolia.io; font-src 'self' data:; script-src 'self' 'unsafe-inline' 'report-sample'; frame-ancestors 'none'; object-src 'none'; style-src 'unsafe-inline' *; default-src 'none'; base-uri 'none'; media-src *; img-src blob: data: *
  DEBUG   2024-06-13 19:58:59.648554 +02:00 < Strict-Transport-Security: max-age=63072000
  DEBUG   2024-06-13 19:58:59.648577 +02:00 response status: 500
  DEBUG   2024-06-13 19:58:59.648585 +02:00 body: {"detail":"Internal Error","errorId":"8b4d079ab8fe49389bc4204f2a302270"}
error: API request failed
  caused by: sentry reported an error: request failure (http status: 500)
  Object {"detail": String("Internal Error"), "errorId": String("8b4d079ab8fe49389bc4204f2a302270")}

in the logs when accessing the webinterface or when deleting via cli:

Traceback (most recent call last):
  File "/usr/src/sentry/src/sentry/api/base.py", line 320, in handle_exception
    response = super().handle_exception(exc)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/.venv/lib/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/usr/src/sentry/src/sentry/api/base.py", line 453, in dispatch
    response = handler(request, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/sentry/src/sentry/api/endpoints/project_release_details.py", line 165, in delete
    release = Release.objects.get(
              ^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.11/site-packages/django/db/models/manager.py", line 87, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.11/site-packages/django/db/models/query.py", line 652, in get
    raise self.model.MultipleObjectsReturned(
sentry.models.release.Release.MultipleObjectsReturned: get() returned more than one Release -- it returned 2!
17:58:59 [INFO] sentry.access.api: api.access (method='DELETE' view='sentry.api.endpoints.project_release_details.ProjectReleaseDetailsEndpoint' response=500 user_id='2' is_app='False' token_type='api_token' is_frontend_request='False' organization_id='1' auth_id='None' path='/api/0/projects/XXXXXX/YYYYY/releases/v5.1.1-dev-162-g69352048c1/' caller_ip='192.168.69.2' user_agent='sentry-cli/2.20.1' rate_limited='False' rate_limit_category='None' request_duration_seconds=0.09113454818725586 rate_limit_type='DNE' concurrent_limit='None' concurrent_requests='None' reset_time='None' group='None' limit='None' remaining='None' token_last_characters='216a')
17:58:59 [ERROR] django.request: Internal Server Error: /api/0/projects/XXXXXX/YYYYY/releases/v5.1.1-dev-162-g69352048c1/ (status_code=500 request=<WSGIRequest: DELETE '/api/0/projects/XXXXXX/YYYYY/releases/v5.1.1-dev-162-g69352048c1/'>)

Product Area

Releases

Link

No response

DSN

No response

Version

24.5.1

fnep avatar Jun 13 '24 18:06 fnep