Sentry-react-native: [iOS@RN 0.55.0) - RCTFatalException: Exception 'Attempt to insert non-property list object

Created on 4 Apr 2018  路  4Comments  路  Source: getsentry/sentry-react-native

OS:

  • [ ] Windows
  • [x] MacOS
  • [ ] Linux

_Platform:_

  • [x] iOS
  • [ ] Android

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

v8.5.0
5.7.1

Config:

Sentry.config('https://[email protected]/...').install();

Issue

On release of React Native 0.55.0, Sentry.setUserContext seems to crash the app on iOS. Android untested.

Steps to reproduce:

Insert the code in your app somewhere:

const { profile } = response.user;
Sentry.setUserContext({
  email: profile.email,
  extra: {
    profile,
  },
  username: profile.username,
});

Actual result:

Crash occurs:

Process:               testapp [56380]
Path:                  /Users/USER/Library/Developer/CoreSimulator/Devices/AA9B2BA7-E329-4269-A16C-E12F01BE43A6/data/Containers/Bundle/Application/03B56C45-F50F-4F63-AA21-8CAFE85D563A/testapp.app/testapp
Identifier:            testapp
Version:               5.0.19 (43)
Code Type:             X86-64 (Native)
Parent Process:        launchd_sim [2238]
Responsible:           testapp [56380]
User ID:               501

Date/Time:             2018-04-03 16:06:23.539 -0700
OS Version:            Mac OS X 10.13.4 (17E197a)
Report Version:        12
Anonymous UUID:        DE190A56-5B48-0AEE-117F-494F8D551FE2

Sleep/Wake UUID:       815B4D2E-CE05-4B0B-96B5-ADFD967B71B6

Time Awake Since Boot: 66000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
*** Terminating app due to uncaught exception 'RCTFatalException: Exception 'Attempt to insert non-property list object {
    email = "[email protected]";
    extra =     { ... }
    username = "testusername";
} for key sentry.io.user' was thrown while invoking setUser on target RNSentry with params (
    {
    email = "[email protected]";
    extra = { ... }
 terminating with uncaught exception of type NSException
abort() called
CoreSimulator 494.33 - Device: iPhone 6 - Runtime: iOS 11.2 (15C107) - DeviceType: iPhone 6

Application Specific Backtrace 1:
0   CoreFoundation                      0x000000010fd9112b __exceptionPreprocess + 171
1   libobjc.A.dylib                     0x000000010e0f9f41 objc_exception_throw + 48
2   testapp                     0x000000010d453585 RCTFormatError + 0
3   testapp                     0x000000010d4ad856 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 798
4   testapp                     0x000000010d4ad3bc ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
5   libdispatch.dylib                   0x00000001158b3177 _dispatch_call_block_and_release + 12
6   libdispatch.dylib                   0x00000001158b41ba _dispatch_client_callout + 8
7   libdispatch.dylib                   0x00000001158be3a4 _dispatch_main_queue_callback_4CF + 1260
8   CoreFoundation                      0x000000010fd53e39 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
9   CoreFoundation                      0x000000010fd18462 __CFRunLoopRun + 2402
10  CoreFoundation                      0x000000010fd17889 CFRunLoopRunSpecific + 409
11  GraphicsServices                    0x00000001178599c6 GSEventRunModal + 62
12  UIKit                               0x00000001135f35d6 UIApplicationMain + 159
13  testapp                     0x000000010d3fc772 main + 80
14  libdyld.dylib                       0x0000000115928d81 start + 1

Expected result:

Sentry to set user context without crashing the app

馃react-native-sentry

Most helpful comment

Have you checked any subfields such as extra.profile[prop]?
In my case, if one of the values was null, the same error occurred.

All 4 comments

Have you checked any subfields such as extra.profile[prop]?
In my case, if one of the values was null, the same error occurred.

Yeah you're probably correct. It should still at least parse in the object provided the object is defined.

Hey, thanks for reporting this.
Please use the workaround @yongdamsh provided this will be fixed in a future version.

I am closing all old issues, please if this is still a problem feel free to revive it.
Also, consider moving to our new SDK @sentry/react-native if it still happens there please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings