I’m using SonarCloud with Bitbucket Cloud and some days ago I started seeing an error message wherever the SonarCloud widget is supposed to be.
The error message:
“SonarCloud authorization issue, try to reload the page”
I see it in these places:
On the “Source” page (where there is supposed to be a SonarCloud widget in the top of the page)
On pull requests where the SonarCloud metric widget is supposed to be
In the repository settings under “SonarCloud” settings
The PRs do get updated with the build status from SonarCloud and I get to the results on sonarcloud.io when clicking the status.
How do I fix this? My colleagues don’t have this issue.
I have tried signing out and in a couple of times, but it doesn’t fix it.
Can you replicate this issue across browsers? Do you see any specific errors in your browser’s DevTools console?
It works fine in Chrome (116.0.5845.110 on macOS 13), but not in Safari (16.6 on macOS 13).
I tried in a private browsing window in Safari to make sure it isn’t caused by some outdated cookies or malformed local storage in the browser, but it’s the exact same result.
Any other ideas?
Thanks for the clue on Safari. I can reproduce this on macOS 14 beta, Safari 17.0. I’ll hand this over to the right team.
We are seeing the same issue across our team.
macOS 13.4.1 (c) (22F770820d)
Safari Version 16.5.2 (18618.104.22.168.10)
Same for me, issue in Safari:
macOS Ventura 13.5.1
Safari Version 16.6 (18622.214.171.124.2)
On the same machine, it works with:
Chrome 116.0.5845.140 (Official Build) (arm64)
Thank you for the bug report and sorry for the late answer.
I’m starting to dig into this, in the meantime, if any of you could share the errors that you get in the browser console and the details of the network call that fails if any, it might be helpful to better understand the issue.
Looks like it’s this request that fails for me:
The 403 response has this payload:
"msg": "Invalid QSH"
And thanks for the screenshots, that’s really helpful!
From what I can see the referer header is truncated to only the host in Safari while it’s the full URL on other browsers and we are relying on that full value for some validation. It makes the validation fail on Safari.
I’m working on a fix to do the validation differently and make sure it’s compatible with Safari, I’ll keep you updated once I deploy a fix.
Same issue here. The problem is present in Safari but not present in Chrome, using the same account in both browsers.
We deployed a fix and now the widgets should load correctly on Safari.
Can you confirm it is working for you now?
Works as expected for me!
Looks good to me… nice work!