GitHub server credential is configured with a good way but im getting 403 error

Hello team,

Please, i need help my GitHub server credential is configured with a good way , because i’m getting Credentials verified for user soukaina-khalkhouli, rate limit: 4991 but weebhook triggers are o not workig im getting the below error:

Started on May 12, 2023, 4:16:37 PM
Started by event from 10.240.64.13 ⇒ / on Fri May 12 16:16:37 UTC 2023
Using strategy: Default
[poll] Last Built Revision: Revision 3c19ec6ac7ff358b90b5952f4c9b9be4a169be83 ()
The recommended git tool is: NONE
No credentials specified
 > git --version # timeout=10
 > git --version # 'git version 2.31.1'
 > git ls-remote -h -- # timeout=10
ERROR: polling failed in /home/jenkins/agent/workspace/cms-backend on non-root-jenkins-agent-python-f6v4w-zdp9l
hudson.plugins.git.GitException: Command "git ls-remote -h -- " returned status code 128:
stdout: 
stderr: remote: Password authentication is not available for Git operations.
remote: You must use a personal access token or SSH key.
remote: 
fatal: unable to access ': The requested URL returned error: 403

	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2732)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2109)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2007)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1998)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:3613)
	at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:731)
	at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:690)
Caused: java.io.IOException
	at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:692)
	at org.jenkinsci.plugins.workflow.job.WorkflowJob.poll(WorkflowJob.java:622)
	at com.cloudbees.jenkins.GitHubPushTrigger$1.runPolling(GitHubPushTrigger.java:125)
	at com.cloudbees.jenkins.GitHubPushTrigger$1.run(GitHubPushTrigger.java:151)
	at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:123)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Done. Took 1.2 sec
No changes 

That message often means that you’ve entered your GitHub username and password as the credential in Jenkins. GitHub won’t accept that. You need to enter a personal access token that has been generated by GitHub.

Hello @MarkEWaite ,

we have used personal access token as a secret text not username and password.

Regards

That output looks like it is coming from a job that is running, not from a scan of the GitHub repository. The credentials configured in the system wide configuration of the GitHub server are used for repository scans. Credentials may defined in the jobs that are different than the credential that is defined at the system level.

Are you absolutely certain that the job definition is not using a credential that is the username and password of a user?

@MarkEWaite
In jenkins GitHub configuration level we have used secret text, but in build pipeline we have used credentials which we created in manage credentials in Jenkins which is in the format of username and password. Password is provided by personnel access token from GitHub repository.


1 is used for :github server configuration as a secret
2 is used for : build pipeline as username and password