Skip to content

atlantis unable to parse Azure Devops Webhook #5374

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

Open
MohitBairagi opened this issue Mar 3, 2025 · 2 comments
Open

atlantis unable to parse Azure Devops Webhook #5374

MohitBairagi opened this issue Mar 3, 2025 · 2 comments

Comments

@MohitBairagi
Copy link

MohitBairagi commented Mar 3, 2025

Overview of the Issue

I have configured atlantis on aks cluster with helm charts and it's running fine. Also on the other side, I configured service webhook in azure devops following all the steps mentioned in: https://www.runatlantis.io/docs/installation-guide.html
After this when I tried to test the connection between Azure DevOps and atlantis using webhook test and also by raising a PR, then it returns 400 Bad request error. Will share the logs below.

Reproduction Steps

Please follow the steps mentioned: https://www.runatlantis.io/docs/installation-guide.html and use Azure Devops as VCS.

Logs

{"level":"error","ts":"2025-03-03T16:38:34.609Z","caller":"events/events_controller.go:900","msg":"Error parsing pull data: lastMergeSourceCommit.commitID is null Request-Id=|f76264b1701cd5c59d21f7d82b88fd71.82788dc5c41fe7a3.","json":{},"stacktrace":"github.com/runatlantis/atlantis/server/controllers/events.(*VCSEventsController).respond\n\tgithub.com/runatlantis/atlantis/server/controllers/events/events_controller.go:900\ngithub.com/runatlantis/atlantis/server/controllers/events.(*VCSEventsController).HandleAzureDevopsPullRequestEvent\n\tgithub.com/runatlantis/atlantis/server/controllers/events/events_controller.go:870\ngithub.com/runatlantis/atlantis/server/controllers/events.(*VCSEventsController).handleAzureDevopsPost\n\tgithub.com/runatlantis/atlantis/server/controllers/events/events_controller.go:310\ngithub.com/runatlantis/atlantis/server/controllers/events.(*VCSEventsController).Post\n\tgithub.com/runatlantis/atlantis/server/controllers/events/events_controller.go:158\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2220\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\tgithub.com/gorilla/[email protected]/mux.go:212\ngithub.com/urfave/negroni/v3.(*Negroni).UseHandler.Wrap.func1\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:59\ngithub.com/urfave/negroni/v3.HandlerFunc.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:33\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/runatlantis/atlantis/server.(*RequestLogger).ServeHTTP\n\tgithub.com/runatlantis/atlantis/server/middleware.go:70\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/urfave/negroni/v3.(*Recovery).ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/recovery.go:210\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/urfave/negroni/v3.(*Negroni).ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:111\nnet/http.serverHandler.ServeHTTP\n\tnet/http/server.go:3210\nnet/http.(*conn).serve\n\tnet/http/server.go:2092"}
{"level":"error","ts":"2025-03-03T16:39:01.387Z","caller":"events/events_controller.go:900","msg":"Failed parsing webhook: parsing time "0001-01-01T00:00:00" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "Z07:00" Request-Id=|7ebaf04fe5d109149817d4c6d8824331.c5a26bc611c65c67.","json":{},"stacktrace":"github.com/runatlantis/atlantis/server/controllers/events.(*VCSEventsController).respond\n\tgithub.com/runatlantis/atlantis/server/controllers/events/events_controller.go:900\ngithub.com/runatlantis/atlantis/server/controllers/events.(*VCSEventsController).handleAzureDevopsPost\n\tgithub.com/runatlantis/atlantis/server/controllers/events/events_controller.go:301\ngithub.com/runatlantis/atlantis/server/controllers/events.(*VCSEventsController).Post\n\tgithub.com/runatlantis/atlantis/server/controllers/events/events_controller.go:158\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2220\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\tgithub.com/gorilla/[email protected]/mux.go:212\ngithub.com/urfave/negroni/v3.(*Negroni).UseHandler.Wrap.func1\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:59\ngithub.com/urfave/negroni/v3.HandlerFunc.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:33\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/runatlantis/atlantis/server.(*RequestLogger).ServeHTTP\n\tgithub.com/runatlantis/atlantis/server/middleware.go:70\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/urfave/negroni/v3.(*Recovery).ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/recovery.go:210\ngithub.com/urfave/negroni/v3.middleware.ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:51\ngithub.com/urfave/negroni/v3.(*Negroni).ServeHTTP\n\tgithub.com/urfave/negroni/[email protected]/negroni.go:111\nnet/http.serverHandler.ServeHTTP\n\tnet/http/server.go:3210\nnet/http.(*conn).serve\n\tnet/http/server.go:2092"}
JSON unmarshal err: &azuredevops.GitPullRequest{Links:(*map[string]azuredevops.Link)(nil), ArtifactID:(*string)(nil), AutoCompleteSetBy:(*azuredevops.IdentityRef)(nil), ClosedBy:(*azuredevops.IdentityRef)(nil), ClosedDate:(*azuredevops.Time)(nil), CodeReviewID:(*int)(nil), Commits:[]*azuredevops.GitCommitRef(nil), CompletionOptions:(*azuredevops.GitPullRequestCompletionOptions)(nil), CompletionQueueTime:(*azuredevops.Time)(nil), CreatedBy:(*azuredevops.IdentityRef)(nil), CreationDate:(*azuredevops.Time)(nil), Description:(*string)(nil), ForkSource:(*azuredevops.GitRef)(nil), IsDraft:(*bool)(nil), Labels:[]*azuredevops.WebAPITagDefinition(nil), LastMergeCommit:(*azuredevops.GitCommitRef)(nil), LastMergeSourceCommit:(*azuredevops.GitCommitRef)(nil), LastMergeTargetCommit:(*azuredevops.GitCommitRef)(nil), MergeFailureMessage:(*string)(nil), MergeFailureType:(*string)(nil), MergeID:(*string)(nil), MergeOptions:(*azuredevops.GitPullRequestMergeOptions)(nil), MergeStatus:(*string)(nil), PullRequestID:(*int)(nil), Repository:(*azuredevops.GitRepository)(0xc000655380), Reviewers:[]*azuredevops.IdentityRefWithVote(nil), RemoteURL:(*string)(nil), SourceRefName:(*string)(nil), Status:(*string)(nil), SupportsIterations:(*bool)(nil), TargetRefName:(*string)(nil), Title:(*string)(nil), URL:(*string)(nil), WorkItemRefs:[]*azuredevops.ResourceRef(nil)}

&time.ParseError{Layout:"2006-01-02T15:04:05Z07:00", Value:"0001-01-01T00:00:00", LayoutElem:"Z07:00", ValueElem:"", Message:""}

@MohitBairagi MohitBairagi added the bug Something isn't working label Mar 3, 2025
@X-Guardian X-Guardian removed the bug Something isn't working label Mar 8, 2025
@X-Guardian
Copy link
Contributor

I would suggest you ask a question in the Atlantis Slack channel regarding this: https://slack.cncf.io/

@leonardocaylent
Copy link

@MohitBairagi were you able to solve this issue?

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

No branches or pull requests

3 participants