Skip to content

Azure Pipelines: Space in pool name causes HTTP 400 errors #5107

@chunderbolt

Description

@chunderbolt

Report

When the pool name contains a space (e.g. "Pool Name"), warnings of type KEDAScalerFailed appear in the logs:

error parsing azure Pipelines metadata: the Azure DevOps REST API returned error. url: https://dev.azure.com/org-url/_apis/distributedtask/pools?poolName=Pool Name status: 400 response: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request</h2>
<hr><p>HTTP Error 400. The request is badly formed.</p>
</BODY></HTML>

This doesn't happen when there's no space in the name.

Expected Behavior

I expected the scaler to do whatever's necessary to properly query the given pool name - assuming it's valid. This would result in the scaler calling https://dev.azure.com/org-url/_apis/distributedtask/pools?poolName=Pool%20Name (which returns correctly).

Actual Behavior

The scaler calls https://dev.azure.com/org-url/_apis/distributedtask/pools?poolName=Pool Name and the DevOps API complains that the request is malformed.

Steps to Reproduce the Problem

  1. Create a pool with a space in the name.
  2. Create a self-hosted docker agent.
  3. Run a pipeline that would utilise the self-hosted agent.
  4. Observe the errors in the logs.

Logs from KEDA operator

No response

KEDA Version

2.10.0 (according to kedaConfiguration in the JSON view of the Container App Environment resource)

Kubernetes Version

Unknown, as it's running in Container Apps.

Platform

Microsoft Azure

Scaler Details

Azure Pipelines

Anything else?

This happened when running a self-hosted docker agent using the KEDA azure-pipelines scaler in Azure Container Apps. I don't know whose responsibility it is to add URL encoding to the pool name: KEDA, Azure Container Apps, or the user. The docs don't mention it either way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Ready To Ship

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions