Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newrelic crashes app on iOS #111

Open
shultiaiev-tp opened this issue Feb 7, 2025 · 6 comments
Open

Newrelic crashes app on iOS #111

shultiaiev-tp opened this issue Feb 7, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@shultiaiev-tp
Copy link

shultiaiev-tp commented Feb 7, 2025

Description

WebCoreWebCore::wrapWebCore::DOMException: Thread 1: EXC_BAD_ACCESS (code=1, address=0x20)`

Steps to Reproduce

Seems to be caused during IdentityVault unlock/clear. It's being called in the ngOnInit hook in the page that is first shown to the user. At the moment when FaceID is activated the page is not rendered yet (just blank screen). After the vault was unlocked (not sure if it was cleared as well right away, but it's a likely scenario judging by logs), the app crashes.

Expected Behavior

Should not crash.

Relevant Logs / Console output

⚡️  TO JS {"webViewInstrumentation":true,"interactionTracingEnabled":true,"crashReportingEnabled":true,"sendConsoleEvents":true,"fedRampEnabled":false,"networkRequestEnabled":true,"collectorAddress":"mobile-collector.newrelic.com","offlineStorageEnabled":true,"loggi
To Native Cordova ->  VaultPlugin clear VaultPlugin1241137056 ["options": [{
    androidBiometricsPreferStrongVaultOrSystemPasscode = StrongVault;
    customPasscodeInvalidUnlockAttempts = 5;
    deviceSecurityType = Both;
    key = "com.xm.application.dev";
    shouldClearVaultAfterTooManyFailedAttempts = 0;
    type = DeviceSecurity;
    unlockVaultOnLoad = 0;
}]]
⚡️  TO JS undefined
⚡️  TO JS {"headersList":"[\n  \"X-APOLLO-OPERATION-NAME\",\n  \"X-APOLLO-OPERATION-TYPE\",\n  \"X-APOLLO-OPERATION-ID\"\n]"}
⚡️  TO JS undefined
⚡️  [error] - Failed to load account data {"headers":{"headers":{},"normalizedNames":{},"lazyUpdate":null},"status":403,"statusText":"Unknown Error","url":"https://test-apigw.tp-serv.com/pubapi/users/v1/financials","ok":false,"name":"HttpErrorResponse","message":"Http failure response for https://test-apigw.tp-serv.com/pubapi/users/v1/financials: 403 ","error":{}}
NewRelic(7.5.3,0x30130b600):	NRMAAnalytics.mm:161	-[NRMAAnalytics initWithSessionStartTimeMS:]_block_invoke_2
	invalid attribute: value cannot be nil

Your Environment

iOS 18.3
"@newrelic/newrelic-capacitor-plugin": "^1.5.4"

Additional context

It looks as if it might be crashing either when IdentityVault clears the vault, or when an HTTP request fails right after that. Judging by the logs right before the issue.

The newrelic is configured in the following way:

const agentConfig: AgentConfiguration = {
    //Android Specific
    // Optional:Enable or disable collection of event data.
    analyticsEventEnabled: true,
    // Optional:Enable or disable crash reporting.
    crashReportingEnabled: true,
    // Optional:Enable or disable interaction tracing. Trace instrumentation still occurs, but no traces are harvested. This will disable default and custom interactions.
    interactionTracingEnabled: true,
    // Optional:Enable or disable reporting successful HTTP requests to the MobileRequest event type.
    networkRequestEnabled: true,
    // Optional:Enable or disable reporting network and HTTP request errors to the MobileRequestError event type.
    networkErrorRequestEnabled: true,
    // Optional:Enable or disable capture of HTTP response bodies for HTTP error traces, and MobileRequestError events.
    httpResponseBodyCaptureEnabled: true,
    // Optional:Enable or disable agent logging.
    loggingEnabled: true,
    // Optional:Specifies the log level. Omit this field for the default log level.
    // Options include: ERROR (least verbose), WARNING, INFO, VERBOSE, AUDIT (most verbose).
    logLevel: NREnums.LogLevel.ERROR,
    // iOS Specific
    // Optional:Enable/Disable automatic instrumentation of WebViews
    webViewInstrumentation: true,
    // Optional:Set a specific collector address for sending data. Omit this field for default address.
    // collectorAddress: "",
    // Optional:Set a specific crash collector address for sending crashes. Omit this field for default address.
    // crashCollectorAddress: "",
    // Optional:Enable or disable sending JS console logs to New Relic.
    sendConsoleEvents: true,
    // Optional: Enable or disable reporting data using different endpoints for US government clients.
    fedRampEnabled: false,
    // Optional: Enable or disable offline data storage when no internet connection is available.
    offlineStorageEnabled: true,
    // iOS Specific
    // Optional: Enable or disable Background Reporting.
    backgroundReportingEnabled: false,
    // iOS Specific
    // Optional: Enable or disable to use our new, more stable, event system for iOS agent.
    newEventSystemEnabled: true,
    // Optional: Enable or disable distributed tracing.
    distributedTracingEnabled: true,
  };

Adding initialization of the newrelicagent in AppDelegate doesn't change the behavior.

Removing newrelic plugin usage fixes the error.

@shultiaiev-tp shultiaiev-tp added the bug Something isn't working label Feb 7, 2025
@ndesai-newrelic
Copy link
Contributor

@shultiaiev-tp can you disable interactiontracing?

@shultiaiev-tp
Copy link
Author

shultiaiev-tp commented Feb 7, 2025

@shultiaiev-tp can you disable interactiontracing?

Will check. From what I noticed, it happens when I have VPN off and after the Vault is unlocked an HTTP call fails (as it requires VPN to access closed to public resource), then the vault is cleared and the app crashes. Not sure which step causes, but feels like http calls.

Update

Nope. With interactionTracingEnabled: false, still crashes on the same place. With seemingly the same error.

@ndesai-newrelic
Copy link
Contributor

@shultiaiev-tp can you share runtime logs for this?

@shultiaiev-tp
Copy link
Author

Just the console output? I guess with some sanitization, yes

@ndesai-newrelic
Copy link
Contributor

yes. can you also try to disable webViewInstrumentation?

@shultiaiev-tp
Copy link
Author

Disabling webViewInstrumentation either did not help, or made things worse as now the app crashed even on the first half of the flow.

⚡️  To Native ->  NewRelicCapacitorPlugin getAgentConfiguration 96236975
⚡️  To Native ->  NewRelicCapacitorPlugin getAgentConfiguration 96236976
⚡️  TO JS {"collectorAddress":"mobile-collector.newrelic.com","networkRequestEnabled":true,"httpResponseBodyCaptureEnabled":true,"loggingEnabled":true,"sendConsoleEvents":true,"webViewInstrumentation":false,"fedRampEnabled":false,"offlineStorageEnabled":true,"crashC
⚡️  TO JS {"crashReportingEnabled":true,"loggingEnabled":true,"logLevel":"ERROR","webViewInstrumentation":false,"collectorAddress":"mobile-collector.newrelic.com","networkErrorRequestEnabled":true,"crashCollectorAddress":"mobile-crash.newrelic.com","sendConsoleEvent
⚡️  [error] - {"code":"NSURLErrorDomain","errorMessage":"An SSL error has occurred and a secure connection to the server cannot be made."}

⚡️  ------ STARTUP JS ERROR ------

⚡️  Error: An SSL error has occurred and a secure connection to the server cannot be made.
⚡️  URL: capacitor://localhost/2291.js
⚡️  2291.js:1:52254

⚡️  See above for help with debugging blank-screen issues
⚡️  To Native ->  NewRelicCapacitorPlugin getAgentConfiguration 96236977
⚡️  To Native ->  NewRelicCapacitorPlugin recordError -1
⚡️  To Native ->  NewRelicCapacitorPlugin logError 96236978
⚡️  To Native ->  NewRelicCapacitorPlugin logError 96236979
⚡️  To Native ->  NewRelicCapacitorPlugin getHTTPHeadersTrackingFor 96236980
⚡️  TO JS {"crashReportingEnabled":true,"loggingEnabled":true,"logLevel":"ERROR","webViewInstrumentation":false,"collectorAddress":"mobile-collector.newrelic.com","networkErrorRequestEnabled":true,"crashCollectorAddress":"mobile-crash.newrelic.com","sendConsoleEvent
⚡️  To Native ->  NewRelicCapacitorPlugin logError 96236981
⚡️  TO JS undefined
NewRelic(7.5.3,0x3007a1380):	NewRelic.m:67	+[NewRelic log:level:]
	[CONSOLE][ERROR]{"0":"Login failed","1":{"code":"NSURLErrorDomain","errorMessage":"An SSL error has occurred and a secure connection to the server cannot be made."}}
⚡️  TO JS 
NewRelic(7.5.3,0x3007a1380):	NewRelic.m:67	+[NewRelic log:level:]
	[CONSOLE][ERROR]{"0":{"code":"NSURLErrorDomain","errorMessage":"An SSL error has occurred and a secure connection to the server cannot be made."}}
{"headersList":"[\n  \"X-APOLLO-OPERATION-NAME\",\n  \"X-APOLLO-OPERATION-TYPE\",\n  \"X-APOLLO-OPERATION-ID\"\n]"}
NewRelic(7.5.3,0x3007a1380):	NewRelic.m:67	+[NewRelic log:level:]
	[CONSOLE][ERROR]{"0":{"code":"NSURLErrorDomain","errorMessage":"An SSL error has occurred and a secure connection to the server cannot be made."}}
⚡️  To Native ->  NewRelicCapacitorPlugin getAgentConfiguration 96236982
⚡️  [log] - {"headersList":"[\n  \"X-APOLLO-OPERATION-NAME\",\n  \"X-APOLLO-OPERATION-TYPE\",\n  \"X-APOLLO-OPERATION-ID\"\n]"}
⚡️  To Native ->  NewRelicCapacitorPlugin generateDistributedTracingHeaders 96236983
⚡️  TO JS {"crashReportingEnabled":true,"loggingEnabled":true,"logLevel":"ERROR","webViewInstrumentation":false,"collectorAddress":"mobile-collector.newrelic.com","networkErrorRequestEnabled":true,"crashCollectorAddress":"mobile-crash.newrelic.com","sendConsoleEvent
⚡️  To Native ->  NewRelicCapacitorPlugin logInfo 96236984
⚡️  TO JS {"tracestate":"2868847@nr=0-2-2868847-538666473-aae32d1c49bc4b8e---1739275739","newrelic":"eyJ2IjoiWzAsMl0iLCJkIjp7InRpIjoxNzM5Mjc1NzM5Ljg4OTk5MiwiaWQiOiJhYWUzMmQxYzQ5YmM0YjhlIiwiYXAiOiI1Mzg2NjY0NzMiLCJ0ciI6ImUyOGU0ODlhMzg4MTRiNjliMmZjZGI3ZDg3YTkyNzYwIiwid
⚡️  To Native ->  NewRelicCapacitorPlugin getAgentConfiguration 96236985
⚡️  TO JS {"crashReportingEnabled":true,"loggingEnabled":true,"logLevel":"ERROR","webViewInstrumentation":false,"collectorAddress":"mobile-collector.newrelic.com","networkErrorRequestEnabled":true,"crashCollectorAddress":"mobile-crash.newrelic.com","sendConsoleEvent
To Native Cordova ->  AkamaiBmpCordovaPlugin getSensorData AkamaiBmpCordovaPlugin1359144807 ["options": []]
⚡️  To Native ->  NewRelicCapacitorPlugin getHTTPHeadersTrackingFor 96236986
⚡️  TO JS {"headersList":"[\n  \"X-APOLLO-OPERATION-NAME\",\n  \"X-APOLLO-OPERATION-TYPE\",\n  \"X-APOLLO-OPERATION-ID\"\n]"}
⚡️  To Native ->  NewRelicCapacitorPlugin getAgentConfiguration 96236987
⚡️  [log] - {"headersList":"[\n  \"X-APOLLO-OPERATION-NAME\",\n  \"X-APOLLO-OPERATION-TYPE\",\n  \"X-APOLLO-OPERATION-ID\"\n]"}
⚡️  To Native ->  NewRelicCapacitorPlugin generateDistributedTracingHeaders 96236988
⚡️  TO JS {"crashReportingEnabled":true,"loggingEnabled":true,"logLevel":"ERROR","webViewInstrumentation":false,"collectorAddress":"mobile-collector.newrelic.com","networkErrorRequestEnabled":true,"crashCollectorAddress":"mobile-crash.newrelic.com","sendConsoleEvent
⚡️  TO JS {"newrelic":"eyJ2IjoiWzAsMl0iLCJkIjp7InRpIjoxNzM5Mjc1NzQxLjMzNzA5MTksImlkIjoiOWU0NmZiOTYyOGE3NDBlNCIsImFwIjoiNTM4NjY2NDczIiwidHIiOiI2NDU2NDJlOTkzMWY0YjZlYTQ5Yjk5NzhlNDUwMDdhNSIsInR5IjoibW9iaWxlIiwiYWMiOiIyODY4ODQ3In19","tracestate":"2868847@nr=0-2-2868847-
⚡️  To Native ->  NewRelicCapacitorPlugin logInfo 96236989
⚡️  To Native ->  NewRelicCapacitorPlugin getAgentConfiguration 96236990
⚡️  TO JS {"crashReportingEnabled":true,"loggingEnabled":true,"logLevel":"ERROR","webViewInstrumentation":false,"collectorAddress":"mobile-collector.newrelic.com","networkErrorRequestEnabled":true,"crashCollectorAddress":"mobile-crash.newrelic.com","sendConsoleEvent
⚡️  To Native ->  CapacitorHttp request 96236991
⚡️  TO JS {"status":200,"url":"...\/users\/v1\/authentication\/login\/email","headers":{"set-cookie":"refreshToken=<token>"
⚡️  To Native ->  NewRelicCapacitorPlugin noticeHttpTransaction -1
⚡️  TO JS undefined
To Native Cordova ->  OneSignalPush login OneSignalPush1359144808 ["options": [1]]
To Native Cordova ->  VaultPlugin clear VaultPlugin1359144809 ["options": [{
    androidBiometricsPreferStrongVaultOrSystemPasscode = StrongVault;
    customPasscodeInvalidUnlockAttempts = 5;
    deviceSecurityType = Both;
    key = "com.xm.application.dev";
    shouldClearVaultAfterTooManyFailedAttempts = 0;
    type = DeviceSecurity;
    unlockVaultOnLoad = 0;
}]]
To Native Cordova ->  VaultPlugin setValue VaultPlugin1359144810 ["options": [{
    androidBiometricsPreferStrongVaultOrSystemPasscode = StrongVault;
    customPasscodeInvalidUnlockAttempts = 5;
    deviceSecurityType = Both;
    key = "com.xm.application.dev";
    shouldClearVaultAfterTooManyFailedAttempts = 0;
    type = DeviceSecurity;
    unlockVaultOnLoad = 0;
}, session, {"idToken":"<token>","idTokenExpirationTime":"2025-02-11T13:09:01.000Z","brandName":"","refreshTokenExpirationTime":"2025-03-13T12:09:01.000Z","mfaRequired":false,"profileId":1,"accessToken":"<token>","accessTokenExpirationTime":"2025-02-11T13:09:01.000Z","refreshToken":""
To Native Cordova ->  DevicePlugin isSystemPasscodeSet DevicePlugin1359144811 ["options": []]
To Native Cordova ->  DevicePlugin isBiometricsAllowed DevicePlugin1359144812 ["options": []]
To Native Cordova ->  DevicePlugin isBiometricsEnabled DevicePlugin1359144813 ["options": []]
⚡️  To Native ->  NewRelicCapacitorPlugin getAgentConfiguration 96236992
⚡️  [log] - biometrics is enabled:  true
⚡️  To Native ->  NewRelicCapacitorPlugin getAgentConfiguration 96236993
To Native Cordova ->  DevicePlugin isBiometricsAllowed DevicePlugin1359144814 ["options": []]
⚡️  TO JS {"crashReportingEnabled":true,"loggingEnabled":true,"logLevel":"ERROR","webViewInstrumentation":false,"collectorAddress":"mobile-collector.newrelic.com","networkErrorRequestEnabled":true,"crashCollectorAddress":"mobile-crash.newrelic.com","sendConsoleEvent
⚡️  TO JS {"crashCollectorAddress":"mobile-crash.newrelic.com","distributedTracingEnabled":true,"networkRequestEnabled":true,"webViewInstrumentation":false,"crashReportingEnabled":true,"loggingEnabled":true,"fedRampEnabled":false,"collectorAddress":"mobile-collector
⚡️  To Native ->  NewRelicCapacitorPlugin logInfo 96236994
⚡️  To Native ->  NewRelicCapacitorPlugin logInfo 96236995
To Native Cordova ->  VaultPlugin updateConfig VaultPlugin1359144815 ["options": [{
    androidBiometricsPreferStrongVaultOrSystemPasscode = StrongVault;
    customPasscodeInvalidUnlockAttempts = 5;
    deviceSecurityType = Both;
    key = "com.xm.application.dev";
    shouldClearVaultAfterTooManyFailedAttempts = 0;
    type = DeviceSecurity;
    unlockVaultOnLoad = 0;
}]]
⚡️  To Native ->  NewRelicCapacitorPlugin getHTTPHeadersTrackingFor 96236996
⚡️  To Native ->  NewRelicCapacitorPlugin getHTTPHeadersTrackingFor 96236997
⚡️  TO JS {"headersList":"[\n  \"X-APOLLO-OPERATION-NAME\",\n  \"X-APOLLO-OPERATION-TYPE\",\n  \"X-APOLLO-OPERATION-ID\"\n]"}
⚡️  TO JS {"headersList":"[\n  \"X-APOLLO-OPERATION-NAME\",\n  \"X-APOLLO-OPERATION-TYPE\",\n  \"X-APOLLO-OPERATION-ID\"\n]"}
⚡️  To Native ->  NewRelicCapacitorPlugin getHTTPHeadersTrackingFor 96236998
⚡️  TO JS {"headersList":"[\n  \"X-APOLLO-OPERATION-NAME\",\n  \"X-APOLLO-OPERATION-TYPE\",\n  \"X-APOLLO-OPERATION-ID\"\n]"}
⚡️  To Native ->  NewRelicCapacitorPlugin getAgentConfiguration 96236999
⚡️  [log] - {"headersList":"[\n  \"X-APOLLO-OPERATION-NAME\",\n  \"X-APOLLO-OPERATION-TYPE\",\n  \"X-APOLLO-OPERATION-ID\"\n]"}
⚡️  To Native ->  NewRelicCapacitorPlugin generateDistributedTracingHeaders 96237000
⚡️  To Native ->  NewRelicCapacitorPlugin getAgentConfiguration 96237001
⚡️  To Native ->  NewRelicCapacitorPlugin generateDistributedTracingHeaders 96237002
⚡️  TO JS {"crashCollectorAddress":"mobile-crash.newrelic.com","distributedTracingEnabled":true,"networkRequestEnabled":true,"webViewInstrumentation":false,"crashReportingEnabled":true,"loggingEnabled":true,"fedRampEnabled":false,"collectorAddress":"mobile-collector
⚡️  To Native ->  NewRelicCapacitorPlugin getAgentConfiguration 96237003
⚡️  To Native ->  NewRelicCapacitorPlugin generateDistributedTracingHeaders 96237004

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants