(Self hosted) React-Native app can not send errors , Request status 403

Environment

How do you use Sentry?
Sentry SaaS

Which SDK and version?
React native 2.3.0 (We are on RN 0.63. We have recently ejected from expo into bare React Native project)

Steps to Reproduce

  1. Installed @sentry/react-native
  2. Ran sentry-wizard such as yarn sentry-wizard -i reactNative -p ios android -u <our sentry backend> Double checked that sentry.properties files are created and the values seem correct
  3. Implemented the library and tried to capture a message, and tried to throw an error
Sentry.init({
  dsn: 'https://a2e6ed83d64b4380a09af149e259aa4c@sentry.vation.dev/2',
  debug: true,
});

Sentry.captureMessage('Sentry message from the app');

///
    <Button
            onPress={() => {
              throw new Error('My first Sentry error!');
            }}
            title="Throw"
          />

Expected Result

I expect to see an event or an error on our SAAS dashboard

Actual Result

The dashboard is empty. Xcode console shows:

2021-03-17 14:13:15.642615+0100 VationApp[5529:2435292] Sentry - Debug:: Writing to file: /Users/basaryuksel/Library/Developer/CoreSimulator/Devices/555BF578-943E-42AB-B9B8-C7412F7D7316/data/Containers/Data/Application/7A481DC1-34BC-4620-B517-CA590E554D90/Library/Caches/io.sentry/9dd13dd1fa3a758d658c5c7ab67ee3b2ddbe4e5e/envelopes/1615986795.642566-00001-0C0BB758-3948-4398-BB45-F28290DDF5F1.json
2021-03-17 14:13:15.810878+0100 VationApp[5529:2435649] Sentry - Debug:: Request status: 403
2021-03-17 14:13:15.810986+0100 VationApp[5529:2435649] Sentry - Debug:: Queued requests: 0
2021-03-17 14:13:15.811389+0100 VationApp[5529:2435649] Sentry - Debug:: Header {"event_id":"54f02e8db0464252be078d163579a0a7","sdk":{"name":"sentry.javascript.react-native","version":"2.3.0"}}
2021-03-17 14:13:15.811497+0100 VationApp[5529:2435649] Sentry - Debug:: Item Header {"type":"event","length":1243}
2021-03-17 14:13:15.811607+0100 VationApp[5529:2435649] Sentry - Debug:: Event {"extra":{"componentStack":"[undefined]","jsEngine":"[undefined]"},"message":{"message":"Sentry message from the app"},"timestamp":1615986795.47,"release":"io.vation.VationApp@1.0.3+526","dist":"526","tags":{"event.origin":"javascript"},"sdk":{"version":"2.3.0","name":"sentry.javascript.react-native","packages":[{"version":"2.3.0","name":"npm:@sentry\/react-native"}]},"platform":"node","level":"info","contexts":{"app":{"app_id":"14E4492A-8424-3C08-8469-9B4AACB350D2","app_version":"1.0.3","build_type":"simulator","app_identifier":"io.vation.VationApp","app_build":"526","app_start_time":"2021-03-17T12:58:32Z","device_app_hash":"4a0908cd85443504d9ea600d319a68308baf8c74","app_name":"VationApp"},"device":{"simulator":true,"boot_time":"2021-03-13T14:16:35Z","model_id":"simulator","arch":"x86","free_memory":360763392,"model":"iPhone13,4","memory_size":17179869184,"family":"iOS","storage_size":499963174912,"timezone":"GMT+1","usable_memory":14193606656},"os":{"version":"14.4","rooted":false,"kernel_version":"Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1\/RELEASE_X86_64","name":"iOS","build":"19H2"}},"request":{"headers":{}},"environment":"production","event_id":"54f02e8db0464252be078d163579a0a7"}
2021-03-17 14:13:15.924788+0100 VationApp[5529:2435649] Sentry - Debug:: Request status: 403
2021-03-17 14:13:15.924897+0100 VationApp[5529:2435649] Sentry - Debug:: Queued requests: 0
2021-03-17 14:13:20.334297+0100 VationApp[5529:2435292] [native] Sending `didReceiveNetworkResponse` with no listeners registered.
2021-03-17 14:13:20.334795+0100 VationApp[5529:2435649] [native] Sending `didReceiveNetworkDataProgress` with no listeners registered.
2021-03-17 14:13:20.335500+0100 VationApp[5529:2433902] [javascript] Sending `didReceiveNetworkResponse` with no listeners registered.
2021-03-17 14:13:20.342769+0100 VationApp[5529:2433902] [javascript] Sending `didReceiveNetworkDataProgress` with no listeners registered.
1 Like

I have the same issue. Any update?
@Babazon did you solve this problem?

I’m confused. The title of the issue says self-hosted but on the description you mentioned SaaS (sentry.io).

I see the DSN isn’t sentry.io so I’ll assume self hosted. What version is it?
The latest version of the SDK requires Sentry version 20.06 or higher.

More on the docs: Migration for React Native | Sentry Documentation

From 1.x to 2.x

Sentry’s most recent version of our React Native SDK enables release health tracking and native stack traces by default.

This version of the SDK uses the envelope endpoint. If you are using self-hosted Sentry, the SDK requires Sentry version 20.6.0 and above. If you are using our SaaS product (sentry.io), no changes or actions needed.

1 Like