Sentry: endpoint in error-page-embed.js does not respect system.url-prefix

Created on 11 Jul 2019  路  3Comments  路  Source: getsentry/sentry

Important Details

How are you running Sentry?

  • [x ] On-Premise docker [9.1.1]

    Description

using raven-js with angular works as expected to capture exceptions.
when reporting errors we get the wrong endpoint from the sentry instance

javascript snippet:

Raven
  .config(`https://${environment.sentryKey}@MY_INSTANCE/PROJECT_NUMBER`,
    {
      environment: environment.production ? 'prod' : 'dev',
      release: versions.version
    }
  )
  .install();

export class RavenErrorHandler implements ErrorHandler {
  handleError(error: any): void {
    const err = error.originalError || error;
    console.error(err);
    Raven.captureException(err);
    if (true) {
      // fetches error-page-embed.js from sentry instance with wrong endpoint (docker endpoint)
      Raven.showReportDialog();
    }
  }
}

this end point is set here: https://github.com/getsentry/sentry/blob/master/src/sentry/web/frontend/error_page_embed.py

# using request.build_absolute_uri() instead of the value of system.url-prefix 'endpoint':  

mark_safe('*/' + json.dumps(request.build_absolute_uri()) + ';/*'),

Steps to Reproduce

web:9000 is the hostname of the docker container
screenshot3

What you expected to happen

system.url-prefix in config.yaml: error-page-embed.js should be respected

cc/ @max-wittig

Most helpful comment

@deveaud-m - ah, sorry. I'll look into this as soon as possible. Thanks for trying 9.1.2 :)

All 3 comments

This was a bug in the initial setup screen in 9.1.1 which was fixed in 9.1.2 now. If you set the system.url-prefix yourself afterward, this should go away.

Are you able to try this and also 9.1.2 just in case?

@BYK we just tried this with 9.1.2 but unfortunately the error still persist even if we set the system.url-prefix correctly.

The URI is build using the Django request method build_absolute_uri() which returns the hostname of the Docker container instead of the configured system URL.

@deveaud-m - ah, sorry. I'll look into this as soon as possible. Thanks for trying 9.1.2 :)

Was this page helpful?
0 / 5 - 0 ratings