sentry icon indicating copy to clipboard operation
sentry copied to clipboard

Some users with Owner or Admin role cannot access Alerts

Open simPod opened this issue 3 years ago • 15 comments

Self-Hosted Version

22.5.0

CPU Architecture

x86_64

Docker Version

Docker version 20.10.5+dfsg1, build 55c4c88

Docker Compose Version

Docker Compose version v2.4.1

Steps to Reproduce

  1. Have Owner role
  2. Go to Alerts (/organizations/myorg/alerts/rules/)
image

There are other users with Admin or Owner role, who can access it so it's not 100% reproducible.

Expected Result

See Alerts.

Actual Result

Your role does not have the necessary permissions to access this resource, please read more about organizational roles

image

I can see xhr request sent with status code 403:

/api/0/organizations/myorg/combined-rules/?expand=latestIncident&expand=lastTriggered&sort=incident_status&sort=date_triggered&team=myteams&team=unassigned

with response body

image

simPod avatar Jul 27 '22 07:07 simPod

I guess this is related to getsentry/sentry, @ethanhs @chadwhitacre if you agree, can you migrate it to appropriate repository?

aminvakil avatar Jul 27 '22 08:07 aminvakil

@aminvakil We're selfhosting the sentry.

simPod avatar Jul 27 '22 08:07 simPod

@simPod You're right, I just don't think this error is something related to installing sentry in self-hosted repository, I think this logical error is something which should be handled in getsentry/sentry.

For example if you were getting 403 Forbidden only and not 403 You do not have permission to perform this action. then I would suspect something wrong in nginx configuration or I would help you through your setup if you had a loadbalancer, etc.

aminvakil avatar Jul 27 '22 08:07 aminvakil

Routing to @getsentry/enterprise for triage. ⏲️

getsentry-release avatar Jul 27 '22 14:07 getsentry-release

@simPod Thanks for the bug report!

That's a little odd if the page behave differently for other Owners in the organization.

An alert is a child of a project, and a project can be the child of many teams. Can you check if you're in a team that has access to the project for the alert?

leedongwei avatar Jul 31 '22 07:07 leedongwei

@leedongwei the Alerts link goes to /organizations/myorg/alerts/rules/. I'm owner of myorg.

There's no project involved. TBH I don't know where's link to project alerts or whether something like that exists. IIRC on the Alerts page there were alerts for more projects, it was all in one page grouped under the org.

simPod avatar Jul 31 '22 15:07 simPod

When I add a project id to url, I get access to the page: /organizations/datacamp/alerts/rules/?project=19

I think /organizations/myorg/alerts/rules/ needs some refinement.

simPod avatar Aug 01 '22 08:08 simPod

Also, I have selected all the teams and all the projects in Filters.

image

I still have access to the page.

But when I select all projects using the button, it gives me the earlier mentioned error

image

Your role does not have the necessary permissions to access this resource

simPod avatar Aug 01 '22 08:08 simPod

I've found removed project in db. When I manually change db row and restore the project, the issue is gone. When I then Remove the project using UI, the issue reappears.

simPod avatar Aug 01 '22 09:08 simPod

I had to remove the "last team" in the project, then Remove it.

simPod avatar Aug 01 '22 09:08 simPod

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 label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


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

github-actions[bot] avatar Aug 23 '22 00:08 github-actions[bot]

Ve w sv

On Tue, Aug 23, 2022, 02:04 github-actions[bot] @.***> wrote:

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 label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!

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

— Reply to this email directly, view it on GitHub https://github.com/getsentry/sentry/issues/37109#issuecomment-1223348206, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACQAJO56DZAW75WNLDL4JTV2QIRZANCNFSM54ZW7MNA . You are receiving this because you were mentioned.Message ID: @.***>

simPod avatar Aug 23 '22 05:08 simPod

Faced with the same issue. Sentry version 22.6.0. Installation type: community helm chart

itshevtsov avatar Aug 29 '22 15:08 itshevtsov

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 label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


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

github-actions[bot] avatar Sep 20 '22 00:09 github-actions[bot]

J

On Tue, Sep 20, 2022, 02:08 github-actions[bot] @.***> wrote:

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 label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!

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

— Reply to this email directly, view it on GitHub https://github.com/getsentry/sentry/issues/37109#issuecomment-1251694521, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACQAJPKE6JXDO7KYN4S3STV7D567ANCNFSM54ZW7MNA . You are receiving this because you were mentioned.Message ID: @.***>

simPod avatar Sep 20 '22 05:09 simPod

As an admin user, I also run into this issue. We're on self-hosted Sentry 22.9.0 // e40aded.

tomdev avatar Nov 16 '22 13:11 tomdev

This issue has label Needs More Information set -- is there any more information we can provide?

tomdev avatar Nov 17 '22 14:11 tomdev

@getsentry/enterprise Bump. Putting back on your triage queue. 🙏

chadwhitacre avatar Nov 17 '22 14:11 chadwhitacre

@simPod @itshevtsov @tomdev Apologies for the tardiness. We're looking into this.

Can you confirm that this happens for Alerts only? i.e. this doesn't happen on other tools like Discover/Performance/Releases?

leedongwei avatar Nov 18 '22 08:11 leedongwei

On behalf of @tomdev: @leedongwei I can confirm that this only happens on Alerts. I checked Discover, Performance and Releases and am able to access those.

chriszo111 avatar Nov 18 '22 11:11 chriszo111