question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When the network is bad, Sentry will prevent the program from closing properly

See original GitHub issue

Versions + Platform

SDK version - @sentry/electron": “^3.0.4 Electron version - electron”: "17.1.2 Platform - Windows

Description

use electron forge create project and add sentry just like doc

Sentry.init({
  dsn: "https://x@x.ingest.sentry.io/x",
  debug: true,
  beforeSend() {
    console.log('beforeSend');
    return null // for test
  },
});

When the program is closed(click close button), the following log will be displayed and the program will not exit.

✔ Compiling Renderer Code
Sentry Logger [Log]: Integration installed: SentryMinidump
Sentry Logger [Log]: Integration installed: ElectronBreadcrumbs
Sentry Logger [Log]: Integration installed: Net
Sentry Logger [Log]: Integration installed: MainContext
Sentry Logger [Log]: Integration installed: ChildProcess
Sentry Logger [Log]: Integration installed: OnUncaughtException
Sentry Logger [Log]: Integration installed: PreloadInjection
Sentry Logger [Log]: Integration installed: AdditionalContext
Sentry Logger [Log]: Integration installed: InboundFilters
Sentry Logger [Log]: Integration installed: FunctionToString
Sentry Logger [Log]: Integration installed: Console
Sentry Logger [Log]: Integration installed: Http
Sentry Logger [Log]: Integration installed: OnUnhandledRejection
Sentry Logger [Log]: Integration installed: LinkedErrors
Sentry Logger [Log]: Integration installed: MainProcessSession
[24364:0321/150124.538:ERROR:session_preferences.cc(38)] preload script must have absolute path: ./node_modules/@sentry/electron/esm/preload/index.js
[24364:0321/150124.539:ERROR:session_preferences.cc(38)] preload script must have absolute path: ./node_modules/@sentry/electron/esm/preload/index.js
[24364:0321/150124.565:ERROR:session_preferences.cc(38)] preload script must have absolute path: ./node_modules/@sentry/electron/esm/preload/index.js
[24364:0321/150124.565:ERROR:session_preferences.cc(38)] preload script must have absolute path: ./node_modules/@sentry/electron/esm/preload/index.js  
[24364:0321/150124.576:ERROR:session_preferences.cc(38)] preload script must have absolute path: ./node_modules/@sentry/electron/esm/preload/index.js
Sentry Logger [Log]: Deleted Crashpad metadata file C:\Users\Hanlin\AppData\Roaming\eletron-forge-webpack\Crashpad\metadata
Sentry Logger [Log]: Found 0 minidumps
Sentry Logger [Log]: Found previous abnormal session
Sentry Logger [Log]: Sending 'session' request
[24364:0321/150124.649:ERROR:session_preferences.cc(38)] preload script must have absolute path: ./node_modules/@sentry/electron/esm/preload/index.js
[24364:0321/150124.724:ERROR:session_preferences.cc(38)] preload script must have absolute path: ./node_modules/@sentry/electron/esm/preload/index.js
[24364:0321/150124.733:ERROR:session_preferences.cc(38)] preload script must have absolute path: ./node_modules/@sentry/electron/esm/preload/index.js
Sentry Logger [Log]: Error sending Error: net::ERR_CONNECTION_REFUSED
Sentry Logger [Log]: Queuing request
Sentry Logger [Log]: [MainProcessSession] Exit Handler
Sentry Logger [Log]: Ending session
Sentry Logger [Log]: Sending 'session' request
Sentry Logger [Log]: Error sending Error: net::ERR_CONNECTION_REFUSED
Sentry Logger [Log]: Queuing request
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: net::ERR_CONNECTION_REFUSED
    at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:101:7068)
    at SimpleURLLoaderWrapper.emit (node:events:390:28)
    at SimpleURLLoaderWrapper.emit (node:domain:475:12)
(node:24364) UnhandledPromiseRejectionWarning: Error: net::ERR_CONNECTION_REFUSED
    at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:101:7068)
    at SimpleURLLoaderWrapper.emit (node:events:390:28)
    at SimpleURLLoaderWrapper.emit (node:domain:475:12)
(Use `electron --trace-warnings ...` to show where the warning was created)
(node:24364) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
beforeSend
Sentry Logger [Error]: SentryError: `beforeSend` returned `null`, will not send event.
Sentry Logger [Log]: Found a request in the queue
Sentry Logger [Log]: Sending 'session' request
Sentry Logger [Log]: Error sending Error: net::ERR_CONNECTION_REFUSED
Sentry Logger [Log]: Queuing request
Sentry Logger [Log]: Found a request in the queue
Sentry Logger [Log]: Sending 'session' request
Sentry Logger [Log]: Error sending Error: net::ERR_CONNECTION_REFUSED
Sentry Logger [Log]: Queuing request
Sentry Logger [Log]: Found a request in the queue
Sentry Logger [Log]: Sending 'session' request
Sentry Logger [Log]: Error sending Error: net::ERR_CONNECTION_REFUSED
Sentry Logger [Log]: Queuing request
[19536:0321/150324.636:ERROR:gpu_init.cc(454)] Passthrough is not supported, GL is disabled, ANGLE is
Sentry Logger [Log]: Found a request in the queue
Sentry Logger [Log]: Sending 'session' request
Sentry Logger [Log]: Error sending Error: net::ERR_CONNECTION_REFUSED
Sentry Logger [Log]: Queuing request

and why Sentry keeps showing ERROR:session_preferences.cc(38)] preload script must have absolute path: ./node_modules/@sentry/electron/esm/preload/index.js ?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
onion7878commented, Mar 24, 2022

The problem has been solved with version 3.0.5

0reactions
onion7878commented, Mar 22, 2022

Are you bundling the main process code? I see ESM paths so I suspect this might be the case.

yes, the code is bound to the main process

I’ll try the preload script must have absolute path issue and submit a separate issue for tracking

Read more comments on GitHub >

github_iconTop Results From Across the Web

[55] Failed sending data to the peer (Send failure: Broken pipe ...
when i upload-dsym by command: sentry-cli --log-level debug ... 502 is a bad gateway error, meaning that sentry isn't responding correctly.
Read more >
Sessions | Sentry Developer Documentation
This saved file can be detected on application restart to close the session as abnormal . Errored sessions are determined by an errors...
Read more >
Close the Loop with User Feedback | Product Blog • Sentry
The User Feedback API​​ For creating a user feedback object, Sentry needs the eventId to associate the user feedback to the corresponding event....
Read more >
Integrated error tracking compatibility with Sentry SDK - GitLab
The purpose of this issue is ensure that integrated error tracking works with all major Sentry SDK. Sentry SDK, Does it work? MR's...
Read more >
Performance Sentry User Manual
The Performance Sentry. Collection Service can be used to gather information from both base Windows Server system and networking counters and extended ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found