Open In App

What Is Jenkins Returned Status Code 128 With BitBucket ?

Last Updated : 26 Feb, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Jenkins, an open-source automation server, performs a crucial role in continuous integration and continuous delivery (CI/CD) processes. It can be integrated with version control systems like GitHub to automate the development, testing, and deployment of software projects. However, when you face status code 128 while interacting with GitHub through Jenkins, it can be a puzzling problem. In this article, we will explore what this status code means, its potential causes, and steps to troubleshoot and resolve this issue.

What are Status Code 128 ?

A status code 128 in the context of Jenkins and GitHub normally indicates the issue faced during authentication or authorization. GitHub uses personal access tokens, SSH keys, or username/password combos for authentication, and any failure in this process generally leads to the status code 128 which must be resolved for proper functioning.

What are the Causes for Status Code 128

1. Incorrect Credentials

  • Ensure that the credentials used in Jenkins for GitHub access are correct and valid. This consists of personal access tokens, SSH keys, or username/password combinations.
  • Check for typos or discrepancies in the credentials, as even a small error can cause authentication failures.

2. Token Expiry

  • GitHub private access tokens have an expiration period. If the token used by Jenkins has expired, it’ll bring an authentication issue.
  • Regularly update and rotate personal access tokens to avoid expiration-related issues.

3. Insufficient Permissions

  • Verify that the account associated with the provided credentials has the necessary permissions to access to the repositories and perform the required action on it.
  • GitHub repository permissions would possibly have changed, to make sure the Jenkins user has the required access.

4. Firewall or Proxy Issues

  • Network configurations, firewalls, or proxy settings are probably blocking Jenkins from reaching GitHub.
  • Ensure that the necessary ports are open and they do not have any network restrictions.

Prerequisites

Before troubleshooting Jenkins status code 128 with GitHub, make sure the following conditions are met:

  • Jenkins Installation: Jenkins should be set up and configured effectively on your server. Follow the official documents for set up or Installation Process.
  • GitHub Account: You need a GitHub account with access to the repositories that are involved with your Jenkins job.
  • Jenkins Credentials: Verify that the GitHub credentials in Jenkins are correctly configured with the personal access token or appropriate authentication method.
  • Network Access: Ensure that the Jenkins server has proper network access to reach GitHub. Check firewall and proxy configurations to avoid network-associated issues.
  • Repository Permissions: Confirm that the Jenkins user or the consumer related to the credentials has the specified permissions (Read, Write) within the GitHub repositories.

How to resolve Jenkins returned status code 128 with GitHub

You might be facing this returned status code 128 with GitHub in Jenkins

status-code-128

Status Code 128

To resolve this issue follow these steps:

Step 1: Create App Password

Go to the personal settings and then click on the app passwords.

click-on-create-app-password

click on create app password

Give all the necessary permission, and then click on the Create button.

give-all-necessary-description

give all necessary description

App password will get generate, copy this password.

new-app-password

new app password

Step 2: Go to the Jenkins

Again go the same page where you facing status code 128 error, then add Jenkins in the credential section.

add-jenkins

add Jenkins

After that add username, description, but in the password block paste the app code which was generated in previous step after that click on add button.

add-credential

add credential

Step 3: Save the changes

You can save the changes by clicking on the apply button.

click-on-apply

click on apply

Step 4: Verify if the error is resolved or not

After saving the changes, now click on build now button and check the output console.

click-on-build-now

click on build now

resolved-status-code-128

output console

You have successfully have resolved the status code 128 with github in jenkins.

Troubleshooting Common Issue with Status Code 128

You can itself troubleshoot the common issues that occur with status code 128 by these following points:

1. Check Jenkins user permissions:

You must verify first that the user Jenkins have read access to the necessary Git configuration files. Access permission issues sometimes cause this error.

2. Check Jenkins logs

Look for detailed error messages in the Jenkins logs ,you can generally find it under Manage Jenkin section ( “Manage Jenkins” -> “System Information” -> “Logs”). This might can provide clue about the connection issue

3. SSH key issues

If you’re using SSH authentication, make sure that the key configured in Jenkins matches with the authorized key in your GitHub account. Incorrect or missing keys can lead to status code 128.

4. Network connectivity:

Make sure Jenkins have network access to GitHub. Firewall restrictions or network issues may impact the connection.

Conclusion

If you are encountering Jenkins returned status code 128 with GitHub it can be a problematic issue, but by understanding the main reasons behind it and following the troubleshooting steps mentioned in this article, you could successfully address and solve the authentication or authorization problems. Maintaining proper credentials, staying aware of token expirations, and verifying permissions are key practices to make certain a smooth integration between Jenkins and GitHub for your CI/CD pipelines.

What is Jenkins returned status code 128 with github – FAQ’s

What is Jenkins status code 128?

Jenkins status code 128 commonly shows an issue associated with authentication or authorization while interacting with GitHub. It usually arises because of wrong credentials, expired tokens, or insufficient permissions.

How can I check the Jenkins console output for error?

In your Jenkins job or pipeline, navigate to the job’s page and then select “Console Output.” Now search for any errors messages, warnings, or stack traces that might offer insights about the status code 128 issue.

What GitHub permissions does Jenkins require?

Jenkins normally needs read and write access to repositories for CI/CD process. The exact permissions mainly depend on the actions your Jenkins job performs, such as cloning repositories, pushing changes, or creating releases.

Can network issues can be the reason of the status code 128?

Yes, network configurations, firewalls, or proxy settings may additionally block Jenkins from reaching GitHub, leading to status code 128. Ensure proper network access and troubleshoot if any restiction.

Why personal access token expires?

GitHub personal access tokens have an expiration period for security reasons. Regularly updating tokens enables and help in maintaining a secure authentication system for your CI/CD pipeline.



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads