sentry-react-native: NoSuchKeyException: stacktrace getNullableValue

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

Output of node -v && npm -v && npm ls --prod --depth=0

v10.7.0
6.4.1
├── @expo/react-native-action-sheet@1.1.2
├── @ptomasroos/react-native-multi-slider@0.0.14
├── date-fns@1.29.0
├── emoji-mart-native@0.3.0-beta
├── fbemitter@2.1.1
├── formik@1.3.0
├── hoist-non-react-statics@1.2.0
├── idx@2.4.0
├── intl@1.2.5
├── path-match@1.2.4
├── path-to-regexp@2.4.0
├── prop-types@15.6.2
├── query-string@4.3.4
├── react@16.5.0
├── UNMET PEER DEPENDENCY react-native@0.57.1
├── react-native-action-button@2.8.5
├── react-native-button@2.3.0
├── react-native-camera@1.0.2
├── react-native-camera-roll-picker@1.2.3
├── react-native-checkbox-field@2.0.2
├── react-native-code-push@5.4.2
├── react-native-collapsible@0.13.0
├── react-native-communications@2.2.1
├── react-native-device-info@0.17.4
├── react-native-document-picker@2.1.0
├── react-native-emoji@1.3.1
├── react-native-fabric@0.5.2
├── react-native-firebase@5.0.0
├── react-native-gifted-chat@0.4.3
├── react-native-globalize@1.2.4
├── react-native-i18n@2.0.15
├── react-native-icon-badge@1.1.3
├── react-native-image-crop@1.0.2 invalid
├── react-native-image-resizer@1.0.0
├── react-native-keyboard-aware-scroll-view@0.5.0
├── react-native-keyboard-spacer@0.4.1
├── react-native-linear-gradient@2.4.2
├── react-native-localization@0.1.32
├── react-native-looped-carousel@0.1.13
├── react-native-mime-types@2.2.1
├── react-native-modal-datetime-picker@6.0.0
├── react-native-picker-select@4.4.0
├── react-native-root-toast@3.0.1
├── react-native-sentry@0.39.0
├── react-native-simple-radio-button@2.7.3
├── react-native-slider@0.11.0
├── react-native-splash-screen@3.1.1
├── react-native-svg@6.5.2
├── react-native-svg-image@2.0.1
├── react-native-swipeable@0.6.0
├── react-native-swiper@1.5.13
├── react-native-tab-view@1.0.2
├── react-native-tableview-simple@0.17.5
├── react-navigation@2.11.2
├── react-redux@5.0.7
├── react-relay@1.5.0
├── recompose@0.27.1
├── redux@4.0.0
├── redux-actions@2.6.1
├── redux-logger@3.0.6
├── redux-persist@4.10.2
├── redux-saga@0.16.0
├── relay-commit-mutation-promise@1.0.1
├── styled-components@3.4.9
├── tcomb-form-native@0.6.19
├── url-parse@1.4.3
├── victory-native@30.4.0
└── yup@0.24.1

I have following issue:

com.facebook.react.bridge.NoSuchKeyException: stacktrace
10-02 18:25:49.745  5663  6598 E unknown:ReactNative: 	at com.facebook.react.bridge.ReadableNativeMap.getNullableValue(ReadableNativeMap.java:135)
10-02 18:25:49.745  5663  6598 E unknown:ReactNative: 	at com.facebook.react.bridge.ReadableNativeMap.getNullableValue(ReadableNativeMap.java:139)
10-02 18:25:49.745  5663  6598 E unknown:ReactNative: 	at com.facebook.react.bridge.ReadableNativeMap.getMap(ReadableNativeMap.java:210)
10-02 18:25:49.745  5663  6598 E unknown:ReactNative: 	at io.sentry.RNSentryModule.captureEvent(RNSentryModule.java:260)
10-02 18:25:49.745  5663  6598 E unknown:ReactNative: 	at java.lang.reflect.Method.invoke(Native Method)
10-02 18:25:49.745  5663  6598 E unknown:ReactNative: 	at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
10-02 18:25:49.745  5663  6598 E unknown:ReactNative: 	at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
10-02 18:25:49.745  5663  6598 E unknown:ReactNative: 	at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)

this happening when we got an error

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 14
  • Comments: 15 (3 by maintainers)

Most upvoted comments

still with 1.2.1 only on release build with hermes enabled

I temporarily disabled sentry in android build because of random crash.

NoSuchKeyException
frames
com.facebook.react.bridge.ReadableNativeMap in getNullableValue at line 17
com.facebook.react.bridge.ReadableNativeMap in getNullableValue
com.facebook.react.bridge.ReadableNativeMap in getArray at line 2
io.sentry.RNSentryModule in sendEvent at line 649
java.lang.reflect.Method in invoke
com.facebook.react.bridge.JavaMethodWrapper in invoke at line 150
com.facebook.react.bridge.JavaModuleWrapper in invoke at line 21
com.facebook.react.bridge.queue.NativeRunnable in run
android.os.Handler in handleCallback at line 873
android.os.Handler in dispatchMessage at line 99
com.facebook.react.bridge.queue.MessageQueueThreadHandler in dispatchMessage
android.os.Looper in loop at line 214
com.facebook.react.bridge.queue.MessageQueueThreadImpl$4 in run at line 37
java.lang.Thread in run at line 764

Version 0.43.2 was released with the fix.

I made a PR based on @darioceccoli’s comment that checks if stacktrace exists before accessing it. That did seem to fix the issue for me and seems like it would be good to get merged in.

https://github.com/getsentry/react-native-sentry/pull/594

Still getting it with version 0.43.2.

The error shows in Google’s Android Vitals as

com.facebook.react.bridge.NoSuchKeyException: at com.facebook.react.bridge.ReadableNativeMap.getNullableValue (ReadableNativeMap.java:137) at com.facebook.react.bridge.ReadableNativeMap.getNullableValue (ReadableNativeMap.java:141) at com.facebook.react.bridge.ReadableNativeMap.getMap (ReadableNativeMap.java:212) at io.sentry.RNSentryModule.captureEvent (RNSentryModule.java:268) at java.lang.reflect.Method.invoke (Native Method) at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372) at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:158) at com.facebook.react.bridge.queue.NativeRunnable.run (Native Method) at android.os.Handler.handleCallback (Handler.java:873) at android.os.Handler.dispatchMessage (Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:29) at android.os.Looper.loop (Looper.java:214) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:232) at java.lang.Thread.run (Thread.java:764)

In my case the issue is that, in a very specific case, captureEvent inRNSentryModule.java, event.exception doesn’t contain stacktrace. I think the existence of stacktrace should be checked as most other keys.

I’m on react-native-sentry version 0.43.1.