Skip to content

Sentry Giving error while getting issues "CSRF Verification Failed" #2265

@devops-tavus

Description

@devops-tavus

Self-Hosted Version

2.19.4

CPU Architecture

86_64

Docker Version

20.10.16 I am installing directly on docker

Docker Compose Version

2.6.0

Steps to Reproduce

My version is 21.10.0

https://*****.us/organizations/entry/issues/?project=1&referrer=sidebar

Expected Result

{id:******}

Actual Result

[ERROR] sentry_sdk.errors: Unexpected status code: 403 (body: b' <title>CSRF Verification Failed | Sentry</title> <script>window.__initialData = {"customerdomain":null,"singleorganization":true,"supportemail":"devops@xyz.com","urlPrefix":"https://sentry.xyz.us","version":{"current":"23.6.2","latest":"23.6.2","build":"23.6.2","upgradeAvailable":false},"features":[],"distPrefix":"/_static/dist/sentry/","needsUpgrade":false,"dsn":"https://56edae4cdcff4212b853279991ec98a9@sentry.xyz.us/1","statuspage":null,"messages":[],"apmSampling":0.0,"isOnPremise":true,"isSelfHosted":true,"invitesEnabled":true,"gravatarBaseUrl":"https://secure.gravatar.com","termsUrl":null,"privacyUrl":null,"lastOrganization":null,"languageCode":"en","userIdentity":{"ip_address":"3.140.64.139"},"csrfCookieName":"sc","superUserCookieName":"su","superUserCookieDomain":null,"sentryConfig":{"dsn":"https://56edae4cdcff4212b853279991ec98a9@sentry.xyz.us/1","release":"frontend@23.6.2","environment":"production","whitelistUrls":[],"allowUrls":[],"tracePropagationTargets":[]},"demoMode":false,"enableAnalytics":false,"validateSUForm":true,"disableU2FForSUForm":false,"links":{"organizationUrl":null,"regionUrl":null,"sentryUrl":"https://sentry.xyz.us"},"isAuthenticated":false,"user":null};</script> <script>// if the ads.js file loads below it will mark this variable as false window.adblockSuspected = true; // Initialize this so that we can queue up tasks when Sentry SPA is initialized window.__onSentryInit = window.__onSentryInit || [];</script> <script>try { var reg = new RegExp(/\/organizations\/(.+?(?=(\/|$)))(\/|$)/, 'i'); var organization = window.location.pathname; var slug = organization.match(reg)[1]; function promiseRequest(url) { return new Promise(function (resolve, reject) { var xhr = new XMLHttpRequest(); xhr.open('GET', url); xhr.onload = function () { try { this.status >= 200 && this.status < 300 ? resolve([JSON.parse(xhr.response), this.statusText, xhr]) : reject([this.status, this.statusText]); } catch (e) { reject(); } }; xhr.onerror = function () { reject([this.status, this.statusText]); }; xhr.send(); }); } function makeUrl(suffix) { return '/api/0/organizations/' + slug + suffix; } // There are probably more, but this is at least one case where // this should not be treated as a slug if (slug !== 'new') { var preloadPromises = {orgSlug: slug}; window.__sentry_preload = preloadPromises; preloadPromises.organization = promiseRequest(makeUrl('/?detailed=0')); preloadPromises.projects = promiseRequest( makeUrl('/projects/?all_projects=1&collapse=latestDeploys') ); preloadPromises.teams = promiseRequest(makeUrl('/teams/')); } } catch (_) {}</script> <script src="/_static/dist/sentry/entrypoints/app.js"></script> <script src="/_static/1689156416/sentry/js/ads.js"></script>

<script>window.__onSentryInit = window.__onSentryInit || []; window.__onSentryInit.push({ name: 'renderReact', component: 'SystemAlerts', container: '#blk_alerts', props: { className: 'alert-list', }, }); window.__onSentryInit.push({ name: 'renderReact ', component: 'Indicators', container: '#blk_indicators', props: { className: 'indicators-container', }, });</script>

CSRF Verification Failed

A required security token was not found or was invalid.

If you're continually seeing this issue, try the following:

  1. Clear cookies (at least for Sentry's domain).
  2. Reload the page you're trying to submit (don't re-submit data).
  3. Re-enter the information, and submit the form again.
  4. Ensure the URL does not contain an extra \t"/" anywhere (eg: https://foo//saml -> https://foo/saml).

Read more about CSRF on Wikipedia.

<script>document.addEventListener('DOMContentLoaded', function() { const el = document.querySelector('#sign-out'); if (el) { el.addEventListener('click', function() { document.modalLogoutForm.submit(); }); } });</script> ')

Event ID

ERROR sentry_sdk.errors: Unexpected status code: 403

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Community

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions