Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/remix
SDK Version
8.13.0
Framework Version
Remix 2.8.1
Link to Sentry event
https://adexos.sentry.io/issues/5547923468/?project=4507505661837312&query=is%3Aunresolved+issue.priority%3A%5Bhigh%2C+medium%5D&referrer=issue-stream&statsPeriod=14d&stream_index=0
SDK Setup/Reproduction Example
Steps to Reproduce
See file configurations below
Specs
Here are the specs :
- OS : Alpine 3.18.4
- Kernel : 5.15.0-87-generic
- Node version : 20.9.0
- pnpm 8.8.0
- Running on K8S
- Using an express server
- Using vite plugin for sentry
I tried to reproduce it locally with the same docker config but I do not have any errors on my side
File configurations
Here are my files :
import*asSentryfrom"@sentry/remix";/** * By default, Remix will handle hydrating your app on the client for you. * You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ * For more information, see https://remix.run/docs/en/main/file-conventions/entry.client */import{RemixBrowser,useLocation,useMatches}from"@remix-run/react";import{startTransition,useEffect}from"react";import{hydrateRoot}from"react-dom/client";Sentry.init({// @ts-ignore set from root.tsxdsn: window.ENV.SENTRY_DSN,// @ts-ignore set from root .tsxenvironment: window.ENV.SENTRY_ENV,tracesSampleRate: 1,replaysSessionSampleRate: 0.1,replaysOnErrorSampleRate: 1,integrations: [Sentry.browserTracingIntegration({
useEffect,
useLocation,
useMatches
}),Sentry.replayIntegration()]})consthydrate=async()=>{hydrateRoot(document,<RemixBrowser/>);};startTransition(()=>{hydrate();});import*asSentryfrom"@sentry/remix";Sentry.init({dsn: process.env.SENTRY_DSN,environment: process.env.SENTRY_ENV,tracesSampleRate: 1,autoInstrumentRemix: true})exportdefaultdefineConfig((env)=>{constviteEnv=loadEnv(env.mode,process.cwd(),"");return{build: {sourcemap: true},plugins: [sentryVitePlugin({authToken: viteEnv.SENTRY_AUTH_TOKEN,org: "adexos",project: "my-project",debug: true,sourcemaps: {filesToDeleteAfterUpload: ["**/*.map"]},release: {deploy: {env: viteEnv.SENTRY_ENV}}})],resolve: {alias: {'@helpers': path.resolve(__dirname,'extensions/helpers'),}}};});import{startExpressServer}from"./server/express";import"./instrumentation.server.mjs";startExpressServer();"dependencies": {
"@graphql-typed-document-node/core": "^3.2.0",
"@hookform/resolvers": "^3.4.2",
"@react-leaflet/universal-leaflet": "^1.0.1",
"@remix-run/css-bundle": "2.8.1",
"@remix-run/express": "2.8.1",
"@remix-run/node": "2.8.1",
"@remix-run/react": "2.8.1",
"@sentry/remix": "^8.13.0",
"@sentry/vite-plugin": "^2.20.1",
"@vite-pwa/assets-generator": "^0.2.4",
"axios": "^1.6.7",
"bowser": "^2.11.0",
"classnames": "^2.5.1",
"cli-boxes": "^3.0.0",
"common-tags": "^1.8.2",
"compression": "^1.7.4",
"cross-env": "^7.0.3",
"dataloader": "^2.2.2",
"dotenv": "^16.4.5",
"express": "^4.18.2",
"fbjs": "^3.0.5",
"framer-motion": "^10.18.0",
"glob": "^10.3.10",
"html-react-parser": "^5.1.8",
"isbot": "^4.4.0",
"leaflet": "^1.9.4",
"lodash": "^4.17.21",
"morgan": "^1.10.0",
"notistack": "^3.0.1",
"prop-types": "^15.8.1",
"qs": "^6.12.0",
"react": "^18.2.0",
"react-apollo": "3.1.5",
"react-dom": "^18.2.0",
"react-h5-audio-player": "^3.9.1",
"react-hook-form": "^7.51.5",
"react-intl": "6.6.2",
"react-leaflet": "^4.2.1",
"react-leaflet-cluster": "^2.1.0",
"react-text-truncate": "^0.19.0",
"remix-utils": "^7.5.0",
"sharp": "^0.33.3",
"source-map-support": "^0.5.21",
"strapi-sdk-js": "^2.3.3",
"swiper": "^11.0.6",
"tsx": "^4.7.1",
"winston": "^3.12.0",
"workbox-routing": "^7.0.0",
"workbox-window": "^7.0.0",
"zod": "^3.23.8"
}I launch the server this way : "start": "cross-env NODE_ENV=production node --import tsx/esm ./server.mjs"
What I tried
Sorry I could not reproduce it locally, but maybe you have an idea of what is going on.
I also tried with a lower version of @sentry/remix:8.0.0 instead of my @sentry/remix:8.13.0 and the same result occurs.
Not tried with a different version of the vite plugin.
Since I cannot reproduce it locally, I only checked the code regarding Sentry and open telemetry and did not find anything suspicious regarding my issue.
I linked an issue where you can see the crash happening on Sentry side (that is captured)
Expected Result
Having no error on Node side
Actual Result
The logs
I have installed Sentry properly on my local docker without any problem, evertyhing is running smoothly.
However, in production I have a problem I cannot tackle, here are the two traces that reboot the server again and again :
2024-06-28T15:32:10.725Z TypeError: number 1719588728485 is not iterable (cannot read property Symbol(Symbol.iterator))
2024-06-28T15:32:10.725Z at convertOtelTimeToSeconds (/project/node_modules/.pnpm/@sentry+opentelemetry@8.13.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.25.1_@opentelemet_jwpm2sqfekexay3qqlibo6vqxm/node_modules/@sentry/opentelemetry/src/utils/convertOtelTimeToSeconds.ts:2:41)
2024-06-28T15:32:10.725Z at createTransactionForOtelSpan (/project/node_modules/.pnpm/@sentry+opentelemetry@8.13.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.25.1_@opentelemet_jwpm2sqfekexay3qqlibo6vqxm/node_modules/@sentry/opentelemetry/src/spanExporter.ts:239:22)
2024-06-28T15:32:10.725Z at (/project/node_modules/.pnpm/@sentry+opentelemetry@8.13.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.25.1_@opentelemet_jwpm2sqfekexay3qqlibo6vqxm/node_modules/@sentry/opentelemetry/src/spanExporter.ts:140:30)
2024-06-28T15:32:10.725Z at Array.forEach ()
2024-06-28T15:32:10.725Z at maybeSend (/project/node_modules/.pnpm/@sentry+opentelemetry@8.13.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.25.1_@opentelemet_jwpm2sqfekexay3qqlibo6vqxm/node_modules/@sentry/opentelemetry/src/spanExporter.ts:137:13)
2024-06-28T15:32:10.725Z at SentrySpanExporter.flush (/project/node_modules/.pnpm/@sentry+opentelemetry@8.13.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.25.1_@opentelemet_jwpm2sqfekexay3qqlibo6vqxm/node_modules/@sentry/opentelemetry/src/spanExporter.ts:78:28)
2024-06-28T15:32:10.725Z at Timeout. (/project/node_modules/.pnpm/@sentry+opentelemetry@8.13.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.25.1_@opentelemet_jwpm2sqfekexay3qqlibo6vqxm/node_modules/@sentry/opentelemetry/src/spanExporter.ts:68:12)
2024-06-28T15:32:10.725Z at listOnTimeout (node:internal/timers:573:17)
2024-06-28T15:32:10.725Z at process.processTimers (node:internal/timers:514:7)
and
2024-06-28T15:32:11.175Z TypeError: number 1719588728485 is not iterable (cannot read property Symbol(Symbol.iterator))gst
2024-06-28T15:32:11.176Z at convertOtelTimeToSeconds (/project/node_modules/.pnpm/@sentry+opentelemetry@8.13.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.25.1_@opentelemet_jwpm2sqfekexay3qqlibo6vqxm/node_modules/@sentry/opentelemetry/src/utils/convertOtelTimeToSeconds.ts:2:41)
2024-06-28T15:32:11.176Z at shouldCleanupSpan (/project/node_modules/.pnpm/@sentry+opentelemetry@8.13.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.25.1_@opentelemet_jwpm2sqfekexay3qqlibo6vqxm/node_modules/@sentry/opentelemetry/src/spanExporter.ts:179:10)
2024-06-28T15:32:11.176Z at (/project/node_modules/.pnpm/@sentry+opentelemetry@8.13.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.25.1_@opentelemet_jwpm2sqfekexay3qqlibo6vqxm/node_modules/@sentry/opentelemetry/src/spanExporter.ts:109:26)
2024-06-28T15:32:11.176Z at Array.filter ()
2024-06-28T15:32:11.176Z at SentrySpanExporter._cleanupOldSpans (/project/node_modules/.pnpm/@sentry+opentelemetry@8.13.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.25.1_@opentelemet_jwpm2sqfekexay3qqlibo6vqxm/node_modules/@sentry/opentelemetry/src/spanExporter.ts:108:33)
2024-06-28T15:32:11.176Z at SentrySpanExporter.export (/project/node_modules/.pnpm/@sentry+opentelemetry@8.13.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.25.1_@opentelemet_jwpm2sqfekexay3qqlibo6vqxm/node_modules/@sentry/opentelemetry/src/spanExporter.ts:59:12)
2024-06-28T15:32:11.176Z at SentrySpanProcessor.onEnd (/project/node_modules/.pnpm/@sentry+opentelemetry@8.13.0_@opentelemetry+api@1.9.0_@opentelemetry+core@1.25.1_@opentelemet_jwpm2sqfekexay3qqlibo6vqxm/node_modules/@sentry/opentelemetry/src/spanProcessor.ts:98:26)
2024-06-28T15:32:11.176Z at MultiSpanProcessor.onEnd (/project/node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.25.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/src/MultiSpanProcessor.ts:58:21)
2024-06-28T15:32:11.176Z at Span.end (/project/node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.25.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/src/Span.ts:267:25)
2024-06-28T15:32:11.176Z at HttpInstrumentation._closeHttpSpan (/project/node_modules/.pnpm/@opentelemetry+instrumentation-http@0.34.0_@opentelemetry+api@1.3.0/node_modules/@opentelemetry/instrumentation-http/src/http.ts:696:10)
The application crashes here : https://github.com/getsentry/sentry-javascript/blob/develop/packages/opentelemetry/src/spanExporter.ts#L239 where the span.startTime is a full number instead of an array [number, number]
I hope you have some ideas!
Thanks you
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/remix
SDK Version
8.13.0
Framework Version
Remix 2.8.1
Link to Sentry event
https://adexos.sentry.io/issues/5547923468/?project=4507505661837312&query=is%3Aunresolved+issue.priority%3A%5Bhigh%2C+medium%5D&referrer=issue-stream&statsPeriod=14d&stream_index=0
SDK Setup/Reproduction Example
Steps to Reproduce
See file configurations below
Specs
Here are the specs :
I tried to reproduce it locally with the same docker config but I do not have any errors on my side
File configurations
Here are my files :
I launch the server this way :
"start": "cross-env NODE_ENV=production node --import tsx/esm ./server.mjs"What I tried
Sorry I could not reproduce it locally, but maybe you have an idea of what is going on.
I also tried with a lower version of
@sentry/remix:8.0.0instead of my@sentry/remix:8.13.0and the same result occurs.Not tried with a different version of the vite plugin.
Since I cannot reproduce it locally, I only checked the code regarding Sentry and open telemetry and did not find anything suspicious regarding my issue.
I linked an issue where you can see the crash happening on Sentry side (that is captured)
Expected Result
Having no error on Node side
Actual Result
The logs
I have installed Sentry properly on my local docker without any problem, evertyhing is running smoothly.
However, in production I have a problem I cannot tackle, here are the two traces that reboot the server again and again :
and
The application crashes here : https://github.com/getsentry/sentry-javascript/blob/develop/packages/opentelemetry/src/spanExporter.ts#L239 where the
span.startTimeis a full number instead of an array[number, number]I hope you have some ideas!
Thanks you