self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

Source maps are not being applied to issues

Open NgLoader opened this issue 9 months ago • 2 comments

Self-Hosted Version

25.4.0 a00823c

CPU Architecture

x86_64

Docker Version

28.1.1, build 4eba377

Docker Compose Version

2.35.1

Machine Specification

  • [x] My system meets the minimum system requirements of Sentry

Steps to Reproduce

Setup:

  • Angular (19.2.2) with Ionic (8.5.0) and Capacitorjs (7.0.0)
  • Sentry capacitor 1.2.0
  1. Set up Sentry code mappings inside GitHub Actions
- name: Install Sentry CLI
  run: npm i -g @sentry/cli --unsafe-perm

- name: Sentry upload sourcemaps
  env:
    SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
    SENTRY_ORG: "" #e.g example-company
    SENTRY_PROJECT: "" #e.g example-app
    RELEASE_VERSION: ${{ needs.setup.outputs.version }} #e.g. 1.2.7
    DIST_VERSION: ${{ needs.setup.outputs.dist }} #e.g. 184-319e204
    ENVIRONMENT_TYPE: ${{ needs.setup.outputs.environment }} #e.g. production
  run: |
    npx sentry-cli releases new "$RELEASE_VERSION"
    npx sentry-cli releases set-commits --auto "$RELEASE_VERSION"
    npx sentry-cli releases files "$RELEASE_VERSION" upload-sourcemaps ./www/browser --dist $DIST_VERSION --rewrite
    npx sentry-cli releases finalize "$RELEASE_VERSION"
    npx sentry-cli releases deploys "$RELEASE_VERSION" new -e $ENVIRONMENT_TYPE

- name: Delete sourcemaps
  run: find ./www/browser -name "*.map" -type f -delete
  1. Setup app
Sentry.init({
  dsn: isAppMode()
    ? AppConstants.URL_SENTRY_APP
    : AppConstants.URL_SENTRY_WEB,
  release: environment.version, //e.g. 1.2.7
  environment: environment.environment, //e.g. production
  dist: environment.dist, //e.g. 184-319e204

  enabled: !isDevMode(),
  sendDefaultPii: false,
  enableNative: true,
  enableNativeCrashHandling: true,
  enableNativeNagger: true,
  enableTracing: true,
  enableNdkScopeSync: true,
  enableAppHangTracking: true,
  enableAutoSessionTracking: true,
  enableCaptureFailedRequests: true,
  enableWatchdogTerminationTracking: true,

  transport: SentryAngular.makeBrowserOfflineTransport(SentryAngular.makeFetchTransport),

  integrations: [
    SentryAngular.browserTracingIntegration(),
    SentryAngular.browserProfilingIntegration(),
    SentryAngular.browserApiErrorsIntegration(),
    SentryAngular.feedbackIntegration({
      autoInject: false
    }),
    SentryAngular.breadcrumbsIntegration(),
    SentryAngular.extraErrorDataIntegration(),
    SentryAngular.linkedErrorsIntegration(),
    SentryAngular.captureConsoleIntegration({
      levels: ['error']
    }),
    SentryAngular.replayIntegration({
      maskAllText: true,
      maskAllInputs: true,
      blockAllMedia: true
    })
  ],

  // Fix: https://sentry.zendesk.com/hc/en-us/articles/26649121915291-I-m-getting-Object-captured-as-exception-with-keys
  // Issue: https://github.com/getsentry/sentry-javascript/issues/2292
  ignoreErrors: ['Object captured as exception'],

  sampleRate: 1,

  tracesSampleRate: 1,
  tracePropagationTargets: ['test.example.app', 'localhost'],

  // Session Replay
  replaysSessionSampleRate: isDevMode() ? 1 : 0.1,
  replaysOnErrorSampleRate: 1.0,

  profilesSampleRate: 1,

  // Forward the init method from @sentry/angular-ivy
  SentryAngular.init
});
  1. Throw an app error
  2. The reference couldn't be found
Image

Expected Result

Resolve the correct source mappings

Actual Result

When I open the source map myself im able to find the correct place.

Image Image Image

sentry_install_log-2025-04-21_20-07-44.txt

Event ID

No response

NgLoader avatar Apr 21 '25 22:04 NgLoader

The same issue. Sourcemaps uploaded, but not applied. Initially we had version 25.3.0. Recently we have updated to 25.4.0, but it did not help. We have another self-hosted sentry instance which is running on v24.12.1 and it is working fine.

There is a message - Stack frame path doesn't match a source file artifact name. But the release name, dist and file name in sourcemaps fully match.

Alt Text Alt Text

UPDATE: In our case the problem was in system.internal-url-prefix value in config. Sourcemaps started working after our devops changed the value from system.internal-url-prefix: 'https://{OUR_DOMAIN_NAME}/' to system.internal-url-prefix: 'http://web:9000/'

pavel-zaletski avatar Apr 26 '25 09:04 pavel-zaletski

I'm having the same issue after upgrading from 25.1.0 to 25.4.0.

pingjuh avatar Apr 30 '25 01:04 pingjuh

Hi @NgLoader @pingjuh are you still experiencing this? Can you make sure that your system.internal-url-prefix is set to http://web:9000/ as seen from the previous comments?

aldy505 avatar Oct 14 '25 04:10 aldy505

@aldy505 I skipped 25.4.0, upgraded directly to 25.7.0, and the issue is now resolved.

pingjuh avatar Oct 14 '25 04:10 pingjuh

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

getsantry[bot] avatar Nov 05 '25 08:11 getsantry[bot]