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

GITHUB_TOKEN in refactor_openjdk_release_tool_new #3058

Closed
sophia-guo opened this issue May 15, 2023 · 6 comments
Closed

GITHUB_TOKEN in refactor_openjdk_release_tool_new #3058

sophia-guo opened this issue May 15, 2023 · 6 comments
Assignees

Comments

@sophia-guo
Copy link

We need to setup GITHUB_TOKEN for https://ci.adoptium.net/view/all/job/refactor_openjdk_release_tool_new/configure, details

The one set a few weeks doesn't work. https://ci.adoptium.net/view/all/job/refactor_openjdk_release_tool_new/6/console

@sxa
Copy link
Member

sxa commented May 16, 2023

I've had a look at it, tested with resetting the token, and also tested using a copy of the original release tool with the token explicitly set to the one I set in your job, and it all works ok, which suggests that the new pipeline is not correctly picking up the value in the way it is expecting.

@sophia-guo
Copy link
Author

sophia-guo commented Sep 25, 2023

I have updated the job configuration to manually add the parameter GITHUB_TOKEN as empty string instead of defining it by dsl ( which resets the value every time the jenkinsfile is executed). @sxa could you please reset the token's value, thanks!

@sophia-guo
Copy link
Author

I tried to compare the token value with the original release tool and the one I'm doing and found those two are not the same. The error message seems it is a token issue as normally 401 means "Unauthorized". So there seems be something with the credentials.

WARNING: Connector should not be changed. Please file an issue describing your use case.
Exception in thread "main" org.kohsuke.github.HttpException: {"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"}
 ...
Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.github.com/repos/adoptium/temurin20-binaries

@sophia-guo
Copy link
Author

Using the credentials --> eclipse_temurin_bot_token as suggested got error message 'Could not find credentials entry with ID ' eclipse_temurin_bot_token''. Pipeline Syntax generator generated the id with one extra space, I also tried with no space both got the same error message.

withCredentials([string(credentialsId: ' eclipse_temurin_bot_token', variable: 'secretToken')])

The interesting thing is using eclipse_aqavit_bot_token there is no space with ID name.

withCredentials([string(credentialsId: 'eclipse_aqavit_bot_token', variable: 'secretAqaToken'), string(credentialsId: ' eclipse_temurin_bot_token', variable: 'secretTemurinToken')]) {
    // some block
}

Would that be a typo error when setting the credentials? Or the credentials eclipse_temurin_bot_token setting's access control should be updated (In Manage Jenkins -> Configure Global Security, toward the middle of page there's a section called Access Control For Builds. Set the Strategy to Run as SYSTEM) ?

@sxa

@sophia-guo
Copy link
Author

Might not have sufficient permissions to access credentials eclipse_temurin_bot_token ?

@sophia-guo
Copy link
Author

Instead of using the password parameter will use credentials. Close this one.

@github-project-automation github-project-automation bot moved this from In Progress to Done in Adoptium 4Q 2023 Plan Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants