stashnotifier-plugin icon indicating copy to clipboard operation
stashnotifier-plugin copied to clipboard

Calls to Bitbucket sometimes fail with com.atlassian.bitbucket.AuthorisationException error

Open idemidenko opened this issue 7 years ago • 7 comments

Plugin version - 1.11.6

Time to time notifications are failing with the next error, so Bitbucket doesn't receive such notifications:

Failed to notify Stash for commit 509950484482c15754de1cdb5aa5537d8bf318a2 ({"errors":[{"context":null,"message":"You are not permitted to access this resource","exceptionName":"com.atlassian.bitbucket.AuthorisationException"}]})

E.g. the next case is possible: the issue is reproduced in a Jenkins job build, then other builds of the same job successfully send notifications without any configuration/credential changes, then the issue is reproduced again in subsequent builds, ...

idemidenko avatar Dec 12 '17 11:12 idemidenko

Do you use external authentication provider like AD or Crowd?

scaytrase avatar Dec 12 '17 11:12 scaytrase

No

idemidenko avatar Dec 12 '17 13:12 idemidenko

I think in any case you should refer bitbucket logs to see which account had denied access, the exception comes from bitbucket

scaytrase avatar Dec 12 '17 14:12 scaytrase

I get such errors when Bitbucket cannot connect to our Crowd server, which cannot connect to AD (that`s the lack of AD). It rarely happens but it`s nagging us because the opened PR freezes in building status and cannot be merged :( It could be great if the plugin would try to connect to Bitbucket more than once time.

approximatenumber avatar Jul 26 '18 12:07 approximatenumber

@scaytrase Do you think we could introduce an extra option like failBuildOnError to fail the build in case an error occurred in the plugin? Currently such HTTP errors are just logged but the build stays successful, making it quite hard to detect this issue from the outside.

darxriggs avatar Apr 01 '19 21:04 darxriggs

@darxriggs we can, but I hope such options should come from Jenkins side (in the inversed variant, like skipErrors as soon as in pipeline we can just try..catch it).

If every plugin introduce it's own option for the same mechanics it would be strange and inconsistent.

I really see no reason in failing entire build in case of failed notification, as soon it's only notification but it's only my opinion.

How do other notification plugin resolve this issue? At least we can adopt the same approach, I think

scaytrase avatar Apr 02 '19 05:04 scaytrase

I had a look at some other plugins a while back regarding such error handling. There is no common approach visible.

darxriggs avatar Jul 07 '19 14:07 darxriggs