openshift-pipelines / pipelines-as-code

Pipelines-as-Code for Tekton
https://pipelinesascode.com
Apache License 2.0
124 stars 81 forks source link

Controller could not refresh installation id XXXX's token #1727

Closed xinnjie closed 2 days ago

xinnjie commented 2 days ago

After tkn pac bootrap, the pipeline could not run.

Here is the log of pipelines-as-code-controller

{"level":"error","ts":"2024-07-01T00:12:56.347Z","logger":"pipelinesascode","caller":"adapter/sinker.go:32","msg":"failed to parse event: could not refresh installation id 52351764's token: received non 2xx response status \"401 Unauthorized\" when fetching https://api.github.com/app/installations/52351764/access_tokens","commit":"cb6680e","provider":"github","event-id":"47791850-3704-11ef-91f1-35e4aa515211","stacktrace":"github.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*sinker).processEventPayload\n\t/src/pkg/adapter/sinker.go:32\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*sinker).processEvent\n\t/src/pkg/adapter/sinker.go:54\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*listener).Start.listener.handleEvent.func2.1\n\t/src/pkg/adapter/adapter.go:194"}
{"level":"error","ts":"2024-07-01T00:12:56.347Z","logger":"pipelinesascode","caller":"adapter/adapter.go:196","msg":"an error occurred: could not refresh installation id 52351764's token: received non 2xx response status \"401 Unauthorized\" when fetching https://api.github.com/app/installations/52351764/access_tokens","commit":"cb6680e","provider":"github","event-id":"47791850-3704-11ef-91f1-35e4aa515211","stacktrace":"github.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*listener).Start.listener.handleEvent.func2.1\n\t/src/pkg/adapter/adapter.go:196"}

I also tried to get token manually with github-application-id and github-private-key in pipelines-as-code-secret secret and got the token successfully, so Github App should be well setup and installed in git repo.

image

tkn pac version:

> tkn pac  version
0.27.1
xinnjie commented 2 days ago

Found the reason. Local time on the server not synchroized.