Closed DeviousM closed 3 weeks ago
Ok, nevermind, sorry about the trouble. The issue was that Bitbucket pipelines do not replace repository variables in the .pr_agent.toml
and tries to make the requests with the wrong key.
I'm going to leave this issue here for anyone potentially struggling with the same issue.
Hi, I am using the Bitbucket Cloud integration in the Bitbucket pipeline. Everything configured "by the book" and it feels like it should be working fine, but we're getting an
openai.AuthenticationError: Error code: 401 - {'statusCode': 401, 'message': 'Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired.'}
error for some reason.We're getting this error log (almost exactly the same every single time) in most of our reviews, however some of them pass fine, which is even weirder as it's not a configuration error then I suppose:
There are no logged errors in the Azure OpenAI admin panel, nor there's anything else seemingly suspicious.
Do you have any idea on what could it be caused by? I am slowly losing my mind over this issue as I can't seem to pinpoint any specific thing and internet is rather unhelpful when Googling this error.