Skip to content

Latest @sentry/profiling-node (9.28.1) not working with Node 20 Azure Function: "version `GLIBCXX_3.4.29' not found" #16561

Open
@heidemn-faro

Description

@heidemn-faro

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

9.28.1

Framework Version

Azure Function with Node v20

Link to Sentry event

No response

Reproduction Example/SDK Setup

import * as Sentry from "@sentry/node";
import { nodeProfilingIntegration } from "@sentry/profiling-node";
import { version } from "./version";

// When DSN is undefined, Sentry just ignores all calls
const SENTRY_DSN = process.env.SENTRY_DSN || undefined;

export function getReleaseSemver(): string {
	return `OURAPP-functions@${version}`;
}

Sentry.init({
	dsn: SENTRY_DSN,
	integrations: [nodeProfilingIntegration()],
	// Tracing
	tracesSampleRate: 1.0, // Capture 100% of the transactions

	// Set sampling rate for profiling - this is relative to tracesSampleRate
	profilesSampleRate: 1.0,

	// Set the release version
	release: getReleaseSemver(),
});

Steps to Reproduce

package.json:

{
	"name": "OURAPP-functionapp",
	"version": "1.0.0",
	"description": "",
	"main": "dist/src/functions/*.js",
	"private": true,
	"scripts": {
		"#####  postinstall  #####": "# We use 'npx' so we can use 'pnpm install --prod' to install only production dependencies.",
		"postinstall": "npx --yes [email protected] && pnpm run genversion",
		"genversion": "(echo \"// Generated file: pnpm run genversion\" && echo \"export const version = \\\"$(jq -r .version < package.json)+$(git rev-parse --short HEAD)\\\";\") > ./src/version.ts",
		"prebuild": "pnpm run clean && pnpm run genversion",
		"build": "tsc && rm -r dist/tests",
		"clean": "rm -rf dist",
		"watch": "tsc -w",
		"check-updates": "npx npm-check-updates",
		"prestart": "pnpm run build",
		"start": "func start --typescript --cors \"*\"",
		"test": "jest --runInBand",
		"test:watch": "jest --runInBand --watch",
		"test:ci": "jest --runInBand --ci --coverage --coverageReporters=cobertura --reporters=default --reporters=jest-junit",
		"lint": "eslint --fix --max-warnings 0 .",
		"lint:ci": "eslint --max-warnings 0 .",
		"install-azure-cli-ubuntu": "echo 'Installing Azure CLI. This should work at least for Ubuntu >= 20.04.' && curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash",
		"all": "pnpm run lint && pnpm run build && pnpm run test",
		"pack-zip": "rm -rf node_modules/ && pnpm install --prod --frozen-lockfile --node-linker=hoisted && zip -r -9 OURAPP-functionapp.zip dist node_modules package.json host.json",
		"sentry:sourcemaps": "SENTRY_RELEASE=$(node -e 'const { getReleaseSemver } = require(\"./dist/src/sentry.js\"); console.log(getReleaseSemver());' 2>/dev/null) && sentry-cli sourcemaps inject --org OURCORP --project OURAPP-functions ./dist && sentry-cli sourcemaps upload --org OURCORP --project OURAPP-functions --release $SENTRY_RELEASE ./dist"
	},
	"dependencies": {
		"@azure/functions": "^4.7.3",
		"@sentry/node": "^9.28.1",
		"@sentry/profiling-node": "^9.28.1",
		"dotenv": "^16.5.0",
		"jsonwebtoken": "^9.0.2",
		"jwks-rsa": "^3.2.0",
		"openpgp": "6.1.1",
		"three": "^0.177.0"
	},
	"devDependencies": {
		"@eslint/eslintrc": "^3.3.1",
		"@eslint/js": "^9.28.0",
		"@jest/globals": "^30.0.0",
		"@openpgp/web-stream-tools": "^0.1.3",
		"@sentry/cli": "^2.46.0",
		"@types/jsonwebtoken": "^9.0.9",
		"@types/node": "^24.0.0",
		"@types/three": "^0.177.0",
		"@typescript-eslint/eslint-plugin": "^8.34.0",
		"@typescript-eslint/parser": "^8.34.0",
		"eslint": "^9.28.0",
		"globals": "^16.2.0",
		"jest": "^29.7.0",
		"jest-junit": "^16.0.0",
		"nock": "^14.0.5",
		"ts-jest": "^29.3.4",
		"typescript": "^5.8.3"
	},
	"overrides": {},
	"engines": {
		"node": ">=20.0.0"
	},
	"packageManager": "[email protected]"
}

azure-pipelines.yml:

  # Azure Functions Deploy v2
  # Update a function app with .NET, Python, JavaScript, PowerShell, Java based web applications.
  - task: AzureFunctionApp@2
    inputs:
      connectedServiceNameARM: '${{ parameters.connectedServiceNameARM }}'  # string. Alias: azureSubscription. Required. Azure Resource Manager connection.
      appType: 'functionAppLinux'  # 'functionApp' | 'functionAppLinux'. Required. App type.
      appName: '${{ parameters.appName }}'  # string. Required. Azure Functions App name.
      package: '$(Pipeline.Workspace)/OURAPP-functionapp.zip'  # string. Required. Package or folder. Default: $(System.DefaultWorkingDirectory)/**/*.zip.
      runtimeStack: 'NODE|20'  # 'DOTNET|6.0' | 'DOTNET-ISOLATED|6.0' | 'DOTNET-ISOLATED|7.0' | 'DOTNET-ISOLATED|8.0' | 'JAVA|8' | 'JAVA|11' | 'JAVA|17' | 'JAVA|21' | 'NODE|14' | 'NODE|16' | 'NODE|18' | 'NODE|20' | 'PYTHON|3.8' | 'PYTHON|3.9' | 'PYTHON|3.10' | 'PYTHON|3.11'. Optional. Use when appType = functionAppLinux. Runtime stack.

Expected result (working fine with Sentry 9.14.0):
Function app is deployed and running.
Since 9.28.1 differs in minor version only, I would not expectthe following breaking change:

Actual result (broken with Sentry 9.28.1):
Function app is deployed, but returns header-only 404 responses. SSH into the function reveals this error:

root@HOSTNAME:~/site/wwwroot/dist/src# node functions/health.js

node:internal/modules/cjs/loader:1651
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/site/wwwroot/node_modules/@sentry-internal/node-cpu-profiler/lib/sentry_cpu_profiler-linux-x64-glibc-115.node)
    at Module._extensions..node (node:internal/modules/cjs/loader:1651:18)
    at Module.load (node:internal/modules/cjs/loader:1275:32)
    at Module._load (node:internal/modules/cjs/loader:1096:12)
    at Module.require (node:internal/modules/cjs/loader:1298:19)
    at require (node:internal/modules/helpers:182:18)
    at importCppBindingsModule (/home/site/wwwroot/node_modules/@sentry-internal/node-cpu-profiler/lib/index.js:124:28)
    at Object.<anonymous> (/home/site/wwwroot/node_modules/@sentry-internal/node-cpu-profiler/lib/index.js:167:38)
    at Module._compile (node:internal/modules/cjs/loader:1529:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
    at Module.load (node:internal/modules/cjs/loader:1275:32) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v20.19.1

Expected Result

Function app is deployed and running with Node v20 Azure Function.

Actual Result

See error above - it seems that the pre-built binaries are not compatible with Node v20 Azure Functions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions