Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating bitbucketCloud webhook results in internal server error #6292

Open
ebo-bpi opened this issue Sep 19, 2022 · 2 comments
Open

updating bitbucketCloud webhook results in internal server error #6292

ebo-bpi opened this issue Sep 19, 2022 · 2 comments

Comments

@ebo-bpi
Copy link

ebo-bpi commented Sep 19, 2022

when you try to update a bitbucketcloud webhook (repositorywebhook) the following error is thrown:
2022-09-19 21:54:59 [ERROR] internal server error (caused by: Update bitbucketcloud ***/***: bitbucketcloud.UpdateHook. Data : {"read_only":false,"description":"","links":{"self":{"href":"","name":""}},"url":"","created_at":"0001-01-01T00:00:00Z","skip_cert_verification":false,"source":"","history_enabled":false,"active":false,"subject":{"links":{"self":{"href":"","name":""},"html":{"href":"","name":""},"avatar":{"href":"","name":""}},"type":"","name":"","full_name":"","uuid":""},"type":"","events":["pullrequest:created","pullrequest:updated"],"uuid":""}: Unable to update webhook on bitbucketcloud. Status code : 400 - Body: {"type": "error", "error": {"message": "Bad request", "fields": ["Field: {io.atlassian.webhooks.config.exceptions.FieldValidationException: Required field: \"url\" is not present.field} Error: {io.atlassian.webhooks.config.exceptions.FieldValidationException: Required field: \"url\" is not present.message}"]}}. ) action=vcs.(*Service).putHookHandler action_metadata_name=bitbucketcloud action_metadata_owner=*** action_metadata_repo=herakles caller=github.com/ovh/cds/engine/service.WriteError deprecated=false handler=vcs.(*Service).putHookHandler ip_address=[::1]:40368 method=PUT request_id=2070a3c0-71c6-4d06-9d60-00599303028a request_uri=/vcs/bitbucketcloud/repos/***/***/hooks route=/vcs/<name>/repos/<owner>/<repo>/hooks source_file=/tmp/790ad7b9a1a85167593986ed564384b7/run/engine/service/http.go source_line=157 stack_trace=Unable to update webhook on bitbucketcloud. Status code : 400 - Body: {"type": "error", "error": {"message": "Bad request", "fields": ["Field: {io.atlassian.webhooks.config.exceptions.FieldValidationException: Required field: \"url\" is not present.field} Error: {io.atlassian.webhooks.config.exceptions.FieldValidationException: Required field: \"url\" is not present.message}"]}}. bitbucketcloud.UpdateHook. Data : {"read_only":false,"description":"","links":{"self":{"href":"","name":""}},"url":"","created_at":"0001-01-01T00:00:00Z","skip_cert_verification":false,"source":"","history_enabled":false,"active":false,"subject":{"links":{"self":{"href":"","name":""},"html":{"href":"","name":""},"avatar":{"href":"","name":""}},"type":"","name":"","full_name":"","uuid":""},"type":"","events":["pullrequest:created","pullrequest:updated"],"uuid":""} github.com/ovh/cds/sdk.WrapError /tmp/790ad7b9a1a85167593986ed564384b7/run/sdk/error.go:597 github.com/ovh/cds/engine/vcs/bitbucketcloud.(*bitbucketcloudClient).UpdateHook /tmp/790ad7b9a1a85167593986ed564384b7/run/engine/vcs/bitbucketcloud/client_hook.go:163 github.com/ovh/cds/engine/vcs.(*Service).putHookHandler.func1 /tmp/790ad7b9a1a85167593986ed564384b7/run/engine/vcs/vcs_handlers.go:1040 github.com/ovh/cds/engine/api.(*Router).handle.func1 /tmp/790ad7b9a1a85167593986ed564384b7/run/engine/api/router.go:445 net/http.HandlerFunc.ServeHTTP /usr/local/go/src/net/http/server.go:2084 github.com/ovh/cds/engine/api.(*Router).recoverWrap.func1 /tmp/790ad7b9a1a85167593986ed564384b7/run/engine/api/router.go:173 github.com/ovh/cds/engine/api.(*Router).setRequestID.func1 /tmp/790ad7b9a1a85167593986ed564384b7/run/engine/api/router.go:121 net/http.HandlerFunc.ServeHTTP /usr/local/go/src/net/http/server.go:2084 github.com/gorilla/handlers.CompressHandlerLevel.func1 /go/pkg/mod/github.com/gorilla/[email protected]/compress.go:143 net/http.HandlerFunc.ServeHTTP /usr/local/go/src/net/http/server.go:2084 github.com/ovh/cds/engine/api.(*Router).compress.func1 /tmp/790ad7b9a1a85167593986ed564384b7/run/engine/api/router.go:96 github.com/ovh/cds/engine/api.(*Router).pprofLabel.func1 /tmp/790ad7b9a1a85167593986ed564384b7/run/engine/api/router.go:88 net/http.HandlerFunc.ServeHTTP /usr/local/go/src/net/http/server.go:2084 github.com/gorilla/mux.(*Router).ServeHTTP /go/pkg/mod/github.com/gorilla/[email protected]/mux.go:210 net/http.serverHandler.ServeHTTP /usr/local/go/src/net/http/server.go:2916 net/http.(*conn).serve /usr/local/go/src/net/http/server.go:1966 runtime.goexit /usr/local/go/src/runtime/asm_amd64.s:1571 Update bitbucketcloud ***

@sguiheux
Copy link
Collaborator

Hi, bug spotted.
When getting the hook, just before the update, some fields are not return by bitbucket cloud

  • Description ( title in bitbucket UI)
  • Url of the webhook
  • Active flags

@ebo-bpi
Copy link
Author

ebo-bpi commented Sep 21, 2022

Super!
@sguiheux Also when using this webhook it seems it is not reacting on pullrequest:created event. only works if you use repository:push
Hope you could fix this as well....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants