Open TeodoraEinoryte opened 1 year ago
Same problem here!
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 :)
Hi everyone, thanks for reporting. Can anyone confirm if this issue still persists? if so what's the reoccurrence rate? I was just checking the source code of this task, and I don't see any recent changes deployed (last change was 2 months back), so ig it's unlikely this issue might be from the task end.
Can anyone confirm if this issue is fixed? if not, can you enable the debug logs (system.debug=true) and send us the failure logs to v-mohithgc @microsoft.com.
Thanks
Hello, thanks for the response. This issue appears from time to time, like once a week for us on multiple pipelines. It existed all the time since we started using kubelogin task (for a month now). I will try to capture output with debug logs.
Edit: logs sent to the provided email
I was experiencing the issue yesterday for about 1 hour (on self hosted agents).
EDIT: We've started to experience the issue again
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 )
Thank you very much for your response and your suggestions on how to resolve the issue!
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.
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,
- task: KubeloginInstaller@0 inputs: kubeloginVersion: 0.0.30
Wouldn't specifying the version explicitly also hit the GitHub API rate limit? It seems getKubeloginRelease()
is called which queries the API:
let request = new webClient.WebRequest();
request.uri = 'https://api.github.com/repos/' + KUBELOGIN_REPO_OWNER + '/' + KUBELOGIN_REPO + '/releases/tags/' + version;
request.method = 'GET';
request.headers = request.headers || {};
request.headers['User-Agent'] = userAgent;
const response = await webClient.sendRequest(request);
@sivetic is right -we've specified a version, and we consistently still get rate limited. We need to find a different solution until this gets resolved as it's pretty impactful to our pipelines.
@matthawley A quick workaround we do is to replace the official task with a bash/PS script:
- bash: |
curl -fsSLO https://github.com/Azure/kubelogin/releases/download/v0.1.1/kubelogin-linux-amd64.zip
unzip -ojd /usr/local/bin kubelogin-linux-amd64.zip bin/linux_amd64/kubelogin
rm -f kubelogin-linux-amd64.zip
kubelogin --version
displayName: 'Install Kubelogin'
@sivetic Nice - I'll give this a try!
@matthawley A quick workaround we do is to replace the official task with a bash/PS script:
- bash: | curl -fsSLO https://github.com/Azure/kubelogin/releases/download/v0.1.1/kubelogin-linux-amd64.zip unzip -ojd /usr/local/bin kubelogin-linux-amd64.zip bin/linux_amd64/kubelogin rm -f kubelogin-linux-amd64.zip kubelogin --version displayName: 'Install Kubelogin'
Thank you, this works great
Task name
KubeloginInstallerV0
Task version
0.226.0
Environment type (Please select at least one enviroment where you face this issue)
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
Relevant log output
Aditional info