Renovate: Version 23.11.0 introduces error "fatal: could not read Username for 'https://dev.azure.com': terminal prompts disabled\n"

Created on 1 Sep 2020  路  40Comments  路  Source: renovatebot/renovate

What Renovate type, platform and version are you using?
Using the RenovateMe add-in for azure devops, which means
ubuntu-20.04
node 12.18.3
renovate version anything equal to or greater than 23.11.0 fails

Describe the bug

Renovate is failing duing the initilisation stages with the error
"fatal: could not read Username for 'https://dev.azure.com': terminal prompts disabled\n"

Relevant debug logs

 INFO: Renovate is exiting with a non-zero code due to the following logged errors
       "loggerErrors": [
         {
           "name": "renovate",
           "level": 50,
           "logContext": "JutA_tmt7",
           "repository": "REDACTED/REDACTED",
           "err": {
             "task": {
               "commands": [
                 "ls-remote",
                 "--heads",
                 "https://dev.azure.com/avius/REDACTED/_git/REDACTED"
               ],
               "format": "utf-8"
             },
             "message": "fatal: could not read Username for 'https://dev.azure.com': terminal prompts disabled\n",
             "stack": "Error: fatal: could not read Username for 'https://dev.azure.com': terminal prompts disabled\n\n    at GitExecutorChain.onFatalException (/home/vsts/.npm/_npx/3595/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:60:87)\n    at GitExecutorChain.<anonymous> (/home/vsts/.npm/_npx/3595/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:51:28)\n    at Generator.throw (<anonymous>)\n    at rejected (/home/vsts/.npm/_npx/3595/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:6:65)\n    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
           },
           "msg": "Repository has unknown error"
         }
       ]

To Reproduce

run against azure?

Additional context
I have tested with different versions and can confirm that
version 23.10.2 - works
version 23.11.0 - fails
version 23.14.0 - (latest) still failing.

azure

Most helpful comment

can reproduce it, working on fix

All 40 comments

Can you capture a run with debug logging enabled and post it here?

@JamieMagee @viceice I'm guessing it's related to the "extra clone options". Wonder if we can pass them to git ls-remote?

should be doable, maybe passing them in init as now and store them in git config for reuse?

I will raise a PR soon

