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

"invalid key" for all job urls #2111

Closed
syphernl opened this issue Mar 3, 2022 · 8 comments
Closed

"invalid key" for all job urls #2111

syphernl opened this issue Mar 3, 2022 · 8 comments
Labels
bug Something isn't working provider/gitlab

Comments

@syphernl
Copy link
Contributor

syphernl commented Mar 3, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

With the latest Atlantis Gitlab jobs are now properly reported individually. When clicking on an entry this leads to Atlantis, with an entry like:

https://atlantis.example.coom/jobs/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx

The console on the webpage however is empty. On the Atlantis server I can see an error occurring as soon as I hit the link.

Reproduction Steps

  • Run a job via Gitlab
  • Click one of the pipelines created
  • See webpage with empty console
  • See error on Atlantis console (Docker)

Logs

Logs
{"level":"error","ts":"2022-03-03T15:17:20.273+0100","caller":"logging/simple_logger.go:161","msg":"invalid key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx","json":{},"stacktrace":"github.com/runatlantis/atlantis/server/logging.(*StructuredLogger).Log\n\tgithub.com/runatlantis/atlantis/server/logging/simple_logger.go:161\ngithub.com/runatlantis/atlantis/server/controllers.(*JobsController).respond\n\tgithub.com/runatlantis/atlantis/server/controllers/jobs_controller.go:67\ngithub.com/runatlantis/atlantis/server/controllers.(*JobsController).GetProjectJobsWS\n\tgithub.com/runatlantis/atlantis/server/controllers/jobs_controller.go:60\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2047\ngithub.com/gorilla/mux.(*Router).ServeHTTP\n\tgithub.com/gorilla/[email protected]/mux.go:210\ngithub.com/urfave/negroni.Wrap.func1\n\tgithub.com/urfave/[email protected]/negroni.go:46\ngithub.com/urfave/negroni.HandlerFunc.ServeHTTP\n\tgithub.com/urfave/[email protected]/negroni.go:29\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\tgithub.com/urfave/[email protected]/negroni.go:38\ngithub.com/runatlantis/atlantis/server.(*RequestLogger).ServeHTTP\n\tgithub.com/runatlantis/atlantis/server/middleware.go:68\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\tgithub.com/urfave/[email protected]/negroni.go:38\ngithub.com/urfave/negroni.(*Recovery).ServeHTTP\n\tgithub.com/urfave/[email protected]/recovery.go:193\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\tgithub.com/urfave/[email protected]/negroni.go:38\ngithub.com/urfave/negroni.(*Negroni).ServeHTTP\n\tgithub.com/urfave/[email protected]/negroni.go:96\nnet/http.serverHandler.ServeHTTP\n\tnet/http/server.go:2879\nnet/http.(*conn).serve\n\tnet/http/server.go:1930"}

Environment details

Additional Context

@syphernl syphernl added the bug Something isn't working label Mar 3, 2022
@chenrui333
Copy link
Member

cc @jvrplmlmn Any idea?

@jvrplmlmn
Copy link
Contributor

Unfortunately not, we are running Atlantis on GitHub, not on GitLab, so unsure how to reproduce this one.

We are hitting #2026 (or a variant of) for the empty console, which seems different than this issue, but might be tangentially related.

With the latest Atlantis

Are you referring to :latest or to the latest release (if so, which one?)?

@syphernl
Copy link
Contributor Author

syphernl commented Mar 7, 2022

Unfortunately not, we are running Atlantis on GitHub, not on GitLab, so unsure how to reproduce this one.

@jvrplmlmn It's odd that this would work on GitHub but not on GitLab, or is job generation/validation tied to platforms?

Are you referring to :latest or to the latest release (if so, which one?)?

This is happening on v0.18.5 but also in 0.19.1.

@miguelaferreira
Copy link

miguelaferreira commented Mar 31, 2022

This is also happening on GitHub, and on atlantis 0.19.2.
When I click the running job status I get an empty atlantis console window and an "invalid key" atlantis log statement (like it is reported in this issue). If I then inspect the browser console, I see the same error as reported in #2129.

@judgeaxl
Copy link

Could there be a clue in that the callstack contains GetProjectJobsWS() even though it should call GetProjectJobs() when not used with a workspace, and when the url doesn't end in /ws?

	s.Router.HandleFunc("/jobs/{job-id}", s.JobsController.GetProjectJobs).Methods("GET").Name(ProjectJobsViewRouteName)
	s.Router.HandleFunc("/jobs/{job-id}/ws", s.JobsController.GetProjectJobsWS).Methods("GET")

@syphernl
Copy link
Contributor Author

With Atlantis 0.19.8 I can now see output on the jobs/xxxxxxxxxxxx endpoints! No more "invalid key" errors.

@michyliao
Copy link

I am running 0.19.8 and still seeing the invalid key error. I am running atlantis on GCP's GKE.

@yeoli9
Copy link

yeoli9 commented Nov 21, 2024

hello. please set local execution mode

After applying ATLANTIS_TFE_LOCAL_EXECUTION_MODE=true we are able to see the logs.
we hope you.

ref
[1] https://www.runatlantis.io/docs/server-configuration#tfe-local-execution-mode
[2] https://www.runatlantis.io/docs/terraform-cloud#passing-the-token-to-atlantis
[3] 스크린샷 2024-11-21 15 58 16
[4] 스크린샷 2024-11-21 16 00 48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working provider/gitlab
Projects
None yet
Development

No branches or pull requests

8 participants