aws / aws-toolkit-vscode

Amazon Q, CodeCatalyst, Local Lambda debug, SAM/CFN syntax, ECS Terminal, AWS resources
https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode
Apache License 2.0
1.41k stars 344 forks source link

[error] aws.toolkit.login: EntryIsADirectory (FileSystemError) #5070

Closed joannren closed 2 weeks ago

joannren commented 1 month ago

Problem

I have AWS profile created for our dev and prod environment for AWS toolkit. It works very well until recently, I can no longer login using these two profiles I created and no more new profiles can be created using AWS toolkit. During this time what may have affect this extension is

  1. upgrade VSCode to latest 1.89.1
  2. A few IT updates on my laptop (mandatory)
  3. Installed java extensions for debug java code

What I have tried to reproduce the issue

  1. Open VSCode ->uninstall AWS toolkit->close VSCode-> Reopen VSCode. telemetryCache Error and EntryIsADirectory error occurred.
  2. Open VSCode as admin->uninstall AWS toolkit->close VSCode-> Reopen VSCode as admin. Same telemetryCache Error and EntryIsADirectory error occurred.
  3. Manually add telemetryCache file from a coworker using a windows laptop. The error about telemetryCache disappeared but EntryIsADirectory error still persisted.
  4. Uninstall AWS toolkit, Amazon Q, java extensions, and reinstall AWS toolkit follow the steps in 1. EntryIsADirectory error still persisted.
  5. Tried to create new connections using workforce doesn't work as I have multiple account. this only directs to organization's Identity center.
  6. Tried to create IAM credentials. The connection cannot be established (VPN disabled for this)
  7. My coworker suggest me to try create a new user in IAM, but I am a power user and don't have right to create any users. This means I need to manually code and refresh my credentials likely everyday to be able to debug my code. My previous accounts set up was SSO login with two different profiles and config and batch files saved under .aws
  8. Compared my windows' environment with my coworkers environment. Her laptop is also windows 10, VSCode 1.89.1, AWS toolkit 3.7.0, but node version is 20, my node version is 18.18.2.
  9. Compared my laptop environment. I have two more computers on the network those profiles will sync thru one drive by IT default. My co-worker have one laptop and one profile only.

It looks like our app profiles have a copy on ADirectory. In my case, the default base path is the ADirectory but in my co-workers case there is no such issue. see the screenshots below about this copy on ADirectory.

This took me more than 2days and quite frustrating. Therefore create an issue to see if any experts here can look into it, provide suggestions or provide a fix would be really appreciated! Thank you!

2024-05-29 08:47:32.477 [info] Log level: info
2024-05-29 08:47:32.580 [info] endpoints: retrieving AWS endpoints data
2024-05-29 08:47:32.580 [info] Telemetry product: AWS Toolkit For VS Code
2024-05-29 08:47:32.587 [info] telemetry cache not found: 'c:\Users\joannr\AppData\Roaming\Code\User\globalStorage\amazonwebservices.aws-toolkit-vscode\telemetryCache'
2024-05-29 08:47:32.595 [info] OS: Windows_NT x64 10.0.19045
2024-05-29 08:47:32.595 [info] Visual Studio Code extension host:  1.89.1
2024-05-29 08:47:32.595 [info] AWS Toolkit:  3.7.0
2024-05-29 08:47:32.595 [info] node: 18.18.2
2024-05-29 08:47:32.603 [info] electron: 28.2.8
2024-05-29 08:47:32.614 [info] initialized 'submitFeedback' command with default feedback id: AWS Toolkit
2024-05-29 08:47:32.633 [error] Ec2MetadataClient failed to fetch token: Error: connect ENETUNREACH 169.254.169.254:80 [ENETUNREACH]
2024-05-29 08:47:32.666 [warning] auth (codecatalyst): failed to restore connection: EntryIsADirectory (FileSystemError): Error: EISDIR: illegal operation on a directory, read [FileIsADirectory]
2024-05-29 08:47:32.666 [warning] auth (codewhisperer): failed to restore connection: EntryIsADirectory (FileSystemError): Error: EISDIR: illegal operation on a directory, read [FileIsADirectory]
2024-05-29 08:47:32.713 [error] Error Activating AWS Toolkit: Error: EISDIR: illegal operation on a directory, read 
EntryIsADirectory (FileSystemError): Error: EISDIR: illegal operation on a directory, read
    at y.e (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:152:6266)
    at Object.readFile (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:152:4463)
    at async E.readFile (c:\Users\joannr\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.7.0\dist\src\extension.js:2117:2811)
    at async ye (c:\Users\joannr\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.7.0\dist\src\extension.js:1880:70206)
    at async Promise.all (index 1)
    at async Z (c:\Users\joannr\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.7.0\dist\src\extension.js:1880:69906)
    at async U (c:\Users\joannr\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.7.0\dist\src\extension.js:1880:68761)
    at async S.loadSharedCredentialsProviders (c:\Users\joannr\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.7.0\dist\src\extension.js:1880:104059)
    at async S.refresh (c:\Users\joannr\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.7.0\dist\src\extension.js:1880:103495)
    at async v.getAllCredentialsProviders (c:\Users\joannr\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.7.0\dist\src\extension.js:1880:89108)
    at async v.getCredentialProviderNames (c:\Users\joannr\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.7.0\dist\src\extension.js:1880:89401)
    at async I (c:\Users\joannr\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.7.0\dist\src\extension.js:1880:64168)
    at async Oe.listConnections (c:\Users\joannr\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.7.0\dist\src\extension.js:1880:48691)
    at async c:\Users\joannr\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.7.0\dist\src\extension.js:1969:6143
    at async mt (c:\Users\joannr\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.7.0\dist\src\extension.js:1969:5694)
    at async Be (c:\Users\joannr\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.7.0\dist\src\extension.js:1966:1213)
    at async N (c:\Users\joannr\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-3.7.0\dist\src\extension.js:2227:9940071)
    at async h.n (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:143:6281)
    at async h.m (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:143:6244)
    at async h.l (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:143:5701)

Same error produced when switch connection

image

Expected behavior

can display previous profiles saved in the config under .aws folder or create new profiles

System details (run AWS: About and/or Amazon Q: About)

image image

justinmk3 commented 3 weeks ago

Please check the files in the .aws directory in your home directory.

If any of these files are directories (wrong), that could trigger this issue:

.aws/credentials
.aws/config
any of the files in the .aws/sso/cache/ directory
joannren commented 2 weeks ago

Thank you SO much!!! I removed the folder .aws/credentials. My two previous profiles saved in config file under .aws are back!