2020-09-01T06:59:44.7353372Z
[command]/opt/hostedtoolcache/node/12.18.3/x64/bin/npx renovate@latest
REDACTED/REDACTED --platform azure --endpoint
https://dev.azure.com/REDACTED/ --token *** --log-level=debug
--host-rules=[{"domainName":"github.com","token":"***"}]
2020-09-01T07:00:09.7639388Z DEBUG: File config
2020-09-01T07:00:09.7640125Z        "config": {}
2020-09-01T07:00:09.7640569Z DEBUG: CLI config
2020-09-01T07:00:09.7641006Z        "config": {
2020-09-01T07:00:09.7641420Z          "repositories": ["REDACTED/REDACTED"],
2020-09-01T07:00:09.7641867Z          "logLevel": "debug",
2020-09-01T07:00:09.7642660Z          "platform": "azure",
2020-09-01T07:00:09.7643104Z          "endpoint": "
https://dev.azure.com/REDACTED/",
2020-09-01T07:00:09.7643573Z          "token": "***********",
2020-09-01T07:00:09.7644066Z          "hostRules": [{"domainName": "
github.com", "token": "***********"}]
2020-09-01T07:00:09.7644521Z        }
2020-09-01T07:00:09.7644891Z DEBUG: Env config
2020-09-01T07:00:09.7645258Z        "config": {
2020-09-01T07:00:09.7645660Z          "hostRules": [
2020-09-01T07:00:09.7646214Z            {"hostType": "github",
"domainName": "github.com", "token": "***********"}
2020-09-01T07:00:09.7646724Z          ]
2020-09-01T07:00:09.7647088Z        }
2020-09-01T07:00:09.7647686Z DEBUG: Combined config
2020-09-01T07:00:09.7650596Z        "config": {
2020-09-01T07:00:09.7651068Z          "hostRules": [
2020-09-01T07:00:09.7651564Z            {"hostType": "github",
"domainName": "github.com", "token": "***********"},
2020-09-01T07:00:09.7652140Z            {"domainName": "github.com",
"token": "***********"}
2020-09-01T07:00:09.7652568Z          ],
2020-09-01T07:00:09.7652951Z          "repositories": ["REDACTED/REDACTED"],
2020-09-01T07:00:09.7653393Z          "logLevel": "debug",
2020-09-01T07:00:09.7653794Z          "platform": "azure",
2020-09-01T07:00:09.7654242Z          "endpoint": "
https://dev.azure.com/REDACTED/",
2020-09-01T07:00:09.7654944Z          "token": "***********"
2020-09-01T07:00:09.7656948Z        }
2020-09-01T07:00:09.7664061Z DEBUG: Adding trailing slash to endpoint
2020-09-01T07:00:09.7665238Z DEBUG: Using default gitAuthor: Renovate Bot <
[email protected]>
2020-09-01T07:00:09.7699169Z DEBUG: Using baseDir: /tmp/renovate
2020-09-01T07:00:09.7706405Z DEBUG: Using cacheDir: /tmp/renovate/cache
2020-09-01T07:00:09.7713756Z DEBUG: Initializing Renovate internal cache
into /tmp/renovate/cache/renovate/renovate-cache-v1
2020-09-01T07:00:09.7714098Z DEBUG: Limits.init enter method
2020-09-01T07:00:09.7714317Z DEBUG: Limits.init prCommitsPerRunLimit
processing
2020-09-01T07:00:09.7714617Z DEBUG: Limits.init prCommitsPerRunLimit
variable is not set. Ignoring prCommitsPerRunLimit
2020-09-01T07:00:09.7750197Z  INFO: Repository started
(repository=REDACTED/REDACTED)
2020-09-01T07:00:09.7750628Z        "renovateVersion": "23.14.1"
2020-09-01T07:00:09.7750918Z DEBUG: Using localDir:
/tmp/renovate/repos/azure/REDACTED/REDACTED (repository=REDACTED/REDACTED)
2020-09-01T07:00:09.7765017Z DEBUG: initRepo("REDACTED/REDACTED")
(repository=REDACTED/REDACTED)
2020-09-01T07:00:10.3325806Z DEBUG: Repository details
(repository=REDACTED/REDACTED)
2020-09-01T07:00:10.3327323Z        "repositoryDetails": {
2020-09-01T07:00:10.3328358Z          "id":
"e21b3db9-f7c8-4715-804c-6dbf8de2c8e6",
2020-09-01T07:00:10.3328592Z          "name": "REDACTED",
2020-09-01T07:00:10.3329135Z          "url": "
https://dev.azure.com/REDACTED/ae1cd160-cde5-499f-a8d7-REDACTED/_apis/git/repositories/e21b3db9-f7c8-4715-804c-REDACTED
",
2020-09-01T07:00:10.3329431Z          "project": {
2020-09-01T07:00:10.3330014Z            "id":
"ae1cd160-cde5-499f-a8d7-REDACTED",
2020-09-01T07:00:10.3330241Z            "name": "REDACTED",
2020-09-01T07:00:10.3330651Z            "description": "Unified REDACTED
project for all development",
2020-09-01T07:00:10.3331161Z            "url": "
https://dev.azure.com/REDACTED/_apis/projects/ae1cd160-cde5-499f-a8d7-REDACTED
",
2020-09-01T07:00:10.3331455Z            "state": "wellFormed",
2020-09-01T07:00:10.3331641Z            "revision": 411520266,
2020-09-01T07:00:10.3331820Z            "visibility": 0,
2020-09-01T07:00:10.3332226Z            "lastUpdateTime":
"2019-10-31T17:31:37.380Z"
2020-09-01T07:00:10.3332427Z          },
2020-09-01T07:00:10.3332593Z          "defaultBranch": "refs/heads/main",
2020-09-01T07:00:10.3332806Z          "size": 218970556,
2020-09-01T07:00:10.3333036Z          "remoteUrl": "
https://[email protected]/REDACTED/REDACTED/_git/REDACTED",
2020-09-01T07:00:10.3333521Z          "sshUrl": "[email protected]:
v3/REDACTED/REDACTED/REDACTED",
2020-09-01T07:00:10.3333786Z          "webUrl": "
https://dev.azure.com/REDACTED/REDACTED/_git/REDACTED"
2020-09-01T07:00:10.3333969Z        }
2020-09-01T07:00:10.3334312Z DEBUG: REDACTED/REDACTED owner = ?owner?
(repository=REDACTED/REDACTED)
2020-09-01T07:00:10.3334927Z DEBUG: REDACTED/REDACTED default branch = main
(repository=REDACTED/REDACTED)
2020-09-01T07:00:11.3881064Z DEBUG: git error (repository=REDACTED/REDACTED)
2020-09-01T07:00:11.3882078Z        "err": {
2020-09-01T07:00:11.3882508Z          "task": {
2020-09-01T07:00:11.3883014Z            "commands": [
2020-09-01T07:00:11.3883869Z              "ls-remote",
2020-09-01T07:00:11.3884466Z              "--heads",
2020-09-01T07:00:11.3884900Z              "
https://dev.azure.com/REDACTED/REDACTED/_git/REDACTED"
2020-09-01T07:00:11.3885282Z            ],
2020-09-01T07:00:11.3886231Z            "format": "utf-8"
2020-09-01T07:00:11.3886597Z          },
2020-09-01T07:00:11.3887283Z          "message": "fatal: could not read
Username for 'https://dev.azure.com': terminal prompts disabled\n",
2020-09-01T07:00:11.3890056Z          "stack": "Error: fatal: could not
read Username for 'https://dev.azure.com': terminal prompts disabled\n\n
 at GitExecutorChain.onFatalException
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:60:87)\n
   at GitExecutorChain.<anonymous>
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:51:28)\n
   at Generator.throw (<anonymous>)\n    at rejected
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:6:65)\n
   at processTicksAndRejections (internal/process/task_queues.js:97:5)"
2020-09-01T07:00:11.3892405Z        }
2020-09-01T07:00:11.3895788Z ERROR: Repository has unknown error
(repository=REDACTED/REDACTED)
2020-09-01T07:00:11.3896296Z        "err": {
2020-09-01T07:00:11.3896689Z          "task": {
2020-09-01T07:00:11.3897371Z            "commands": [
2020-09-01T07:00:11.3898099Z              "ls-remote",
2020-09-01T07:00:11.3898818Z              "--heads",
2020-09-01T07:00:11.3899227Z              "
https://dev.azure.com/REDACTED/REDACTED/_git/REDACTED"
2020-09-01T07:00:11.3899573Z            ],
2020-09-01T07:00:11.3900059Z            "format": "utf-8"
2020-09-01T07:00:11.3900409Z          },
2020-09-01T07:00:11.3901243Z          "message": "fatal: could not read
Username for 'https://dev.azure.com': terminal prompts disabled\n",
2020-09-01T07:00:11.3904093Z          "stack": "Error: fatal: could not
read Username for 'https://dev.azure.com': terminal prompts disabled\n\n
 at GitExecutorChain.onFatalException
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:60:87)\n
   at GitExecutorChain.<anonymous>
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:51:28)\n
   at Generator.throw (<anonymous>)\n    at rejected
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:6:65)\n
   at processTicksAndRejections (internal/process/task_queues.js:97:5)"
2020-09-01T07:00:11.3906382Z        }
2020-09-01T07:00:11.3906828Z DEBUG: Repository timing splits (milliseconds)
(repository=REDACTED/REDACTED)
2020-09-01T07:00:11.3908662Z        "splits": {},
2020-09-01T07:00:11.3908984Z        "total": 1616
2020-09-01T07:00:11.3919082Z  INFO: Repository finished
(repository=REDACTED/REDACTED)
2020-09-01T07:00:11.3919441Z        "durationMs": 1616
2020-09-01T07:00:11.3919692Z DEBUG: Renovate exiting
2020-09-01T07:00:11.3920362Z  INFO: Renovate is exiting with a non-zero
code due to the following logged errors
2020-09-01T07:00:11.3920752Z        "loggerErrors": [
2020-09-01T07:00:11.3920979Z          {
2020-09-01T07:00:11.3921240Z            "name": "renovate",
2020-09-01T07:00:11.3921745Z            "level": 50,
2020-09-01T07:00:11.3922211Z            "logContext": "8LbBmj_0p",
2020-09-01T07:00:11.3922516Z            "repository": "REDACTED/REDACTED",
2020-09-01T07:00:11.3922789Z            "err": {
2020-09-01T07:00:11.3923058Z              "task": {
2020-09-01T07:00:11.3923325Z                "commands": [
2020-09-01T07:00:11.3923755Z                  "ls-remote",
2020-09-01T07:00:11.3924386Z                  "--heads",
2020-09-01T07:00:11.3924738Z                  "
https://dev.azure.com/REDACTED/REDACTED/_git/REDACTED"
2020-09-01T07:00:11.3925372Z                ],
2020-09-01T07:00:11.3925767Z                "format": "utf-8"
2020-09-01T07:00:11.3926045Z              },
2020-09-01T07:00:11.3926656Z              "message": "fatal: could not read
Username for 'https://dev.azure.com': terminal prompts disabled\n",
2020-09-01T07:00:11.3929094Z              "stack": "Error: fatal: could not
read Username for 'https://dev.azure.com': terminal prompts disabled\n\n
 at GitExecutorChain.onFatalException
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:60:87)\n
   at GitExecutorChain.<anonymous>
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:51:28)\n
   at Generator.throw (<anonymous>)\n    at rejected
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:6:65)\n
   at processTicksAndRejections (internal/process/task_queues.js:97:5)"
2020-09-01T07:00:11.3930667Z            },
2020-09-01T07:00:11.3930945Z            "msg": "Repository has unknown
error"
2020-09-01T07:00:11.3931198Z          }
2020-09-01T07:00:11.3931399Z        ]=

