Unable to create a GitHub token for the installation #433
Unanswered
NewRunner2023
asked this question in
Q&A
Replies: 1 comment
-
Sorry for the late answer. First a Also, the PEM file contains new lines and you shouldn't put everything on the same line. Copy the exact content of the PEM file and add a See the documentation here: https://quarkiverse.github.io/quarkiverse-docs/quarkus-github-app/dev/create-github-app.html#_initialize_the_configuration . |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was following the instructions here: https://www.youtube.com/watch?v=39fl9Lusazo
"GitHub Automation with Quarkus by Guillaume Smet and Yoann Rodière"
and https://quarkiverse.github.io/quarkiverse-docs/quarkus-github-app/dev/create-github-app.html (this is where I got the fields that should be in the .env file from).
I have
I can see:
Exception: java.lang.IllegalStateException: Unable to create a GitHub token for the installation 5724
at io.quarkiverse.githubapp.runtime.github.GitHubService$CreateInstallationToken.load(GitHubService.java:167)
at io.quarkiverse.githubapp.runtime.github.GitHubService$CreateInstallationToken.load(GitHubService.java:156)
at com.github.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$3(LocalLoadingCache.java:197)
….
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.kohsuke.github.HttpException: {"message":"A JSON web token could not be decoded","documentation_url":"https://docs.github.com/rest"}
at org.kohsuke.github.GitHubConnectorResponseErrorHandler$1.onError(GitHubConnectorResponseErrorHandler.java:62)
at org.kohsuke.github.GitHubClient.detectKnownErrors(GitHubClient.java:472)
at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:434)
at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:403)
at org.kohsuke.github.Requester.fetch(Requester.java:85)
at org.kohsuke.github.GitHub.getApp(GitHub.java:1169)
at io.quarkiverse.githubapp.runtime.github.GitHubService$CreateInstallationToken.load(GitHubService.java:161)
It was suggested that maybe the problem is with the private key generated from the GitHub app.
To be honest I am not sure if I am using it correctly.
I downloaded the .pem file, and then used some Java code to extract the private key text from it.
Something like:
My .env file looks like
I know that https://quarkiverse.github.io/quarkiverse-docs/quarkus-github-app/dev/create-github-app.html has the QUARKUS_GITHUB_APP_PRIVATE_KEY spread over more than one line, but I tried this and Quarkus still started fine and I still got this error message about being unable to create a GitHub token.
When quarkus starts up and I go to my repo and make an incident I can see:
The stack trace comes after this.
If there is a problem with the QUARKUS_GITHUB_APP_PRIVATE_KEY value, I have noticed that Quarkus does not start. For example if you put double quotes around the value, or you have extra "" in it for carriage returns.
Where do I put the JSON web token ?
I went to https://docs.github.com/rest because it was mentioned in the stack trace, but I cannot find anything there about GitHub apps and JSON tokens.
Best Regards,
Trish.
Beta Was this translation helpful? Give feedback.
All reactions