-
-
Couldn't load subscription status.
- Fork 1.7k
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nestjs
SDK Version
8.38.0
Framework Version
Node 22.6.0, @nestjs/core 10.4.8, @nestjs/apollo 12.2.1
Link to Sentry event
No response
Reproduction Example/SDK Setup
Unfortunately, I do not have a proper reproduction example, due to the nature of the bug that I'm experiencing, but here is how I have things set up.
instrument.js
import * as Sentry from '@sentry/nestjs'
import { nodeProfilingIntegration } from '@sentry/profiling-node'
import { config } from './config'
if (config.sentry.dsn != null) {
Sentry.init({
integrations: [nodeProfilingIntegration()],
...config.sentry, // This is controlled by env vars. In the failing environments, they're all the values used in documentation without any changes, except the DSN.
})
}app.module.js
import { Module, ValidationPipe } from '@nestjs/common'
import { APP_FILTER, APP_GUARD, APP_PIPE } from '@nestjs/core'
import { SentryGlobalGenericFilter, SentryModule } from '@sentry/nestjs/setup'
import { AuthenticationGuard } from './authentication/authentication.guard'
import { AuthenticationModule } from './authentication/authentication.module'
import { SupertokensExceptionFilter } from './authentication/supertokens-exception.filter'
import { AuthorizationGuard } from './authorization/authorization.guard'
import { AuthorizationModule } from './authorization/authorization.module'
import { ContextModule } from './context/context.module'
import { TypeOrmConfigModule } from './db/typeOrmConfig.module'
import { GraphQLModule } from './graphql/graphql.module'
import { HealthModule } from './health/health.module'
import { RestModule } from './rest/rest.module'
import { SuperTokensModule } from './services/superTokens/superTokens.module'
import { TransactionModule } from './utils/interceptors/transaction/transaction.module'
@Module({
imports: [
AuthenticationModule,
AuthorizationModule,
ContextModule,
GraphQLModule,
HealthModule,
RestModule,
SuperTokensModule,
TransactionModule,
TypeOrmConfigModule,
SentryModule.forRoot(),
],
providers: [
{
provide: APP_GUARD,
useClass: AuthenticationGuard,
},
{
provide: APP_GUARD,
useClass: AuthorizationGuard,
},
{
provide: APP_PIPE,
useFactory: () => new ValidationPipe({ whitelist: true }),
},
{
provide: APP_FILTER,
useClass: SupertokensExceptionFilter,
},
{
provide: APP_FILTER,
useClass: SentryGlobalGenericFilter,
},
],
})
export class AppModule {}Steps to Reproduce
Unfortunately, I cannot give proper reproduction steps, but I can describe whatt happened before, during, and after the appearance of this bug once we encountered it.
Our application was working fine and then we updated some dependencies, including @sentry/nestjs and @sentry/profiling-node. After these updates, our tests passed and the application ran locally perfectly fine. However, when deployed to our dev environment, which is hosted on Google Cloud Run, the startup probe failed to get a response. After investigating, it seemed like the application was failing to boot sometimes, or booting extremely slowly other times. We eventually narrowed down the problem to Sentry, though we're not sure how this can possibly be the case, but downgrading just the Sentry packages back to the older versions resolved the issue. We're currently pinning both package versions to 8.35.0 as that was the last version we were using that wasn't causing problems.
In my free time, I did some additional testing by changing package versions one by one to specific versions and seeing if the problem occurred. As far as my testing is concerned, @sentry/nestjs is fine no matter what version it uses, but @sentry/profiling-node causes the problem once you get to version 8.36.0 and later.
Expected Result
I expect that my application boots up normally
Actual Result
The application fails to boot, or boots extremely slowly, but only on Google Cloud Run. During troubleshooting, we placed a lot of console.log statements, including in the instrument.js file where Sentry config happens, immediately after the import statements. In the cases where the application fails to boot, nothing gets logged. In the cases where the application boots extremely slowly, it seems like importing files is taking 4x longer than usual for some reason.
Metadata
Metadata
Assignees
Labels
Projects
Status