2020-09-01T06:59:44.7353372Z
[command]/opt/hostedtoolcache/node/12.18.3/x64/bin/npx renovate@latest
REDACTED/REDACTED --platform azure --endpoint
dev.azure.com/REDACTED --token *** --log-level=debug
--host-rules=[{"domainName":"github.com","token":"***"}]
2020-09-01T07:00:09.7639388Z DEBUG: File config
2020-09-01T07:00:09.7640125Z        "config": {}
2020-09-01T07:00:09.7640569Z DEBUG: CLI config
2020-09-01T07:00:09.7641006Z        "config": {
2020-09-01T07:00:09.7641420Z          "repositories": ["REDACTED/REDACTED"],
2020-09-01T07:00:09.7641867Z          "logLevel": "debug",
2020-09-01T07:00:09.7642660Z          "platform": "azure",
2020-09-01T07:00:09.7643104Z          "endpoint": "
dev.azure.com/REDACTED",
2020-09-01T07:00:09.7643573Z          "token": "***********",
2020-09-01T07:00:09.7644066Z          "hostRules": [{"domainName": "
github.com", "token": "***********"}]
2020-09-01T07:00:09.7644521Z        }
2020-09-01T07:00:09.7644891Z DEBUG: Env config
2020-09-01T07:00:09.7645258Z        "config": {
2020-09-01T07:00:09.7645660Z          "hostRules": [
2020-09-01T07:00:09.7646214Z            {"hostType": "github",
"domainName": "github.com", "token": "***********"}
2020-09-01T07:00:09.7646724Z          ]
2020-09-01T07:00:09.7647088Z        }
2020-09-01T07:00:09.7647686Z DEBUG: Combined config
2020-09-01T07:00:09.7650596Z        "config": {
2020-09-01T07:00:09.7651068Z          "hostRules": [
2020-09-01T07:00:09.7651564Z            {"hostType": "github",
"domainName": "github.com", "token": "***********"},
2020-09-01T07:00:09.7652140Z            {"domainName": "github.com",
"token": "***********"}
2020-09-01T07:00:09.7652568Z          ],
2020-09-01T07:00:09.7652951Z          "repositories": ["REDACTED/REDACTED"],
2020-09-01T07:00:09.7653393Z          "logLevel": "debug",
2020-09-01T07:00:09.7653794Z          "platform": "azure",
2020-09-01T07:00:09.7654242Z          "endpoint": "
dev.azure.com/REDACTED",
2020-09-01T07:00:09.7654944Z          "token": "***********"
2020-09-01T07:00:09.7656948Z        }
2020-09-01T07:00:09.7664061Z DEBUG: Adding trailing slash to endpoint
2020-09-01T07:00:09.7665238Z DEBUG: Using default gitAuthor: Renovate Bot <
[email protected]>
2020-09-01T07:00:09.7699169Z DEBUG: Using baseDir: /tmp/renovate
2020-09-01T07:00:09.7706405Z DEBUG: Using cacheDir: /tmp/renovate/cache
2020-09-01T07:00:09.7713756Z DEBUG: Initializing Renovate internal cache
into /tmp/renovate/cache/renovate/renovate-cache-v1
2020-09-01T07:00:09.7714098Z DEBUG: Limits.init enter method
2020-09-01T07:00:09.7714317Z DEBUG: Limits.init prCommitsPerRunLimit
processing
2020-09-01T07:00:09.7714617Z DEBUG: Limits.init prCommitsPerRunLimit
variable is not set. Ignoring prCommitsPerRunLimit
2020-09-01T07:00:09.7750197Z  INFO: Repository started
(repository=REDACTED/REDACTED)
2020-09-01T07:00:09.7750628Z        "renovateVersion": "23.14.1"
2020-09-01T07:00:09.7750918Z DEBUG: Using localDir:
/tmp/renovate/repos/azure/REDACTED/REDACTED (repository=REDACTED/REDACTED)
2020-09-01T07:00:09.7765017Z DEBUG: initRepo("REDACTED/REDACTED")
(repository=REDACTED/REDACTED)
2020-09-01T07:00:10.3325806Z DEBUG: Repository details
(repository=REDACTED/REDACTED)
2020-09-01T07:00:10.3327323Z        "repositoryDetails": {
2020-09-01T07:00:10.3328358Z          "id":
"e21b3db9-f7c8-4715-804c-6dbf8de2c8e6",
2020-09-01T07:00:10.3328592Z          "name": "REDACTED",
2020-09-01T07:00:10.3329135Z          "url": "
dev.azure.com/REDACTED/ae1cd160-cde5-499f-a8d7-REDACTED/_apis/git/repositories/e21b3db9-f7c8-4715-804c-REDACTED
",
2020-09-01T07:00:10.3329431Z          "project": {
2020-09-01T07:00:10.3330014Z            "id":
"ae1cd160-cde5-499f-a8d7-REDACTED",
2020-09-01T07:00:10.3330241Z            "name": "REDACTED",
2020-09-01T07:00:10.3330651Z            "description": "Unified REDACTED
project for all development",
2020-09-01T07:00:10.3331161Z            "url": "
dev.azure.com/REDACTED/_apis/projects/ae1cd160-cde5-499f-a8d7-REDACTED
",
2020-09-01T07:00:10.3331455Z            "state": "wellFormed",
2020-09-01T07:00:10.3331641Z            "revision": 411520266,
2020-09-01T07:00:10.3331820Z            "visibility": 0,
2020-09-01T07:00:10.3332226Z            "lastUpdateTime":
"2019-10-31T17:31:37.380Z"
2020-09-01T07:00:10.3332427Z          },
2020-09-01T07:00:10.3332593Z          "defaultBranch": "refs/heads/main",
2020-09-01T07:00:10.3332806Z          "size": 218970556,
2020-09-01T07:00:10.3333036Z          "remoteUrl": "
https://[email protected]/REDACTED/REDACTED/_git/REDACTED",
2020-09-01T07:00:10.3333521Z          "sshUrl": "[email protected]:
v3/REDACTED/REDACTED/REDACTED",
2020-09-01T07:00:10.3333786Z          "webUrl": "
dev.azure.com/REDACTED/REDACTED/_git/REDACTED"
2020-09-01T07:00:10.3333969Z        }
2020-09-01T07:00:10.3334312Z DEBUG: REDACTED/REDACTED owner = ?owner?
(repository=REDACTED/REDACTED)
2020-09-01T07:00:10.3334927Z DEBUG: REDACTED/REDACTED default branch = main
(repository=REDACTED/REDACTED)
2020-09-01T07:00:11.3881064Z DEBUG: git error (repository=REDACTED/REDACTED)
2020-09-01T07:00:11.3882078Z        "err": {
2020-09-01T07:00:11.3882508Z          "task": {
2020-09-01T07:00:11.3883014Z            "commands": [
2020-09-01T07:00:11.3883869Z              "ls-remote",
2020-09-01T07:00:11.3884466Z              "--heads",
2020-09-01T07:00:11.3884900Z              "
dev.azure.com/REDACTED/REDACTED/_git/REDACTED"
2020-09-01T07:00:11.3885282Z            ],
2020-09-01T07:00:11.3886231Z            "format": "utf-8"
2020-09-01T07:00:11.3886597Z          },
2020-09-01T07:00:11.3887283Z          "message": "fatal: could not read
Username for 'dev.azure.com': terminal prompts disabled\n",
2020-09-01T07:00:11.3890056Z          "stack": "Error: fatal: could not
read Username for 'dev.azure.com': terminal prompts disabled\n\n
 at GitExecutorChain.onFatalException
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:60:87)\n
   at GitExecutorChain.<anonymous>
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:51:28)\n
   at Generator.throw (<anonymous>)\n    at rejected
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:6:65)\n
   at processTicksAndRejections (internal/process/task_queues.js:97:5)"
