microsoft / symphony

CI/CD for IaC on multiple orchestrators
MIT License
170 stars 17 forks source link

AzDO error during Destroy pipeline creation #211

Open mahomedalid opened 1 year ago

mahomedalid commented 1 year ago

I am troubleshooting an error when the Destroy pipeline is created in AzDo. It actually gets created, but in some part of the process there are errors. The payload created for the Destroy is invalid and does not show in the debug (because jq cannot parse it).

Payload:

{
    "process": {
        "yamlFilename": "/.azure-pipelines/pipeline.destroy.terraform.yml",
        "type": 2,
        "resources": {},
        "target": null
    },
    "repository": {
        "type": "TfsGit",
        "name": "azterraformX77",
        "defaultBranch": "refs/heads/main"

    },
    "path": "Destroy",
    "name": "Destroy",
    "type": "build",
    "queueStatus": "enabled",
    "triggers": [
        {
            "batchChanges": false,
            "maxConcurrentBuildsPerBranch": 1,
            "pollingJobId": null,
            "pollingInterval": 0,
            "pathFilters": [],
            "branchFilters": [
                "+refs/heads/main"
            ],
            "defaultSettingsSourceType": 2,
            "isSettingsSourceOptionSupported": true,
            "settingsSourceType": 2,
            "triggerType": 2
        }
    ],
 },llowOverride" : true-136",me" : {" : {
    "queue": {
        "id": ,
        "name": "",
        "url": "https://dev.azure.com/mahopam/_apis/build/Queues/",
        "pool": {
            "id": ,
            "name": "",
            "isHosted": true
        }
    }
}

jq error:

parse error: Expected value before ',' at line 36, column 15

Errors on error_log:

----------------------------------------------
Inner Exception in Http Response
_request_uri: https://dev.azure.com/mahopam/azdo-terraform88/_apis/pipelines/pipelinePermissions/queue/?api-version=5.1-preview.1
_response:
{"$id":"1","innerException":null,"message":"Permissions request cannot be null","typeName":"System.InvalidOperationException, mscorlib","typeKey":"InvalidOperationException","errorCode":0,"eventId":0}
----------------------------------------------
Inner Exception in Http Response
_request_uri: https://dev.azure.com/mahopam/azdo-terraform88/_apis/pipelines/pipelinePermissions/queue/?api-version=5.1-preview.1
_response:
{"$id":"1","innerException":null,"message":"Permissions request cannot be null","typeName":"System.InvalidOperationException, mscorlib","typeKey":"InvalidOperationException","errorCode":0,"eventId":0}

The latest error_log error does not seem to be related to the initial error, but I am not sure. I would suggest as a feature to create the json payloads using jq if possible, instead of replacing vars, or at least evaluate the json payload before submitting the request.

mahomedalid commented 1 year ago

I found the issue, related to #165 , it was missing the Agent Pool access. However, it is an improvement to check and not continue with the process. I will put a PR with some ideas of how could be improved.

mahomedalid commented 1 year ago

I have a PR but not sure why github does not let me to compare across forks, I just created a PR for a different thing few hours ago. Will try again on the weekend or next week.