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

Error events are not recorded in Sentry dashboard #4221

Closed
jenipharachel opened this issue Oct 31, 2024 · 11 comments
Closed

Error events are not recorded in Sentry dashboard #4221

jenipharachel opened this issue Oct 31, 2024 · 11 comments

Comments

@jenipharachel
Copy link

What React Native libraries do you use?

React Navigation

Are you using sentry.io or on-premise?

on-premise (Self-Hosted)

@sentry/react-native SDK Version

5.33.1

How does your development environment look like?

info
OS: MacOS
Node: v16.9.0
Yarn: 1.22.19
react: "17.0.2"
react-native: "0.67.2"
hermesEnabled: false
newArchEnabled: false

Sentry.init()

Sentry.init({
  dsn: "",
  // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
  // We recommend adjusting this value in production.
  debug: true,
  tracesSampleRate: 1.0,
  release: release + '@' + VersionNumber.appVersion + '+' + VersionNumber.buildVersion,
})

Steps to Reproduce

  1. Built the app in iOS and android.
  2. Crashed the app with "throw new Error("My first Sentry error!");" or "Sentry.nativeCrash();"
  3. Crash occured but was not recorded in Sentry Dashboard. Production bugs are also not recorded in the Sentry Dashboard.

Expected Result

Crashes to be recorded in Sentry

Actual Result

Crash occured but was not recorded in Sentry Dashboard. Production bugs are also not recorded in the Sentry Dashboard.

@rwachtler
Copy link

rwachtler commented Oct 31, 2024

Thank you for reaching out here @jenipharachel ! Couple of points to help you resolve this issue faster:

  • Could you please provide the Sentry log output from your console
  • Is it a "new" setup or did it just stop capturing errors after an update etc.
    • if you've encountered this in an existing setup (Sentry worked before), do you recall what your last action was, before it stopped working?
  • Since you're on a self-hosted instance, are you 100% positive that it's setup correctly to receive the events?

@jenipharachel
Copy link
Author

@rwachtler

  • I'm not sure how I could provide you the Sentry logs. I don't see them in my console.
  • It was already setup previously by another developer who is no longer with us, not sure when it stopped working cause I can't see any issues from before August. We only noticed it was not working when there were crashes reported by our users which were not caught in Sentry.
  • I redid the setup using the command npx @sentry/wizard@latest -i reactNative but still it is not working.

@lucas-zimerman
Copy link
Collaborator

Hi @jenipharachel, which version of self-hosted are you using? And could you by any chance check if the error is recorded if you use sentry.io (on a free tier)?

@jenipharachel
Copy link
Author

jenipharachel commented Nov 5, 2024

@lucas-zimerman I'm using "@sentry/react-native": "^5.33.1". And yes, I checked with a free tier project and it is not getting logged there as well.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 5, 2024
@krystofwoldrich
Copy link
Member

Hi @jenipharachel,
could you share with us your JS console logs (keep debug: true this ensure Sentry logs out useful debug information)?

Also please share with us an example code of how are you testing the reporting, captureExcception call...

Does it happen both on iOS and Android, Emulator and Real Device?

If on Android could you also hare a logcat logs with us?

@getsantry getsantry bot removed the status in GitHub Issues with 👀 3 Nov 6, 2024
@krystofwoldrich krystofwoldrich moved this from Needs Discussion to Needs More Information in Mobile & Cross Platform SDK Nov 6, 2024
@getsantry getsantry bot moved this to Waiting for: Community in GitHub Issues with 👀 3 Nov 6, 2024
@jenipharachel
Copy link
Author

jenipharachel commented Nov 6, 2024

@krystofwoldrich I added the below code for testing. DefaultButton is a component already used in our code. It occurs in both. I have not tested in a real device but We had been receiving multiple crash reports from users but none are logged in the Sentry dashboard.

            <DefaultButton
              btnText="Try Me!"
              onPress={() => Sentry.captureException(new Error('My first Sentry error!'))}
            />

When I tested in iOS simulator, I saw the below logs when I clicked on the button

