This repository was archived by the owner on Sep 17, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
Unhandled "StopProfiling: Stopping Sentry profile did not return a profile" errors #196
Copy link
Copy link
Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/profiling-node/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/profiling-node/releases
How do you use Sentry?
Sentry Saas (sentry.io)
SDK Version
@sentry/* - 7.66.0, @sentry/profiling-node - 1.2.0
Link to Sentry event
https://guardz.sentry.io/issues/4452503110/events/9e36fc80170045e191ab84ebfb12db22/?project=6674202
What environment is your node script running in?
TS - Node.js, Nest.js, Express (all latest)
How is your code deployed and bundled?
dockerfile, installing and building
Steps to Reproduce
For some reason it doesn't reproduce locally, only in prod.
init:
import * as Sentry from '@sentry/node';
import * as Tracing from '@sentry/tracing';
import { RewriteFrames } from '@sentry/integrations';
import { ProfilingIntegration } from '@sentry/profiling-node';
Sentry.init({
dsn: xxx,
environment:'production',
integrations: [
new RewriteFrames({
root: '/app',
}),
new Sentry.Integrations.Http({ tracing: true }),
new Tracing.Integrations.Express({
app: httpAdapter.getInstance(),
}),
new ProfilingIntegration(),
],
tracesSampler: (samplingContext) => {
if (samplingContext.request?.url?.includes('/health')) {
return 0;
}
return 0.2;
},
profilesSampleRate: 1.0,
});worker (short version):
import * as Sentry from '@sentry/node';
import { OnWorkerEvent } from '@nestjs/bullmq';
import { Job } from 'bullmq';
export default class EventListenerWorker{
private transaction: Sentry.Transaction;
async process(job: Job): Promise<unknown> {
return { success: true}
}
@OnWorkerEvent('active')
onActive(job: Job) {
this.transaction = Sentry.startTransaction({ op: 'worker', name: job.queueName, sampled: true });
}
@OnWorkerEvent('completed')
async onCompleted() {
this.transaction.finish();
}
@OnWorkerEvent('failed')
async onFailed() {
this.transaction.finish();
}
}Expected Result
end the transaction successfully.
Actual Result
We are getting lots of unhandled errors:
Error: StopProfiling: Stopping Sentry profile did not return a profile. │
at Object.stopProfiling (/app/node_modules/@sentry/profiling-node/lib/index.js:17507:39) │
at stopTransactionProfile (/app/node_modules/@sentry/profiling-node/lib/index.js:17866:39) │
at Timeout._onTimeout (/app/node_modules/@sentry/profiling-node/lib/index.js:17980:29) │
at listOnTimeout (node:internal/timers:569:17) │
at process.processTimers (node:internal/timers:512:7) { │
code: 'NAPI_ERROR' │
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Fields
Give feedbackNo fields configured for issues without a type.