No pool was specified, although a pool is specified in the Azure pipeline
Asked Answered
D

4

5

I have a problem in the ADOS system that the pipeline fails because there is no "pool" specified. Also the validation shows this error. However, I have defined a pool.

trigger: 
  branches:
    include:
      - 'main'

pool: 
  name: my-pool
  demands:
    - my_pool_demands

[...]

Do you have any clue?

I tried to

  • run the pipeline with other pool
  • run the pipeline without pool
  • run the pipeline with minimum tasks (only build task)
  • run the pipeline without any comments in it

Nothing could change the "No pool was specified" error.

Darkle answered 1/12, 2022 at 13:59 Comment(0)
D
7

After hours of modifying my pipeline and reading the documentation, I finally figured out how to fix this problem. It is not because of the yaml file. The error must be related to the pipeline. The solution is to create a new pipeline. The same yaml file will work fine in the new pipeline.

Darkle answered 1/12, 2022 at 14:4 Comment(1)
This comment was really helpful, as this fixed my issue!Bethlehem
B
4

You can use the yaml file to create a new pipeline, but then you have to edit the pipeline, click the top right dots button, triggers, then YAML, then pipeline, and select the pool under "Default agent pool for YAML"

Consider going to this issue on the feedback hub and commenting on the "solution" to let Microsoft know we'd like this fixed. We shouldn't have to do a workaround.

https://developercommunity.visualstudio.com/t/Auto-created-pipeline-from-yaml-return-e/10054547?q=yaml+no+pool+was+specified

Bumblebee answered 7/1, 2023 at 1:6 Comment(0)
P
1

Edit the pipeline and check if there's any weird red warnings. That's what I did and somehow the agent pool setting was cleared out.

Plutocracy answered 14/9, 2023 at 0:55 Comment(0)
I
1

For future readers, this may be related to how the pipeline is setup. If you edit your pipeline from the portal, use the context menu and to to Triggers, there will be an error on the YAML tab for Default agent pool for YAML.

This happened to me as I was automating setup of pipelines via the API, instead of using the portal, so the pool was not set. The fix for me was to set a queue pool in the create payload. The portal should set this for you.

It seems the "classic" pipelines stuck around and yaml doesnt get interpreted as expected if you do not use the official way.


Here is the request to the ADO API:

await buildAPI.createDefinition(
        {
          name,
          path: folderPath,
          type: DefinitionType.Build,
          queueStatus: DefinitionQueueStatus.Enabled,
          process: {
            type: 2,
            yamlFilename: filename,
          } as YamlProcess,
          project: { id: this.project!.id },
          queue: { pool: { name: "Azure Pipelines" } },
          repository: {
            id: this.repo!.id,
            type: "TfsGit",
          },
          triggers: [
            {
              triggerType: DefinitionTriggerType.ContinuousIntegration,
              branchFilters: ["master"],
              maxConcurrentBuildsPerBranch: 1,
              settingsSourceType: 2, // Not sure what this is
            } as ContinuousIntegrationTrigger,
          ],
        },
        this.project!.id
      );
Ignatz answered 10/7 at 11:39 Comment(2)
How did you "set a queue pool in the create payload"? Please can you update your answer with that?Roulade
Code added. The part you are looking to add is: queue: { pool: { name: "Azure Pipelines" } }Ignatz

© 2022 - 2024 — McMap. All rights reserved.