LOG  Sentry Logger [log]: [TouchEvents] Touch event within element: View
 WARN  Sentry Logger [warn]: Unable to symbolicate stack trace: stackWithoutPoppedFrames.filter is not a function. (In 'stackWithoutPoppedFrames.filter(function (frame) {
                return frame.file && frame.file.match(INTERNAL_CALLSITES_REGEX) === null;
              })', 'stackWithoutPoppedFrames.filter' is undefined)

In Android emulator, When I clicked on the button I received the a long list of logs, I have added a part of the logs below

2024-11-06 17:55:27.374  8359-8678  Sentry                               W  Cache folder if full (respecting maxSize). Rotating files
2024-11-06 17:55:27.376  8359-8678  Sentry                              W  Current envelope doesn't exist.
2024-11-06 17:55:27.376  8359-8678  Sentry                               D  Adding Envelope to offline storage: /data/user/0/com.webpartners.leonardo/cache/sentry/cdb5ba61ee01856db6fc720edfffaa8b6326855b/a4e999ce-ebb4-4fc4-88ae-264968711353.envelope
2024-11-06 17:55:27.377  8359-8678  Sentry                               D  Serializing object: {
                                                                                                    	"sid": "6ec300ff-febf-4d8f-b5c5-2ff6ab7df5e2",
                                                                                                    	"did": "e6c4dd76-a98c-4e11-83ef-025f5797ffec",
                                                                                                    	"started": "2024-11-06T12:22:24.465Z",
                                                                                                    	"status": "exited",
                                                                                                    	"seq": 1730895927373,
                                                                                                    	"errors": 1,
                                                                                                    	"duration": 182.908,
                                                                                                    	"timestamp": "2024-11-06T12:25:27.373Z",
                                                                                                    	"attrs": {
                                                                                                    		"release": "com.webpartners.leonardo@1+100001",
                                                                                                    		"environment": "development"
                                                                                                    	}
                                                                                                    }
2024-11-06 17:55:27.379  8359-8678  Sentry                               D  Attaching client report to envelope.
2024-11-06 17:55:27.430  8359-8678  TrafficStats                         D  tagSocket(108) with statsTag=0xffffffff, statsUid=-1
2024-11-06 17:55:27.814  8359-8678  Sentry                               D  Serializing object: {
                                                                                                    	"timestamp": "2024-11-06T12:25:27.379Z",
                                                                                                    	"discarded_events": [
                                                                                                    		{
                                                                                                    			"reason": "cache_overflow",
                                                                                                    			"category": "session",
                                                                                                    			"quantity": 1
                                                                                                    		}
                                                                                                    	]
                                                                                                    }
2024-11-06 17:55:28.189  8359-8678  Sentry                               D  Request failed, API returned 301
2024-11-06 17:55:28.190  8359-8678  Sentry                              E  Envelope submission failed
                                                                                                    java.lang.NullPointerException
                                                                                                    	at java.io.Reader.<init>(Reader.java:167)
                                                                                                    	at java.io.InputStreamReader.<init>(InputStreamReader.java:112)
                                                                                                    	at io.sentry.transport.HttpConnection.getErrorMessageFromStream(HttpConnection.java:248)
                                                                                                    	at io.sentry.transport.HttpConnection.readAndLog(HttpConnection.java:184)
                                                                                                    	at io.sentry.transport.HttpConnection.send(HttpConnection.java:163)
                                                                                                    	at io.sentry.transport.AsyncHttpTransport$EnvelopeSender.flush(AsyncHttpTransport.java:298)
                                                                                                    	at io.sentry.transport.AsyncHttpTransport$EnvelopeSender.run(AsyncHttpTransport.java:243)
                                                                                                    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
                                                                                                    	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
2024-11-06 17:55:28.194  8359-8678  Sentry                               W  Cache folder if full (respecting maxSize). Rotating files
2024-11-06 17:55:28.202  8359-8678  Sentry                               D  Session d55ae09d-9910-45b2-8db1-9a5eb7fcca46 has 2 times the init flag.
2024-11-06 17:55:28.202  8359-8678  Sentry                               D  Serializing object: {
                                                                                                    	"sid": "db737525-f255-4507-b5be-e2f604a261b9",
                                                                                                    	"did": "e6c4dd76-a98c-4e11-83ef-025f5797ffec",
                                                                                                    	"init": true,
                                                                                                    	"started": "2024-11-06T12:25:27.373Z",
                                                                                                    	"status": "ok",
                                                                                                    	"errors": 0,
                                                                                                    	"timestamp": "2024-11-06T12:25:27.373Z",
                                                                                                    	"attrs": {
                                                                                                    		"release": "com.webpartners.leonardo@1+100001",
                                                                                                    		"environment": "development"
                                                                                                    	}
                                                                                                    }
2024-11-06 17:55:28.203  8359-8678  Sentry                               D  Serializing object: {
                                                                                                    	"sid": "db737525-f255-4507-b5be-e2f604a261b9",
                                                                                                    	"did": "e6c4dd76-a98c-4e11-83ef-025f5797ffec",
                                                                                                    	"init": true,
                                                                                                    	"started": "2024-11-06T12:25:27.373Z",
                                                                                                    	"status": "ok",
                                                                                                    	"errors": 0,
                                                                                                    	"timestamp": "2024-11-06T12:25:27.373Z",
                                                                                                    	"attrs": {
                                                                                                    		"release": "com.webpartners.leonardo@1+100001",
                                                                                                    		"environment": "development"
                                                                                                    	}
                                                                                                    }
2024-11-06 17:55:28.203  8359-8678  Sentry                               D  Adding Envelope to offline storage: /data/user/0/com.webpartners.leonardo/cache/sentry/cdb5ba61ee01856db6fc720edfffaa8b6326855b/f0bbb6df-7fe9-4737-b816-67c48f52359e.envelope
2024-11-06 17:55:28.205  8359-8678  Sentry                              D  Attaching client report to envelope.
2024-11-06 17:55:28.205  8359-8678  TrafficStats                         D  tagSocket(108) with statsTag=0xffffffff, statsUid=-1
2024-11-06 17:55:28.499  8359-8678  Sentry                               D  Serializing object: {
                                                                                                    	"timestamp": "2024-11-06T12:25:28.204Z",
                                                                                                    	"discarded_events": [
                                                                                                    		{
                                                                                                    			"reason": "cache_overflow",
                                                                                                    			"category": "session",
                                                                                                    			"quantity": 1
                                                                                                    		}
                                                                                                    	]
                                                                                                    }
2024-11-06 17:55:28.784  8359-8678  Sentry                             D  Request failed, API returned 301
2024-11-06 17:55:28.794  8359-8678  Sentry                               E  Envelope submission failed
                                                                                                    java.lang.NullPointerException
                                                                                                    	at java.io.Reader.<init>(Reader.java:167)
                                                                                                    	at java.io.InputStreamReader.<init>(InputStreamReader.java:112)
                                                                                                    	at io.sentry.transport.HttpConnection.getErrorMessageFromStream(HttpConnection.java:248)
                                                                                                    	at io.sentry.transport.HttpConnection.readAndLog(HttpConnection.java:184)
                                                                                                    	at io.sentry.transport.HttpConnection.send(HttpConnection.java:163)
                                                                                                    	at io.sentry.transport.AsyncHttpTransport$EnvelopeSender.flush(AsyncHttpTransport.java:298)
                                                                                                    	at io.sentry.transport.AsyncHttpTransport$EnvelopeSender.run(AsyncHttpTransport.java:243)
                                                                                                    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
                                                                                                    	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
