getsentry / sentry-react-native

Official Sentry SDK for React Native
https://sentry.io
MIT License
1.56k stars 333 forks source link

Expo iOS dsym upload failed: POST /api/0/projects/xxx/xxx/files/dsyms/ not found #3674

Closed csvan closed 6 months ago

csvan commented 6 months ago

OS:

Platform:

SDK:

SDK version: 5.19.1 (Expo 50)

react-native version: 0.73.4

Are you using Expo?

Are you using sentry.io or on-premise?

If you are using sentry.io, please post a link to your issue so we can take a look:

[Link to issue]

Configuration:

(@sentry/react-native)

Sentry.init({
  beforeSend: (event) => {
    event.tags = {
      ...(event.tags || {}),
      app: 'my-app',
    };
    return event;
  },
  dsn: 'https://xxx@xxx',
});

I have the following issue:

When enabling the Sentry plugin for Expo in order to get dsyms and other debug data uploaded during EAS builds, as per the documentation, builds start failing with the below error. Using Sentry itself in Metro when developing locally works without issue.

We are using on-prem Sentry 24.2.0

Android builds are still working without issue, but it is unclear if they actually upload anything (no debug files or the like are found in the project, but I suppose that is a separate issue)

Steps to reproduce:

Actual result:

build fails with the following error in EAS xcode logs (snipped and somewhat redacted to remove identifiable details - assume that other parts in the log threw no errors to this point):

Batch 1
> Compressing 2 debug symbol files
> Uploading debug symbol files
  DEBUG   2024-03-08 11:44:15.605126 -08:00 request POST https://onprem.domain/api/0/projects/xxx/xxx/files/dsyms/
  DEBUG   2024-03-08 11:44:15.605137 -08:00 using token authentication
  DEBUG   2024-03-08 11:44:15.605141 -08:00 sending form data
  DEBUG   2024-03-08 11:44:15.605143 -08:00 retry number 0, max retries: 0
  DEBUG   2024-03-08 11:44:15.605344 -08:00 > POST /api/0/projects/xxx/xxx/files/dsyms/ HTTP/1.1
  DEBUG   2024-03-08 11:44:15.605350 -08:00 > Host: onprem.domain
  DEBUG   2024-03-08 11:44:15.605352 -08:00 > Accept: */*
  DEBUG   2024-03-08 11:44:15.605354 -08:00 > Connection: TE
  DEBUG   2024-03-08 11:44:15.605356 -08:00 > TE: gzip
  DEBUG   2024-03-08 11:44:15.605357 -08:00 > User-Agent: sentry-cli/2.25.2
  DEBUG   2024-03-08 11:44:15.605372 -08:00 > Authorization: Bearer xxx***
  DEBUG   2024-03-08 11:44:15.605374 -08:00 > Content-Length: 3388239
  DEBUG   2024-03-08 11:44:15.605391 -08:00 > Content-Type: multipart/form-data; boundary=------------------------e32f6d304f45a45c
  DEBUG   2024-03-08 11:44:16.608242 -08:00 < HTTP/1.1 404 Not Found
  DEBUG   2024-03-08 11:44:16.608298 -08:00 < Content-Type: text/plain
  DEBUG   2024-03-08 11:44:16.608302 -08:00 < Content-Length: 151
  DEBUG   2024-03-08 11:44:16.608305 -08:00 < Connection: keep-alive
  DEBUG   2024-03-08 11:44:16.608307 -08:00 < Date: Fri, 08 Mar 2024 19:44:16 GMT
  DEBUG   2024-03-08 11:44:16.608310 -08:00 < server: nginx
  DEBUG   2024-03-08 11:44:16.608315 -08:00 < vary: Accept-Language, Cookie, accept-encoding
  DEBUG   2024-03-08 11:44:16.608317 -08:00 < content-language: en
  DEBUG   2024-03-08 11:44:16.608320 -08:00 < x-frame-options: deny
  DEBUG   2024-03-08 11:44:16.608322 -08:00 < x-content-type-options: nosniff
  DEBUG   2024-03-08 11:44:16.608324 -08:00 < x-xss-protection: 1; mode=block
  DEBUG   2024-03-08 11:44:16.608327 -08:00 < content-security-policy-report-only: default-src 'none'; script-src 'self' 'unsafe-inline' 'report-sample'; img-src blob: data: *; object-src 'none'; font-src 'self' data:; base-uri 'none'; style-src 'unsafe-inline' *; connect-src 'self' *.algolia.net *.algolianet.com *.algolia.io; frame-ancestors 'none'; media-src *
  DEBUG   2024-03-08 11:44:16.608330 -08:00 < cache-control: max-age=0
  DEBUG   2024-03-08 11:44:16.608332 -08:00 < location: 
  DEBUG   2024-03-08 11:44:16.608339 -08:00 < X-Cache: Error from cloudfront
  DEBUG   2024-03-08 11:44:16.608341 -08:00 < Via: 1.1 688e3f09a2447eda2ae46655f5644a34.cloudfront.net (CloudFront)
  DEBUG   2024-03-08 11:44:16.608343 -08:00 < X-Amz-Cf-Pop: ORD53-C2
  DEBUG   2024-03-08 11:44:16.608345 -08:00 < Alt-Svc: h3=":443"; ma=86400
  DEBUG   2024-03-08 11:44:16.608347 -08:00 < X-Amz-Cf-Id: WTEHXRfEeQTPFBvYWdcNZxrSp81UmAmugWCKUI_ntRwNEHmNk-TQjg==
  DEBUG   2024-03-08 11:44:16.608361 -08:00 response status: 404
  DEBUG   2024-03-08 11:44:16.608365 -08:00 body: Route not found, did you forget a trailing slash?

try: /api/0/projects/xxx/xxx/files/dsyms/

Expected result:

build should go green and dsyms should be properly uploaded

krystofwoldrich commented 6 months ago

Hi @csvan, thank you for the message, I see you also opened https://github.com/getsentry/self-hosted/issues/2873, so I will close this issue as a duplicate. The error is a back-end issue not related to RN.

The Android build doesn't upload native debug symbols out of the box, only JS source maps.

For iOS, you can allow failure for the dsyms upload to unblock your builds and only upload JS like this.

export SENTRY_CLI_DEBUG_FILES_UPLOAD_EXTRA_ARGS="--allow-failure"

https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/#configure-automatic-debug-symbols-upload