Azure / Azure/azure-cli

Corruption of `~/.azure` files

Open
#9,427 21 comments 10 reactions 1 assignee Claimed by @jiasli View on GitHub
Account act-identity-squad act-platform-engineering-squad common issue Concurrency Core Feature Candidate feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Describe the bug**
The files inside the .azure folder gets corrupted

**To Reproduce**
IT's a race condition, so it's really diffictult to reproduce. I was using terraform, that uses the azure go sdk. at the same time I was running `az aks list` to see when the resource would come online. az cli failed with the following message.

```
az aks list
Failed to load token files. If you have a repro, please log an issue at https://github.com/Azure/azure-cli/issues. At the same time, you can clean up by running 'az account clear' and then 'az login'. (Inner Error: Failed to parse /Users/jopedros/.azure/accessTokens.json with exception:
Extra data: line 1 column 16946 (char 16945))
```
Opening the file manually, I could see in the token array, there was an extra set of braces
```
}]
```
Manually correcting the file solved the issue.

**Environment summary**
az --version
azure-cli 2.0.63 *

osX, bash.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.