azure-pipelines-tasks: [BUG]: KubeloginInstallerV0 Cannot read properties of undefined (reading 'trim')
Task name
KubeloginInstallerV0
Task version
0.226.0
Environment type (Please select at least one enviroment where you face this issue)
- Self-Hosted
- Microsoft Hosted
- VMSS Pool
- Container
Azure DevOps Server type
Azure DevOps Server (Please specify exact version in the textbox below)
Azure DevOps Server Version (if applicable)
Azure DevOps Server 2023.8
Operation system
Debian 12
Task log
Starting: KubeloginInstaller
==============================================================================
Task : Kubelogin tool installer
Description : Helps to install kubelogin
Version : 0.226.0
Author : Microsoft Corporation
Help : https://azure.github.io/kubelogin/index.html
==============================================================================
##[error]Cannot read properties of undefined (reading 'trim')
Finishing: KubeloginInstaller
Relevant log output
##[error]Cannot read properties of undefined (reading 'trim')
Aditional info
Kubelogin version: 0.0.32
After restarting failed job, this task succeeds
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 18 (3 by maintainers)
Hello, Thank you for reporting the issue.
The root cause of the issue is that the task is making an anonymous REST API call to GitHub in order to fetch the latest version of kubelogin. However, anonymous calls in GitHub are subject to a limit of 60 requests per hour. When a 403 error occurs in the task, it is not being handled properly, leading to a failure later in the code when attempting to use the version tag. Hence, you see the error “cannot read property of undefined”.
There is no way to provide credentials to the task to make an authorized rest api call with a rate limit of 5000 calls per hour. However, there are 2 possible workarounds. The first one is to specify the version explicitly in the task. This way we will skip the call to github to retrieve the latest version. For example,
We will be working on a fix , but there is no ETA at the moment.
(Note. This issue is unlikly to happen on Microsoft Hosted agents because a new agent is assigned to each pipeline run )
@matthawley A quick workaround we do is to replace the official task with a bash/PS script:
Just observed the same thing happening on two VMs of ours. Self-hosted and built with the MS template. Re-running the deploy worked (on the third try).
Wouldn’t specifying the version explicitly also hit the GitHub API rate limit? It seems
getKubeloginRelease()is called which queries the API:Is there any update on this issue? We are required to use kubelogin for AKS + Azure AD + Azure RBAC integration, and the task fails often enough to make this a serious challenge for teams.
I was also experiencing that issue ~30 mins ago on self-hosted agents.
It appears to have been fixed now - my pipelines are working again 😃