huserben / TfsExtensions

Extensions for TFS 2015+ such as custom Widgets (require TFS 2017) and Build Tasks
MIT License
44 stars 22 forks source link

Trigger Build task suddenly stopped working for us #247

Closed jmjaffe37 closed 1 year ago

jmjaffe37 commented 1 year ago

Hello, my team uses the TriggerBuild@3 task and it suddenly stopped working to trigger one of our other pipelines. Here is the weird thing: neither the triggering stage nor the triggered pipeline have changed since it was previously working (last successful useage: Friday 5/19). Also, other stages that use the TriggerBuild@3 task are still working.

Below is the screenshot of the code as it is now (same as it was when it worked). This gives me this error message: Error message: Error: The parameters JSON property value '' is semantically incorrect. This field must be a stringified JSON dictionary.

Note: The pipeline that needs to be triggered will take in no template params and has all pipeline variables already defined in the azo UI (I believe those are referred to as buildParameters in this task)

Things I have tried:

  1. Feeding in a dummy value for buildParameters

    • this should be unnecessary since needed pipeline/environment variables are already defined in the azdo UI
    • this gives the following error message: Error message: Error: Could not queue the build because there were validation errors or warnings.
  2. Explicitly defining all variables (as opposed to letting TriggerBuild define some defaults)

    • example: waitForQueuedBuildsToFinishRefreshTime: 60
  3. Using double quotes around all Boolean and integer values

  4. Updating to version 4 (TriggerBuild@4)

  5. Changing target pipeline's pool to vmImage: ubuntu-latest

  6. Setting branchToUse: 'main' instead of using coalesce.

Nothing seemed to work so far, and I am not sure what else I can still try (other than moving to the REST API)

image

huserben commented 1 year ago

Hi @jmjaffe37

first of all, thanks for the detailed description of what you've tried. In general, I would advise going to version 4, just to be on the latest one in case there is an update (if something needs changing for this problem to be solved, it will be in version 4).

It is very odd that nothing changed in your pipelines and also that other pipelines still work with the task. Not sure what could cause this.

One thing you could try is to set both buildParameters and templateParameters. Either try it with an empty string for both or you can also try to set them to an empty dictionary, something like this:

    buildParameters: '{}'
    templateParameters: '{}'

Sorry for not being able to give a better input, but I'm a bit puzzled about the problem.

jmjaffe37 commented 1 year ago

Looks like the problem fixed itself. I just came back from vacation, and my team informed me that the issue was resolved without any changes. I'm guessing the issue was probably caused by an update to the REST API.