Failed to access settings ("... because the content of the file is newer")
Problem
Whenever I start VS Code I get "Failed to access settings. Check settings.json for syntax errors."
I have multiple windows open, and many of them will have an unsaved settings.json open. If I undo in that editor, "aws.samcli.lambdaTimeout": 91234 pops up at the end, so maybe this is what the extension is trying to write (or delete)?
The logs show this:
2024-02-20 11:19:40.410 [info] log level: info
2024-02-20 11:19:41.127 [info] endpoints: retrieving AWS endpoints data
2024-02-20 11:19:44.644 [info] telemetry cache not found: '/Users/emil/Library/Application Support/Code/User/globalStorage/amazonwebservices.aws-toolkit-vscode/telemetryCache'
2024-02-20 11:19:48.491 [info] OS: Darwin arm64 23.3.0
2024-02-20 11:19:48.495 [info] Visual Studio Code extension host: 1.86.2
2024-02-20 11:19:48.495 [info] AWS Toolkit: 2.10.0
2024-02-20 11:19:48.495 [info] node: 18.17.1
2024-02-20 11:19:48.495 [info] electron: 27.2.3
2024-02-20 11:20:05.013 [error] Ec2MetadataClient failed to fetch token: Error: connect EHOSTDOWN 169.254.169.254:80 - Local (192.168.2.11:51653) [EHOSTDOWN]
2024-02-20 11:20:14.282 [info] using codewhispererService service configuration: default
2024-02-20 11:20:25.581 [error] settings: invalid settings.json: Unable to write into user settings because the content of the file is newer.
2024-02-20 11:24:45.257 [info] telemetry: sent batch (size=6)
Steps to reproduce the issue
Shut down and restart VS Code with multiple windows opened.
Expected behavior
No error popups and no unsaved settings.json editor windows.
System details (run the AWS: About Toolkit command)
OS: Darwin arm64 23.3.0 Visual Studio Code extension host: 1.86.2 AWS Toolkit: 2.10.0 node: 18.17.1 electron: 27.2.3
Unable to write into user settings because the content of the file is newer.
Hmm, this is a case we should catch. Thanks for reporting this.
I have been facing the same problem.
As an additional information, I have Settings Sync set to On. However, I am not sure if this setting is related to this issue.
It appears that the extension is performing an automatic update of settings.json when VSCode starts. Can this automatic update be turned off in the settings?
Working on a fix, which will be in next week's release.
Fixed in AWS Toolkit 2.13.0