Azure / Azure/azure-devops-cli-extension

[Bug] Unable to create a pipeline without error when running

Open
#960 4 comments 0 reactions 1 assignee Claimed by @roshan-sy View on GitHub
Area: ProToCol bug
Dominant language
Python
Stars
682
Forks
278
Avg merge
3d 23h
Merged PRs (30d)
3

Description

**Describe the bug**
When creating a new pipeline via AZ CLI I get an error that it could not queue the build because there were validation errors or warnings. This happens with a known working yaml file or when I let it create the starter file

**To Reproduce**
Azure Cli Version:
2.1.0

Azure-Devops extension version:
azure-devops 0.17.0

Steps to reproduce the behavior:
Logged into Azure Devops in Az CLI and run the commands below

```
# Define Variables
org='https://dev.azure.com/orgname'
project='projectname'
infraRepo='App01.Infra'
infraPipelineName='Build Infrastructure'
infraPipelineDesc='Builds the infrastructure'
infraPipelineBranch='master'
infraPipelineYaml='Build-Infra-Pipeline.yml'
pipelineType='tfsgit'

# Builds Pipeline
az pipelines create --name "$infraPipelineName" \
--description "$infraPipelineDesc" \
--org "$org" \
--project "$project" \
--repository "$infraRepo" \
--branch "$infraPipelineBranch" \
--repository-type $pipelineType \
--service-connection "$svcConID" \
--yaml-path "$infraPipelineYaml"
```

**Expected behavior**
I would expect it to the build the pipeline pipeline and start to run it.

**Debug logs**
urllib3.connectionpool : https://dev.azure.com:443 "POST /orgname/projectname/_apis/build/Builds HTTP/1.1" 400 583
azext_devops.devops_sdk.client : Response content: b'{"$id":"1","customProperties":{"ValidationResults":[{"result":"error","message":"An error occurred while loading the YAML build pipeline. Repository self references endpoint 71766954-6580-43ce-aef7-xxxxxxxxxxxx which does not exist or is not authorized for use"}]},"innerException":null,"message":"Could not queue the build because there were validation errors or warnings.","typeName":"Microsoft.TeamFoundation.Build.WebApi.BuildRequestValidationFailedException, Microsoft.TeamFoundation.Build2.WebApi","typeKey":"BuildRequestValidationFailedException","errorCode":0,"eventId":3000}'
msrest.exceptions : Could not queue the build because there were validation errors or warnings.
handling vsts service error

**Additional context**
If I use the same YAML file and build the project through the GUI it creates and runs correctly. Additionally, I omitted the parameter '--yaml-path' and tried to create the "Sample Pipeline" (option 1) and it received the same error so I don't think it is a YAML issue.

The pipeline is also created without error if I add the "--skip-run" parameter but it fails when running with the error below.

![image](https://user-images.githubusercontent.com/50719731/75627069-8e5c7c00-5b92-11ea-99fa-50235b4e11f6.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.