Jenkins Error : Access Issue |

Hi ,

I am geeting below issue :

*ERROR: Error fetching remote repo 'origin'*
*hudson.plugins.git.GitException: Failed to fetch from https://github.com/example/example.git/'*
*	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1003)*
*	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1244)*
*	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1308)*
*	at hudson.scm.SCM.checkout(SCM.java:540)*
*	at hudson.model.AbstractProject.checkout(AbstractProject.java:1217)*
*	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:647)*
*	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)*
*	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:519)*
*	at hudson.model.Run.execute(Run.java:1897)*
*	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)*
*	at hudson.model.ResourceController.execute(ResourceController.java:101)*
*	at hudson.model.Executor.run(Executor.java:442)*
*Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://github.com/example/example.git/' +refs/heads/*:refs/remotes/origin/*" returned status code 128:*
*stdout: *
*stderr: fatal: unable to access 'https://github.com/example/example.git/': The requested URL returned error: 403*

*	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2671)*
*	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2096)*
*	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)*
*	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:618)*
*	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1001)*
*	... 11 more*
*ERROR: Error fetching remote repo 'origin'*
*[GitHub Checks] Causes for no suitable publisher found: *
*[GitHub Checks] Trying to resolve checks parameters from GitHub SCM...*
*[GitHub Checks] Job does not use GitHub SCM*
*[GitHub Checks] Trying to resolve checks parameters from Git SCM...*
*[GitHub Checks] No GitHub app credentials found: 'Fortify_creds'*
*[GitHub Checks] See: https://github.com/jenkinsci/github-branch-source-plugin/blob/5b0c0cea18c351352f2d33ad2491d148bb38a447/docs/github-app.adoc*
*[GitHub Checks] Job does not have valid credentials*
*[Checks API] No suitable checks publisher found.*
*Finished: FAILURE*

I have tried manual authentication to github repo >> Successfull
No plugin errors in Jenkins

Below Error under Git >> Repositories :Failed to connect to repository : Command “git ls-remote -h https://github.com/example/example.git/ HEAD” returned status code 128:
stdout:
stderr: fatal: unable to access ‘https://github.com/example/example.git/’: The requested URL returned error: 403

@Adityabhuj Does the repo https://github.com/example/example.git/ exist?

As per the error logs, it appears that this repo deosn’t exist or jenkins user doesn’t have sufficient permission to clone the repo.
Please see the error status code: 128

Hi Altif ,

Please note i have changed repo url , for security reasons ,
and i have checked manually , user to have access to repo

The error code 403 indicates an access-related issue. Let’s troubleshoot this step by step:

Repository Access: First, ensure that the repository you’re trying to clone is accessible. If it’s a private repository, make sure you’ve added the necessary credentials in Jenkins.
Authentication Method: How are you authenticating with GitHub? There are two common methods:
Personal Access Token (PAT): If you’re using a personal access token, ensure that it has the necessary permissions (e.g., read access to the repository).
GitHub App: If you’re using GitHub App-based authentication, verify that the app credentials are correctly configured in Jenkins.

Hi Altif ,

this github repos are used to scan in Fortify and SNYK ,
github repos are working fine in SNYK but getting issues with fortify only .
Since same personal token is used for both .