Azure self-hosted agent pipeline stuck with "The agent request is not running because all potential agents are running other requests."

Bud3 0 Reputation points
2025-02-11T22:25:59.99+00:00

I'm having trouble getting a Job stage to run for a given pipeline in DevOps where there are no parallel jobs, the capabilities seem to be met, no jobs are waiting for approval. I have 2 current build servers that the pipelines currently run on. I'm attempting to replace the build servers by creating new agents to run the pipelines on. Other pipelines run on these agents, but I cannot get one particular agent to run on the build systems. I cannot find any specific demand that requires a particular agent in this pipeline. I'm hoping for suggestions on what else I can do to troubleshoot.

User's image

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
42,880 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Vinodh247 30,521 Reputation points MVP
    2025-02-12T00:38:27.8666667+00:00

    Hi ,

    Thanks for reaching out to Microsoft Q&A.

    It seems you have already checked several key areas, including agent capabilities, approval status, and demands.

    1. Verify Agent Pool Configuration

    • Go to Azure DevOps > Organization Settings > Agent Pools.
    • Check if the agent pool associated with your pipeline has the expected agents.
    • Ensure that the correct agent pool is being referenced in the pipeline YAML.

    2. Check for Stale Pipeline Runs

    • Go to Pipelines > Runs and see if any previous runs are stuck in a waiting or running state.
    • If there are, cancel them and retry running your pipeline.

    3. Ensure There Are No Conflicting Demands

    • You mentioned that the demands do not explicitly restrict the agent, but try running:

    pool:   name: Default   demands: []

    • This removes all demand restrictions to see if the pipeline can run on any agent.

    4. Force Run on a Specific Agent

    If you suspect a scheduling issue, try specifying the exact agent in your pipeline YAML:

    pool:   name: Default   demands:     - Agent.Name -equals BUILDAGENT01

    • Replace BUILDAGENT01 with the agent name you want to use.

    5. Check Agent Logs

    • On the self-hosted agent machine, check the logs at:

    C:\agent_diag

    • Look for errors or warnings related to agent connectivity or pipeline execution.

    6. Restart Agents

    • On the affected agents, restart the Azure DevOps agent service:

    Stop-Service vstsagent.service Start-Service vstsagent.service_

    • Alternatively, restart the build server entirely.

    7. Reinstall the Agent

    • If issues persist, unregister the agent and reinstall it:

    .\config.cmd remove

    • Then, reconfigure it using:

    .\config.cmd

    8. Check for Job Timeout Issues

    • Some jobs may be timing out without obvious failure messages.
    • Try increasing the timeout in your YAML:

    jobs:   - job: MyJob     timeoutInMinutes: 120  # Increase as needed

    9. Verify Parallelism Settings

    • Go to Agent Pool Settings and check the Maximum Parallel Jobs limit.
    • If it's low, increase it to allow more jobs to run concurrently.

    10. Check Azure DevOps Service Status

     

    Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.

    0 comments No comments

  2. Rakesh Gurram 13,215 Reputation points Microsoft External Staff
    2025-02-12T03:36:58.3166667+00:00

    Hi Bud3,

    Thank you for reaching out to us on the Microsoft Q&A forum.

    Azure DevOps is currently not supported in the Q&A forums.

    I recommend initiating a new discussion through the Developer Community

    Moderators are readily available there to assist you and provide guidance.

    Please don't forget to Accept answer and close this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.