Ошибка Azure DevOps: сбой проверки Git с кодом выхода: 1

Я отправил код со своего локального компьютера в репозиторий Azure. Нажимая код, голова указала на ветку Master. Что нормально. После этого я создал релиз и обнаружил ошибку git checkout. Я проверил агентскую машину и увидел, что она указывает на конкретную фиксацию, а не на ветку. Как я могу решить эту проблему?

Смотрите логи здесь,

2020-02-04T07:34:23.2688328Z You are in 'detached HEAD' state. You can look around, make experimental
2020-02-04T07:34:23.2688360Z changes and commit them, and you can discard any commits you make in this
2020-02-04T07:34:23.2688390Z state without impacting any branches by performing another checkout.
2020-02-04T07:34:23.2688437Z 
2020-02-04T07:34:23.2688466Z If you want to create a new branch to retain commits you create, you may
2020-02-04T07:34:23.2688496Z do so (now or later) by using -b with the checkout command again. Example:
2020-02-04T07:34:23.2688518Z 
2020-02-04T07:34:23.2688565Z   git checkout -b <new-branch-name>
2020-02-04T07:34:23.2688588Z 
2020-02-04T07:34:23.2688616Z HEAD is now at 5c95b07 Added samplefile
2020-02-04T07:34:23.3208965Z An error occurred during download: System.InvalidOperationException: Git checkout failed with exit code: 1
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.GitSourceProvider.GetSourceAsync(IExecutionContext executionContext, ServiceEndpoint endpoint, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.Agent.Worker.Release.Artifacts.TfsGitArtifact.DownloadAsync(IExecutionContext executionContext, ArtifactDefinition artifactDefinition, String downloadFolderPath)
   at Microsoft.VisualStudio.Services.Agent.Worker.Release.ReleaseJobExtension.<>c__DisplayClass39_2.<<DownloadArtifacts>b__2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Services.Agent.Worker.Release.RetryExecutor.ExecuteAsync(Func`1 action)
2020-02-04T07:34:23.3209166Z Retrying download...
2020-02-04T07:34:23.3211433Z Ensuring artifact folder C:\agent\vsts-agent-win-x64-2.163.1\_work\r2\a\_JHipsterDemoRepo exists and is clean.
2020-02-04T07:34:26.6696074Z Syncing repository: 3290da05-8551-4d0f-a00c-037d882d4835 (Git)
2020-02-04T07:34:26.6699057Z Prepending Path environment variable with directory containing 'git.exe'.
2020-02-04T07:34:26.6700464Z ##[command]git version
2020-02-04T07:34:26.6934186Z git version 2.21.0.windows.1
2020-02-04T07:34:26.6962266Z ##[command]git init "C:\agent\vsts-agent-win-x64-2.163.1\_work\r2\a\_JHipsterDemoRepo"
2020-02-04T07:34:26.7597056Z Initialized empty Git repository in C:/agent/vsts-agent-win-x64-2.163.1/_work/r2/a/_JHipsterDemoRepo/.git/
2020-02-04T07:34:26.7621586Z ##[command]git remote add origin https://[email protected]/218316/CITS-Insights%20POC/_git/JHipsterDemoRepo
2020-02-04T07:34:26.7846491Z ##[command]git config gc.auto 0
2020-02-04T07:34:26.8167913Z ##[command]git config --get-all http.https://[email protected]/218316/CITS-Insights%20POC/_git/JHipsterDemoRepo.extraheader
2020-02-04T07:34:26.8372843Z ##[command]git config --get-all http.proxy
2020-02-04T07:34:26.8590568Z ##[command]git -c http.extraheader="AUTHORIZATION: bearer ***" fetch --tags --prune --progress --no-recurse-submodules origin
2020-02-04T07:34:26.9953230Z remote: Azure Repos        
2020-02-04T07:34:26.9953340Z remote: We noticed you're using an older version of Git. For the best experience, upgrade to a newer version.

person Suraj Shinde    schedule 04.02.2020    source источник
comment
это не проблема, лазурный DevOps всегда проверяет это   -  person 4c74356b41    schedule 04.02.2020
comment
Не могли бы вы предложить мне, как я могу разрешить эту ошибку "Ошибка проверки Git", потому что я не могу выяснить основную причину   -  person Suraj Shinde    schedule 04.02.2020
comment
ну, это слишком случайно. за этим может быть что угодно   -  person 4c74356b41    schedule 04.02.2020
comment
Нам понадобятся дополнительные сведения, чтобы это исправить. Вы выполнили сборку с включенной диагностикой? Вы можете прикрепить этот журнал сюда?   -  person jessehouwing    schedule 04.02.2020
comment
Пожалуйста, найдите журналы. К вашему сведению, я использую git версии 2.25.0   -  person Suraj Shinde    schedule 04.02.2020


Ответы (1)


Ошибка Azure DevOps: сбой проверки Git с кодом выхода: 1

Согласно журналу ошибок:

Microsoft.VisualStudio.Services.Agent.Worker.Build.GitSourceProvider.GetSourceAsync

Затем я проверяю соответствующий исходный код функции: GetSourceAsync. Кажется, в ваших репозиториях есть подмодуль, поэтому эта проблема может быть вызвана тем, что перед сборкой не было включено Checkout Submodule optional.

Значение по умолчанию checkoutSubmodules - False.

Чтобы решить эту проблему, попробуйте перейти на страницу Add an artifact, затем включите необязательный параметр: Checkout submodules:

введите здесь описание изображения

Надеюсь это поможет.

person Leo Liu-MSFT    schedule 05.02.2020
comment
Я попытался проверить «подмодуль проверки», но он не работал. Получение такой же ошибки. - person Suraj Shinde; 05.02.2020
comment
@SurajShinde, как насчет использования размещенного агента вместо вашего частного агента? Если эта проблема не возникла на размещенном агенте, попробуйте поделиться журналом отладки в своем вопросе. - person Leo Liu-MSFT; 05.02.2020