Purge task fails with 401 after 3 hours on ABAC-enabled registries
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- azure, go
- Domain
- authentication, cli, cloud
Research direction
Start at the acr purge entry point and trace refreshAcrCLIClientToken() through GetAcrAccessToken, focusing on the 3-hour refresh-token expiry and the 401 path. Verify the long-running ABAC-enabled ACR Task case; the work is done when purge completes beyond three hours without regressing non-ABAC registries.
Written by the indexing model from the issue text.
Description
Describe the bug
When running acr purge as an ACR Task on an ABAC-enabled registry, the operation fails with HTTP 401 after approximately 3 hours. The ACR refresh token has a 3-hour TTL. The acr-cli's refreshAcrCLIClientToken() only refreshes the short-lived access token using the stored ACR refresh token, when the refresh token itself expires, GetAcrAccessToken returns 401 and there is no recovery path.
Non-ABAC registries are unaffected because they receive a longer self-issued token from the Tasks scheduler.
To Reproduce
Steps to reproduce the behavior:
- Create an ACR Task with a purge step targeting an ABAC-enabled registry with a large number of images (requiring >3 hours to complete)
- Run the task
- After ~3 hours, the task fails with:
acr.BaseClient#GetAcrAccessToken: Failure responding to request: StatusCode=401
Expected behavior
The purge operation should complete successfully regardless of duration by renewing the refresh token when it expires.
Any relevant environment information
- acr-cli version: v0.19 (also affects v0.18 and all prior versions)
- Registry: ABAC-enabled
- Task trigger: Timer-triggered scheduled task
Additional context
- Workaround: Split purge into multiple tasks with --filter patterns (each <3hrs), increase --concurrency, or run more frequently to prevent backlog.
- Dominant language
- Go
- Stars
- 70
- Forks
- 52
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/acr-cli
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 38/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·