GOCD issue after changing material token

72 Views Asked by At

We have many pipelines setup in which we have added azure git as material. After some days token added in Git material is expired. So we updated git token in all pipelines. When tried to execute pipeline again, but still it is giving error -

[go] Job Started: 2023-09-29 08:38:09 CEST
[go] Start to prepare Pipeline1/281/Build-Stage/1/Pipeline1-Job-runOnAll-1 on WIN-2D15LVA1HTP [C:\Program Files (x86)\Go Agent]
[go] Start to update materials.
[go] Start updating files at revision REVISION from https://@dev.azure.com/git-repo-url
[GIT] Fetching changes
STDERR: fatal: Verification code expired before contacting the server
STDERR: bash: line 1: /dev/tty: No such device or address
STDERR: error: failed to execute prompt script (exit code 1)
STDERR: fatal: could not read Password for 'https://e3yfws****@dev.azure.com/git-repo-url': No such file or directory
git fetch failed for [https://@dev.azure.com/git-repo-url]

Environment Go Version: 23.1.0 OS: windows

Steps to Reproduce

  1. Create a pipeline and add a material info to that pipeline.
  2. Now trigger pipeline after setup some jobs. It should works fine.
  3. Now let's say if this material token is expired, then need to change it's token.
  4. Now change material's token value with new value.
  5. Run the pipeline.
  6. It will always pick old git material credential token and will give the error as mentioned above.

Code snippets/Screenshots

[go] Job Started: 2023-09-29 08:38:09 CEST
[go] Start to prepare Pipeline1/281/Build-Stage/1/Pipeline1-Job-runOnAll-1 on WIN-2D15LVA1HTP [C:\Program Files (x86)\Go Agent]
[go] Start to update materials.

[go] Start updating files at revision REVISION from https://@dev.azure.com/git-repo-url
[GIT] Fetching changes
STDERR: fatal: Verification code expired before contacting the server
STDERR: bash: line 1: /dev/tty: No such device or address
STDERR: error: failed to execute prompt script (exit code 1)
STDERR: fatal: could not read Password for 'https://e3yfws****@dev.azure.com/git-repo-url': No such file or directory
git fetch failed for [https://@dev.azure.com/git-repo-url]

Expected Results It should pick latest material credential token instead of old one.

Actual Results It is always picking initial credential token.

Tried approaches - Tried to restart gocd agent and gocd server both. Results are same. Tried to clone a pipeline from existing and changed git material token value in this cloned pipeline. And executed, it works fine.

1

There are 1 best solutions below

0
Pramod Kumar On

Instead of passing token in URL itself, passed username/password in pipeline material settings. And all pipelines works well.

Reference link - https://github.com/gocd/gocd/issues/12058.