Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AzDO error during Destroy pipeline creation #211

Open
mahomedalid opened this issue Jul 7, 2023 · 2 comments
Open

AzDO error during Destroy pipeline creation #211

mahomedalid opened this issue Jul 7, 2023 · 2 comments

Comments

@mahomedalid
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant