Today i faced with below issue while the github was ported to some new hardware or network. So this resulted in below issue for the data pipeline i already had in my jenkins setup for Big Data.
Issue1: Below was due to issue2
ssh: Could not resolve hostname github.hpe.com: Temporary failure in name resolution fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. Build step 'Execute shell' marked build as failure
Failed to connect to repository : Command "git ls-remote -h https://github.company.com/github_usrname/project_name.git HEAD" returned status code 128: stdout: stderr: fatal: unable to access 'https://github.company.com/github_usrname/project_name.git/': Could not resolve host: github.hpe.com; Unknown error
Is to generate a personal access token by following below steps:
a) In your github link go to settings –> Developer settings –> Personal access tokens
b) Click on Generate new token
c) Update Jenkins credentials in your Job: (click on labels with ” ” below)
Top left “jenkins” –> “Credentials” –> Delete previous user and then recreate it.
d) If the issue1 persists update the ssh key from the linux system you are trying to use the git.
Click on “New SSH key” and add the ssh key generated in your linux system.
[root@hostname project-pipeline]# ssh-keygen -t rsa -b 4096 -C “firstname.lastname@example.org”
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
The key’s randomart image is:
+–[ RSA 4096]—-+
| . |
| . S + |
| . o + o |
| E .= .o|
[root@hostname project-pipeline]# eval “$(ssh-agent -s)”
Agent pid 5742
[root@hostname project-pipeline]# cat /root/.ssh/id_rsa.pub
starts with ssh-rsa*************