2020-09-01T07:00:11.3892405Z        }
2020-09-01T07:00:11.3895788Z ERROR: Repository has unknown error
(repository=REDACTED/REDACTED)
2020-09-01T07:00:11.3896296Z        "err": {
2020-09-01T07:00:11.3896689Z          "task": {
2020-09-01T07:00:11.3897371Z            "commands": [
2020-09-01T07:00:11.3898099Z              "ls-remote",
2020-09-01T07:00:11.3898818Z              "--heads",
2020-09-01T07:00:11.3899227Z              "
dev.azure.com/REDACTED/REDACTED/_git/REDACTED"
2020-09-01T07:00:11.3899573Z            ],
2020-09-01T07:00:11.3900059Z            "format": "utf-8"
2020-09-01T07:00:11.3900409Z          },
2020-09-01T07:00:11.3901243Z          "message": "fatal: could not read
Username for 'dev.azure.com': terminal prompts disabled\n",
2020-09-01T07:00:11.3904093Z          "stack": "Error: fatal: could not
read Username for 'dev.azure.com': terminal prompts disabled\n\n
 at GitExecutorChain.onFatalException
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:60:87)\n
   at GitExecutorChain.<anonymous>
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:51:28)\n
   at Generator.throw (<anonymous>)\n    at rejected
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:6:65)\n
   at processTicksAndRejections (internal/process/task_queues.js:97:5)"