2024-11-06 17:55:28.796  8359-8678  Sentry                               W  Cache folder if full (respecting maxSize). Rotating files
2024-11-06 17:55:28.800  8359-8678  Sentry                               D  Adding Envelope to offline storage: /data/user/0/com.webpartners.leonardo/cache/sentry/cdb5ba61ee01856db6fc720edfffaa8b6326855b/6c44555d-aeed-46dc-b890-f236c180f10d.envelope
2024-11-06 17:55:28.801  8359-8678  Sentry                               D  Serializing object: {
                                                                                                    	"sid": "6ec300ff-febf-4d8f-b5c5-2ff6ab7df5e2",
                                                                                                    	"did": "e6c4dd76-a98c-4e11-83ef-025f5797ffec",
                                                                                                    	"started": "2024-11-06T12:22:24.465Z",
                                                                                                    	"status": "exited",
                                                                                                    	"seq": 1730895927373,
                                                                                                    	"errors": 1,
                                                                                                    	"duration": 182.908,
                                                                                                    	"timestamp": "2024-11-06T12:25:27.373Z",
                                                                                                    	"attrs": {
                                                                                                    		"release": "com.webpartners.leonardo@1+100001",
                                                                                                    		"environment": "development"
                                                                                                    	}
                                                                                                    }
2024-11-06 17:55:28.803  8359-8678  Sentry                               D  Attaching client report to envelope.
2024-11-06 17:55:28.805  8359-8678  TrafficStats                         D  tagSocket(108) with statsTag=0xffffffff, statsUid=-1
2024-11-06 17:55:29.116  8359-8678  Sentry                               D  Serializing object: {
                                                                                                    	"timestamp": "2024-11-06T12:25:28.802Z",
                                                                                                    	"discarded_events": [
                                                                                                    		{
                                                                                                    			"reason": "cache_overflow",
                                                                                                    			"category": "error",
                                                                                                    			"quantity": 1
                                                                                                    		},
                                                                                                    		{
                                                                                                    			"reason": "cache_overflow",
                                                                                                    			"category": "session",
                                                                                                    			"quantity": 1
                                                                                                    		}
                                                                                                    	]
                                                                                                    }
2024-11-06 17:55:29.425  8359-8678  Sentry                               D  Request failed, API returned 301
2024-11-06 17:55:29.428  8359-8678  Sentry                               E  Envelope submission failed
                                                                                                    java.lang.NullPointerException
                                                                                                    	at java.io.Reader.<init>(Reader.java:167)
                                                                                                    	at java.io.InputStreamReader.<init>(InputStreamReader.java:112)
                                                                                                    	at io.sentry.transport.HttpConnection.getErrorMessageFromStream(HttpConnection.java:248)
                                                                                                    	at io.sentry.transport.HttpConnection.readAndLog(HttpConnection.java:184)
                                                                                                    	at io.sentry.transport.HttpConnection.send(HttpConnection.java:163)
                                                                                                    	at io.sentry.transport.AsyncHttpTransport$EnvelopeSender.flush(AsyncHttpTransport.java:298)
                                                                                                    	at io.sentry.transport.AsyncHttpTransport$EnvelopeSender.run(AsyncHttpTransport.java:243)
                                                                                                    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
                                                                                                    	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)


@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 6, 2024
@krystofwoldrich
Copy link
Member

@jenipharachel Thank you for the logs.

The envelopes are not being uploaded to Sentry due to Permanent Move 301 return code.

2024-11-06 17:55:28.784  8359-8678  Sentry                             D  Request failed, API returned 301
2024-11-06 17:55:28.794  8359-8678  Sentry                               E  Envelope submission failed

Are these logs from Sentry.io DSN or from the Self Hosted?

@jenipharachel
Copy link
Author

@krystofwoldrich The above logs are from the self-hosted one. Do you want the logs from Sentry.io DSN?

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 6, 2024
@jenipharachel
Copy link
Author

jenipharachel commented Nov 7, 2024

@krystofwoldrich I tried with Sentry.io today again and it seems to be working for that now. Am I missing something like a key step in the installation for self-hosted?

@krystofwoldrich
Copy link
Member

Hi @jenipharachel,
my knowledge of self-hosted is limited, but if you share the server logs here, my colleagues can help you out.

@krystofwoldrich
Copy link
Member

Closing this due to inactivity. If this is still an issue feel free to comment here or open a new issue if the context changed.

@krystofwoldrich krystofwoldrich closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2024
@github-project-automation github-project-automation bot moved this from Needs More Information to Done in Mobile & Cross Platform SDK Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

No branches or pull requests

4 participants