jenkins-x / jx

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton
https://jenkins-x.io/
Apache License 2.0
4.56k stars 786 forks source link

failed to parse webhook : invalid webhook signature,"time:2021-04-22T06:10:40Z" } #7702

Open vaibhavbhade opened 3 years ago

vaibhavbhade commented 3 years ago

we got this error on octent logs in lighthouse webhooks :- 500 Internal server error: failed parse webhook:Invalid webhook signature", "response":"internal server error:failed parse webhook: Invalid webhook signature","status code":500

In BitbucketRequest header we got this :-

X-Event-Key repo:push
X-Hook-UUID d1009b0a-5802-4044-83e9-3292239a5eda
X-B3-SpanId 80e86faea90d95da
X-Event-Time Thu, 22 Apr 2021 06:15:55 GMT
User-Agent Bitbucket-Webhooks/2.0
X-B3-Sampled 1
X-B3-TraceId 80e86faea90d95da
X-Attempt-Number 3
X-Request-UUID c93bd5f5-87ef-45b6-a6cd-7eddf1d5fa84
Content-Type application/json

Screenshot (6)

and also when we try to update a Webhook using update command the then we got this error :

rror: failed to update webhooks for Owner: * and Repository: nodetesting in git server: https://bitbucket.org: failed to create webhook "http:/ /hook-jx.nip.io/hook" on repository ' /nodetesting': http status 403: Forbidden

sagarj1 commented 3 years ago

This is a problem in bitbucket cloud seems lighthouse is not able to parse the payload coming from bitbucketcloud

vbehar commented 3 years ago

bitbucket cloud doesn't support secrets (yet), see https://jira.atlassian.com/browse/BCLOUD-14683 but this feature should be disabled by default if you're using lighthouse in jx3, see https://github.com/jenkins-x/jx3-versions/pull/2127

how is your lighthouse installed/configured?

Tyagi0502 commented 3 years ago

We're facing the same problem. Push event in repository is successfully parsed by lighthouse. But, all other events that include creation of pull requests and comments return 500 errors. I've seen 500 & 502 depending on the type of event.

vbehar commented 3 years ago

@Tyagi0502 and what do you have in lighthouse logs? if you need more interactive support, you can come to the Jenkins X slack channel: https://jenkins-x.io/community/#slack

mikhailznak commented 2 years ago

The same issue. Did you find smth or can recommend?

ankitm123 commented 2 years ago

Taking a look, hitting a similar issue on the bootjob when it tries to create webhooks for the cluster git repo (403 forbidden).

ankitm123 commented 2 years ago

/assign

ankitm123 commented 2 years ago

Taking a look, hitting a similar issue on the bootjob when it tries to create webhooks for the cluster git repo (403 forbidden).

This (403 forbidden error) was unrelated to jx, my app password did not have access to read and create issue. This was the error:

{"message": "Your credentials lack one or more required privilege scopes.", "detail": {"granted": ["webhook", "pullrequest:write", "repository:admin", "project:write"], "required": ["issue"]}}}
saikatharryc commented 1 year ago

Taking a look, hitting a similar issue on the bootjob when it tries to create webhooks for the cluster git repo (403 forbidden).

This (403 forbidden error) was unrelated to jx, my app password did not have access to read and create issue. This was the error:

{"message": "Your credentials lack one or more required privilege scopes.", "detail": {"granted": ["webhook", "pullrequest:write", "repository:admin", "project:write"], "required": ["issue"]}}}

This is different, it does not work even if i give it all the permission possible