aks-set-context icon indicating copy to clipboard operation
aks-set-context copied to clipboard

Bug: ERROR: AADSTS700024: Client assertion is not within its valid time range.

Open jbelien opened this issue 1 year ago • 4 comments

What happened?

Sometimes, I get the following error message:

ERROR: AADSTS700024: Client assertion is not within its valid time range

It doesn't happen all the time, in my case it only happens on 1 of the 4 environments. Re-running the GitHub Actions workflow doesn't fix it. I run a similar GitHub Actions workflow on 15 repositories and 4 environments and the same error happens on 3 repositories and 1 single environment (always the same).

Version

  • [X] I am using the latest version

Runner

self-hosted

Relevant log output

##[debug]Evaluating condition for step: 'Get K8s context'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Get K8s context
##[debug]Loading inputs
##[debug]Evaluating: vars.AZURE_RESOURCE_GROUP
##[debug]Evaluating Index:
##[debug]..Evaluating vars:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'AZURE_RESOURCE_GROUP'
##[debug]=> 'rg-***'
##[debug]Result: 'rg-***'
##[debug]Evaluating: vars.AKS_CLUSTER_NAME
##[debug]Evaluating Index:
##[debug]..Evaluating vars:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'AKS_CLUSTER_NAME'
##[debug]=> 'aks-***'
##[debug]Result: 'aks-***'
##[debug]Loading env
Run azure/aks-set-context@v3
  with:
    resource-group: rg-***
    cluster-name: aks-***
    admin: false
    use-kubelogin: true
  env:
    CONTAINER_NAME: ***
    AZURE_HTTP_USER_AGENT: 
    AZUREPS_HOST_ENVIRONMENT: 
##[debug]Writing kubeconfig to /home/runner-admin/actions-runner/_work/_temp/kubeconfig_1691671866005
/usr/bin/az aks get-credentials --resource-group rg-*** --name aks-*** -f /home/runner-admin/actions-runner/_work/_temp/kubeconfig_1691671866005
ERROR: AADSTS700024: Client assertion is not within its valid time range. Current time: 2023-08-10T12:51:06.6841503Z, assertion valid from 2023-08-09T15:06:56.0000000Z, expiry time of assertion 2023-08-09T15:11:56.0000000Z. Review the documentation at https://docs.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials .
Trace ID: 070e96fc-76e1-46a8-88f7-055a0d489900
Correlation ID: 2ce46b3e-5dcf-42ed-a497-33231a9dc308
Timestamp: 2023-08-10 12:51:06Z
Interactive authentication is needed. Please run:
az login
Error: Error: The process '/usr/bin/az' failed with exit code 1
##[debug]Node Action run completed with exit code 1
##[debug]AZURE_HTTP_USER_AGENT='GitHubActions/azure/aks-set-context(6ff0b0b4611939515451a12aa8fec15e3dd86d30d7e8c0569dd2ded2113f8931; 5809746149)'
##[debug]AZUREPS_HOST_ENVIRONMENT='GitHubActions/azure/aks-set-context(6ff0b0b4611939515451a12aa8fec15e3dd86d30d7e8c0569dd2ded2113f8931; 5809746149)'
##[debug]AZURE_HTTP_USER_AGENT=''
##[debug]AZUREPS_HOST_ENVIRONMENT=''
##[debug]Finishing: Get K8s context

jbelien avatar Aug 10 '23 12:08 jbelien

This issue is idle because it has been open for 14 days with no activity.

github-actions[bot] avatar Aug 24 '23 15:08 github-actions[bot]

I have the issue again today ... Any idea why this keeps happening and what I could do to solve it ? Thanks!

jbelien avatar Nov 14 '23 12:11 jbelien

I could make it work by removing user of azure/use-kubelogin and switching use-kubelogin to false (following https://learn.microsoft.com/en-us/azure/aks/kubernetes-action).

jbelien avatar Nov 16 '23 10:11 jbelien

This issue is idle because it has been open for 14 days with no activity.

github-actions[bot] avatar Nov 30 '23 12:11 github-actions[bot]