Error Code “128 /usr/local/cpanel/3rdparty/bin/git” reported

How to fix error code 128 /usr/local/cpanel/3rdparty/bin/git reported? Read the article to learn more. At Bobcares, we assist our customers with several queries on a daily basis as part of our cPanel & WHM Support Services.

Overview
  1. Fixing “error code 128 /usr/local/cpanel/3rdparty/bin/git reported”
  2. Understanding the Error
  3. Steps to Fix the Error
  4. Benefits of Fixing the Error
  5. Conclusion

Fixing “error code 128 /usr/local/cpanel/3rdparty/bin/git reported”

Sometimes, when we try to create a new Git repository in the “cPanel Git™ Version Control” control icon of cPanel, we may receive the following error message:


“/usr/local/cpanel/3rdparty/bin/git” reported error code “128” when it ended: Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

Understanding the Error

This occurs when the remote Git repository that we entered in the “Clone URL” column denies the access. This article will help us through the process of establishing key authentication to access the remote repository that we want to clone.

If we see the error message described in the symptoms section above, we must utilize the SSH protocol rather than the Git or HTTPS protocols. The URLs that the Git provider allows to use for the SSH protocol may start with ssh://, or, in the case of Github, will simply start with a username: git@.

Error Code “128 /usr/local/cpanel/3rdparty/bin/git” reported

Ideally, we will already have the SSH version of the remote repository URL for the cloned repository, and we will have figured out from the remote repository provider how to add a public SSH key to their system so that the cPanel server can access it before starting the steps in the guide that is linked below.

Steps to Fix the Error

Step 1

If the SSH configuration file doesn’t already exist, create it now:

touch ~/.ssh/config
Step 2

Change the ~/.ssh/config file’s permissions to 0600:

chmod 0600 ~/.ssh/config
Step 3

If we’re performing this as the cPanel user, the ownership must be like that, but it’s best to make sure that’s the case:

chown cpanelusername:cpanelusername ~/.ssh/config
Step 4

Using the preferred text editor, open ~/.ssh/config and input a configuration set up as seen in the sample below.

Host remote-git-repo-domain.tld
IdentityFile ~/.ssh/my_key
User remoteusername
Step 5

We can use an asterisk (*) in place of a specific domain name as the host when using this private key to establish SSH connections to any remote host: *

If not, use the domain name of the company that provides the remote Git repository, which may be located in the SSH repository URL that we get in step 7 below. Make sure we replace remoteusername with the git repository username and use the location to the private key for the IdentityFile.

Step 6

Then, save the file.

Step 7

Access the remote Git repository’s administration interface by logging in.

Step 8

Also, get the URL of the SSH repository from which we want to clone the repository.

Step 9

Make sure we set up the public key on the remote system such that it is allowed access while we are in the management interface of the remote Git repository. Use the following command to cat the contents of the public key from the SSH connection or cPanel Terminal in order to do this: (Ensure that the route to the private key, which we created in step 2, is used.)

cat ~/.ssh/my_key.pub
Step 10

The result of that command should then be pasted into the remote Git repository interface, which is where key authentication should be set up.

Step 11

In order to check if authentication will function correctly, clone the repository once again using the cPanel Terminal or SSH session. If we don’t want to download all the data from a huge repository, we may use the –bare option as shown in the following examples. Utilize the SSH repository URL that we were given in step 7 above by the Git supplier. # SSH clone URL in the GitHub manner


git clone --bare --verbose git@github.com:githubusername/repo-name.git -- ~/test-clone-destination-dir # Standard SSH clone URL
git clone --bare --verbose ssh://remoteusername@remote-git-repo-domain.tld:SSHPort/path/to/repo.git/ -- ~/test-clone-destination-dir

Step 12

If authentication fail, we should verify the ~/.ssh/config again and look into the remote server’s SSH access. It could also be necessary to verify the ownership and permissions of the ~/.ssh directory and any files housed within. To troubleshoot the authentication issue, we may try issuing an SSH command like to the following if the remote Git host (GitHub) allows direct SSH logins:

ssh -vvv -p SSHPort remoteusername@remote-git-repo-domain.tld
Step 13

We may then set up the repository using the cPanel GitTM Version Control icon if the login process was successful.

Benefits of Fixing the Error

Fixing the “error code 128 /usr/local/cpanel/3rdparty/bin/git reported” has several important benefits for maintaining smooth server operations and effective repository management. By resolving this issue, Git commands such as cloning, pulling, and fetching can be executed reliably, ensuring stable deployments and consistent version control, which are crucial for both individual developers and teams.

Additionally, fixing this error supports automation of tasks like code deployments, updates, and backups, which enhances efficiency and minimizes the need for manual intervention. It also helps maintain data integrity by preventing potential data loss or corruption and reinforces security by ensuring proper access controls are in place. Overall, addressing this error improves collaboration among developers, supports continuous integration and delivery processes, and ensures the smooth functioning of server-side Git operations.

[Want to learn more? Click here to reach us.]

Conclusion

To sum up, error code 128 in Git typically indicates a problem related to Git operations, such as issues with repository access or configuration. By following these steps from our Experts, we should be able to identify and resolve the issue causing Git error code 128.