2020-09-01T07:00:11.3906382Z        }
2020-09-01T07:00:11.3906828Z DEBUG: Repository timing splits (milliseconds)
(repository=REDACTED/REDACTED)
2020-09-01T07:00:11.3908662Z        "splits": {},
2020-09-01T07:00:11.3908984Z        "total": 1616
2020-09-01T07:00:11.3919082Z  INFO: Repository finished
(repository=REDACTED/REDACTED)
2020-09-01T07:00:11.3919441Z        "durationMs": 1616
2020-09-01T07:00:11.3919692Z DEBUG: Renovate exiting
2020-09-01T07:00:11.3920362Z  INFO: Renovate is exiting with a non-zero
code due to the following logged errors
2020-09-01T07:00:11.3920752Z        "loggerErrors": [
2020-09-01T07:00:11.3920979Z          {
2020-09-01T07:00:11.3921240Z            "name": "renovate",
2020-09-01T07:00:11.3921745Z            "level": 50,
2020-09-01T07:00:11.3922211Z            "logContext": "8LbBmj_0p",
2020-09-01T07:00:11.3922516Z            "repository": "REDACTED/REDACTED",
2020-09-01T07:00:11.3922789Z            "err": {
2020-09-01T07:00:11.3923058Z              "task": {
2020-09-01T07:00:11.3923325Z                "commands": [
2020-09-01T07:00:11.3923755Z                  "ls-remote",
2020-09-01T07:00:11.3924386Z                  "--heads",
2020-09-01T07:00:11.3924738Z                  "
dev.azure.com/REDACTED/REDACTED/_git/REDACTED"
2020-09-01T07:00:11.3925372Z                ],
2020-09-01T07:00:11.3925767Z                "format": "utf-8"
2020-09-01T07:00:11.3926045Z              },
2020-09-01T07:00:11.3926656Z              "message": "fatal: could not read
Username for 'dev.azure.com': terminal prompts disabled\n",
2020-09-01T07:00:11.3929094Z              "stack": "Error: fatal: could not
read Username for 'dev.azure.com': terminal prompts disabled\n\n
 at GitExecutorChain.onFatalException
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:60:87)\n
   at GitExecutorChain.<anonymous>
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:51:28)\n
   at Generator.throw (<anonymous>)\n    at rejected
(/home/vsts/.npm/_npx/12445/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:6:65)\n
   at processTicksAndRejections (internal/process/task_queues.js:97:5)"
2020-09-01T07:00:11.3930667Z            },
2020-09-01T07:00:11.3930945Z            "msg": "Repository has unknown
error"
2020-09-01T07:00:11.3931198Z          }
2020-09-01T07:00:11.3931399Z        ]=

:tada: This issue has been resolved in version 23.14.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Thanks for the speedy attention, unfortunately this issue is not fixed in version 23.14.3

changed sections of new log

2020-09-01T08:06:31.4194251Z        "renovateVersion": "23.14.3"
2020-09-01T08:06:33.4165446Z DEBUG: git error (repository=REDACTED/REDACTED)
2020-09-01T08:06:33.4166075Z        "err": {
2020-09-01T08:06:33.4166460Z          "task": {
2020-09-01T08:06:33.4166826Z            "commands": [
2020-09-01T08:06:33.4167682Z              "ls-remote",
2020-09-01T08:06:33.4168256Z              "--heads",
2020-09-01T08:06:33.4168733Z              "https://dev.azure.com/REDACTED/REDACTED/_git/REDACTED",
2020-09-01T08:06:33.4169956Z              "--config=http.extraheader=AUTHORIZATION: bearer **redacted**"
2020-09-01T08:06:33.4170717Z            ],
2020-09-01T08:06:33.4171345Z            "format": "utf-8"
2020-09-01T08:06:33.4171782Z          },
2020-09-01T08:06:33.4172951Z          "message": "fatal: could not read Username for 'https://dev.azure.com': terminal prompts disabled\n",
2020-09-01T08:06:33.4175509Z          "stack": "Error: fatal: could not read Username for 'https://dev.azure.com': terminal prompts disabled\n\n    at GitExecutorChain.onFatalException (/home/vsts/.npm/_npx/2096/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:60:87)\n    at GitExecutorChain.<anonymous> (/home/vsts/.npm/_npx/2096/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:51:28)\n    at Generator.throw (<anonymous>)\n    at rejected (/home/vsts/.npm/_npx/2096/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.js:6:65)\n    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
2020-09-01T08:06:33.4177561Z        }

the rest of the log is as above.

@JamieMagee @rarkins Instead of generating the git url by ourself we should use the webUrl or remoteUrl from the repo details. Maybe there is something wrong. we can faqllback to manual url if repo setting is missing.

https://docs.microsoft.com/en-us/rest/api/azure/devops/git/repositories/list?view=azure-devops-rest-6.0#gitrepository

Unfortunately I'm not able to reproduce the error with my own AD account, which makes it hard.

@rarkins Let me try

@stocksr This line from your logs looks a little strange

"--config=http.extraheader=AUTHORIZATION: bearer **redacted**"

Can I ask what your using as the authentication?

@stocksr This line from your logs looks a little strange

"--config=http.extraheader=AUTHORIZATION: bearer **redacted**"

Can I ask what your using as the authentication?

I am using RenovateMe which pulls in a PAT that is auto-generated for each run and passes it as the --token on the command line.
[command]/opt/hostedtoolcache/node/12.18.3/x64/bin/npx renovate@latest REDACTED/REDACTED --platform azure --endpoint dev.azure.com/REDACTED --token **redacted** --log-level=debug

The release of version 23.14.3 added that line to the log.

I had a look at how azure devops accesses the git repo in other builds and I can see two differences, but I don't know which is significant

RENOVATE

   "ls-remote",
2020-09-01T08:06:33.4168256Z              "--heads",
2020-09-01T08:06:33.4168733Z              "https://dev.azure.com/REDACTED/REDACTED/_git/REDACTED",
2020-09-01T08:06:33.4169956Z              "--config=http.extraheader=AUTHORIZATION: bearer **redacted**"

checkout step from different build

git remote add origin https://[email protected]/REDACTED/REDACTED/_git/REDACTED
git -c http.extraheader="AUTHORIZATION: bearer ***" fetch --force --tags --prune --progress --no-recurse-submodules origin

Difference 1: I can see an extra = between the --config and http.extraheader
Difference 2: I can also see a missing USERNAME@ in the url for the repository, and I notice that further up the renovate log that the matching url is output as the remoteUrl in the Repository details section

2020-09-01T07:00:10.3325806Z DEBUG: Repository details
(repository=REDACTED/REDACTED)
2020-09-01T07:00:10.3327323Z        "repositoryDetails": {
2020-09-01T07:00:10.3328358Z          "id":
"e21b3db9-f7c8-4715-804c-6dbf8de2c8e6",
2020-09-01T07:00:10.3328592Z          "name": "REDACTED",
2020-09-01T07:00:10.3329135Z          "url": "
dev.azure.com/REDACTED/ae1cd160-cde5-499f-a8d7-REDACTED/_apis/git/repositories/e21b3db9-f7c8-4715-804c-REDACTED
",
2020-09-01T07:00:10.3329431Z          "project": {
2020-09-01T07:00:10.3330014Z            "id":
"ae1cd160-cde5-499f-a8d7-REDACTED",
2020-09-01T07:00:10.3330241Z            "name": "REDACTED",
2020-09-01T07:00:10.3330651Z            "description": "Unified REDACTED
project for all development",
2020-09-01T07:00:10.3331161Z            "url": "
dev.azure.com/REDACTED/_apis/projects/ae1cd160-cde5-499f-a8d7-REDACTED
",
2020-09-01T07:00:10.3331455Z            "state": "wellFormed",
2020-09-01T07:00:10.3331641Z            "revision": 411520266,
2020-09-01T07:00:10.3331820Z            "visibility": 0,
2020-09-01T07:00:10.3332226Z            "lastUpdateTime":
"2019-10-31T17:31:37.380Z"
2020-09-01T07:00:10.3332427Z          },
2020-09-01T07:00:10.3332593Z          "defaultBranch": "refs/heads/main",
2020-09-01T07:00:10.3332806Z          "size": 218970556,
2020-09-01T07:00:10.3333036Z          "remoteUrl": "
https://[email protected]/REDACTED/REDACTED/_git/REDACTED",
2020-09-01T07:00:10.3333521Z          "sshUrl": "[email protected]:
v3/REDACTED/REDACTED/REDACTED",
2020-09-01T07:00:10.3333786Z          "webUrl": "
dev.azure.com/REDACTED/REDACTED/_git/REDACTED"
2020-09-01T07:00:10.3333969Z        }

hope this helps
Robert.

I found that the metadata for the repo includes the URL with username@ so have raised a PR to default to it: https://github.com/renovatebot/renovate/pull/7165

:tada: This issue has been resolved in version 23.16.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

sorry guys - but 23.16.2 did not fix it either - but did change the error message
it now reads fatal: could not read Password for 'https://**redacted**@dev.azure.com': terminal prompts disabled

I did some testing on a local machine with a manually generated PAT and the only way I could get git ls-remote to work was by adding the PAT to the url after the user name

git ls-remote --heads https://{USERNAME}:{PAT}@dev.azure.com/{Org}/{Project}/_git/{Project}

https://github.com/MicrosoftDocs/azure-devops-docs/issues/5540

Looks like a general azure devops issue

maybe related: https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&tabs=classic#limit-job-authorization-scope-to-referenced-azure-devops-repositories

Hm, I'm supplying a seperate user pat via a secret variable (not using System.AccessToken) so I'm not sure that access to the OAuth token would apply

@DevRCRun Are you sure you PAT has all nessessary rights to clone? did you tried to clone with it locallly?

yes, insofar as the pipeline has been working, and if I set npx to install an earlier version [email protected] it works as before (used that version as it matched last successful run - this is in testing at the mo and not running on schedule)

@DevRCRun can you try to run the cli from your local pc and check if it will work?

@DevRCRun What's the length of your PAT? is it 52 chars long?

your logged header shoud look like: Authorization: Basic ****

https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=preview-page#use-a-pat

@stocksr What are you using for auth? Also a PAT or the pipeline system token?

Yeah, this is what I was trying to get at earlier. bearer implies OAuth, which is not what we want. A PAT is really just basic auth, which is what we should be using here.

@JamieMagee @rarkins I had the idea to make the auth type configurable for hostrules, so a user can explicit say to use basic even if suplying a token.

eg

{
  authType: 'basic',
  token: 'XXXX=',
}

results in header: 'AUTHORIZATION: basic XXXX='

Seeing a similar issue, trying to set up Renovate for the first time in a CI pipeline using the Renovate Me marketplace extension on a private build agent

C:\Windows\system32\cmd.exe /D /S /C "C:\VSTS\BuildAgents\agent-b\_work\_tool\node\14.9.0\x64\npx.cmd renovate@latest "REDACTED/REDACTED" --platform azure --endpoint https://REDACTED.visualstudio.com/ --token ***"
 INFO: Repository started (repository=REDACTED/REDACTED)
       "renovateVersion": "23.16.2"
