Jenkins is using the new credential to fetch the latest changes, but searching for the old credential to accept the merge request.
I’m trying to use GitLab with Jenkins. I’ve checked in my job configuration that the credentials are working (I tested the connection and didn’t get any errors while choosing from the credentials list). I’m using a new credential (with ID yyyyy), I’ve also set this in the job config. But when I trigger the job, Jenkins is searching for the credential with ID xxxxx (which I deleted before creating the new credential). I also created a new credential with the same ID and deleted it again, hoping that Jenkins would use the new cred. But the error persists. I’ve added the console output below:
06:43:35 Started by an SCM change
06:43:35 Running as SYSTEM
06:43:35 [ATLASSIAN CLOUD PLUGIN] [WARN] Not a WorkflowRun, automatic builds and deployments won't work.
06:43:35 [EnvInject] - Loading node environment variables.
06:43:35 Building remotely on win10_lab in workspace c:jenkinsworkspace<repo_name>
06:43:35 The recommended git tool is: NONE
06:43:35 using credential YYYYY
06:47:51 ERROR: Build step failed with exception
06:47:51 java.lang.IllegalStateException: No credentials found for credentialsId: XXXXX
06:47:51 at com.dabsquared.gitlabjenkins.connection.GitLabConnection.getApiToken(GitLabConnection.java:183)
06:47:51 at com.dabsquared.gitlabjenkins.connection.GitLabConnection.getClient(GitLabConnection.java:150)
06:47:51 at com.dabsquared.gitlabjenkins.connection.GitLabConnectionConfig.getClient(GitLabConnectionConfig.java:64)
06:47:51 at com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty.getClient(GitLabConnectionProperty.java:78)
06:47:51 at com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty.getClient(GitLabConnectionProperty.java:91)
06:47:51 at com.dabsquared.gitlabjenkins.publisher.MergeRequestNotifier.perform(MergeRequestNotifier.java:31)
06:47:51 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
06:47:51 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
06:47:51 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:767)
06:47:51 at hudson.model.Build$BuildExecution.post2(Build.java:179)
06:47:51 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:711)
06:47:51 at hudson.model.Run.execute(Run.java:1917)
06:47:51 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
06:47:51 at hudson.model.ResourceController.execute(ResourceController.java:101)
06:47:51 at hudson.model.Executor.run(Executor.java:442)
06:47:51 Build step 'Accept GitLab merge request on success' marked build as failure
06:47:51 Sending e-mails to: [email protected]
06:47:51 Failed to update GitLab commit status: No credentials found for credentialsId: XXXXX
06:47:51 [ATLASSIAN CLOUD PLUGIN] [WARN] Not a WorkflowRun, onCompleted() won't be propagated to listeners
06:47:51 Finished: FAILURE
Asif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.