ERROR: Repository has unknown error (repository=REDACTED/REDACTED)
       "err": {
         "task": {
           "commands": [
             "ls-remote",
             "--heads",
             "https://[email protected]/REDACTED/REDACTED/_git/REDACTED",
             "--config=http.extraheader=AUTHORIZATION: bearer **redacted**"
           ],
           "format": "utf-8"
         },
         "message": "fatal: could not read Password for 'https://**redacted**@dev.azure.com': terminal prompts disabled\n",
         "stack": "Error: fatal: could not read Password for 'https://**redacted**@dev.azure.com': terminal prompts disabled\n\n    at GitExecutorChain.onFatalException (C:\\Windows\\ServiceProfiles\\NetworkService\\AppData\\Roaming\\npm-cache\\_npx\\476\\node_modules\\renovate\\node_modules\\simple-git\\src\\lib\\runners\\git-executor-chain.js:60:87)\n    at GitExecutorChain.<anonymous> (C:\\Windows\\ServiceProfiles\\NetworkService\\AppData\\Roaming\\npm-cache\\_npx\\476\\node_modules\\renovate\\node_modules\\simple-git\\src\\lib\\runners\\git-executor-chain.js:51:28)\n    at Generator.throw (<anonymous>)\n    at rejected (C:\\Windows\\ServiceProfiles\\NetworkService\\AppData\\Roaming\\npm-cache\\_npx\\476\\node_modules\\renovate\\node_modules\\simple-git\\src\\lib\\runners\\git-executor-chain.js:6:65)\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)"
       }
 INFO: Repository finished (repository=REDACTED/REDACTED)
       "durationMs": 1810
 INFO: Renovate is exiting with a non-zero code due to the following logged errors
       "loggerErrors": [
         {
           "name": "renovate",
           "level": 50,
           "logContext": "T9G3wMHDX",
           "repository": "REDACTED",
           "err": {
             "task": {
               "commands": [
                 "ls-remote",
                 "--heads",
                 "https://[email protected]/REDACTED/REDACTED/_git/REDACTED",
                 "--config=http.extraheader=AUTHORIZATION: bearer **redacted**"
               ],
               "format": "utf-8"
             },
             "message": "fatal: could not read Password for 'https://**redacted**@dev.azure.com': terminal prompts disabled\n",
             "stack": "Error: fatal: could not read Password for 'https://**redacted**@dev.azure.com': terminal prompts disabled\n\n    at GitExecutorChain.onFatalException (C:\\Windows\\ServiceProfiles\\NetworkService\\AppData\\Roaming\\npm-cache\\_npx\\476\\node_modules\\renovate\\node_modules\\simple-git\\src\\lib\\runners\\git-executor-chain.js:60:87)\n    at GitExecutorChain.<anonymous> (C:\\Windows\\ServiceProfiles\\NetworkService\\AppData\\Roaming\\npm-cache\\_npx\\476\\node_modules\\renovate\\node_modules\\simple-git\\src\\lib\\runners\\git-executor-chain.js:51:28)\n    at Generator.throw (<anonymous>)\n    at rejected (C:\\Windows\\ServiceProfiles\\NetworkService\\AppData\\Roaming\\npm-cache\\_npx\\476\\node_modules\\renovate\\node_modules\\simple-git\\src\\lib\\runners\\git-executor-chain.js:6:65)\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)"
           },
           "msg": "Repository has unknown error"
         }
       ]
internal/fs/utils.js:298
    throw err;
    ^

@scp-mb Are you using a PAT? What's the length of the PAT?

PAT in my case is indeed 52 chars, log shows --config=http.extraheader=AUTHORIZATION: basic

@viceice Yes, but it's assigned by the pipeline itself so it's not visible and gets automatically redacted in log outputs

image

@stocksr What are you using for auth? Also a PAT or the pipeline system token?
I am using the pipeline system token.

did some more digging at a local command prompt and I am not sure if it helps or not but I don't think git ls-remote supports the cli config parameter

if I move the -c parameter earlier in the git command line

git ls-remote -c http.extra="{snip}" --heads {url}
I get error: unknown switch `c'

where

git ls-remote --heads {url} -c http.extra="{snip}"

prompts for login info.

ok, debugging now

can reproduce it, working on fix

command must be:

git -c http.extraheader='AUTHORIZATION: basic XXXX=' ls-remote --heads https://[email protected]/org/proj/_git/repo

:tada: This issue has been resolved in version 23.16.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

I can confirm this is now working and PRs are being created. Thanks for the speedy fix @viceice

I can also confirm that this is now working for me as of version 23.16.3, many thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OmgImAlexis picture OmgImAlexis  路  4Comments

Flydiverny picture Flydiverny  路  4Comments

ZauberNerd picture ZauberNerd  路  4Comments

ChristianMurphy picture ChristianMurphy  路  4Comments

zephraph picture zephraph  路  3Comments