-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access to .aws-sam directory denied #1763
Comments
Can you access it if you close the IDE? |
No, still getting 'Access Denied' for |
Which runtime are you using so I can track down the correct code path? |
python3.8, if you mean Lambda runtime |
I did, thank you |
I have also this problem with JAVA8 for runtime. |
I have the exact same problem with Java 11 and Maven. If I run the "chkdsk" [1] command in the .aws-sam folder in Administrator: Windows Powershell between the builds I am able re re-run it without the same error. Hope this works as a temporary solution for you as well. [1] https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/chkdsk |
I am trying to come up with a way to replicate this. All the active devs on the toolkit run OSX and given the current situation in the world I can't walk down to IT and grab a Windows laptop. |
I was not able to reproduce this using Java 8+Maven+Build In Container nor Py3.8+Build In Container. Can anyone try following this so we can see what has the lock? https://superuser.com/questions/117902/find-out-which-process-is-locking-a-file-or-folder-in-windows/399660#399660 |
The locking process is The
( The path up to
I'm using:
|
Is your docker desktop up to date. I'm curious if it's this: Fixed a file sharing issue that caused Docker Desktop to lock random files. Fixes docker/for-win#5624 and docker/for-win#5575. I was running on a brand new windows machine with latest docker desktop for Windows and could not reproduce |
For me, it works if I remove the lambda docker container, i.e.
After that, I can run |
I am running into the same issue. I also noticed that restarting docker fixes the issue on the next run. If I try to delete the .aws-sam/build directory manually in windows explorer I get a message stating that "You'll need to provide administrator permission to delete this folder." When I restart Docker, suddenly I am able to delete the directory.
|
I have the same issue on Windows 10. Restarting Docker fixes it. Is this a docker issue? |
I am also seeing this behavior. After the first sam build, subsequent attempts to run sam build fail to delete the existing build directory with the following error:
Attempts to manually delete the build directory also fail. The problem sometimes resolves by itself after several minutes. Restarting docker resolves the problem. |
Getting the same error on my machine as well. Even trying to run a simple hello world built in AWS lambda function on intellij with no code changes will result in a successful run on the first go, but the same "PermissionError" or "OSError" on subsequent runs. Any assistance on this would be greatly appreciated. |
I have noticed that running |
I am running into the same issue. trackback:
|
I am facing the same exact issue, and am forced to restart docker each time I want to locally run my AWS function again. Has anyone gotten in touch with AWS support in regards to this issue? |
I have this same issue with latest docker build and pycharm |
I'm having the same issue. Restarting docker each time I run is the only way to fix the issue.
|
Docker issue: docker/for-win#6938 |
The same problem on Windows with Dotnet lambda via AWS Toolkit in Ridler (as I suppose is Docker problem). |
I and others I know have this same issue regularly. We use pycharm and python. Restarting docker is now part of the development process lol |
Just encountered the same issue here. Error log is more or less the same as the above:
Deleting the build directory has led to this issue: aws/aws-sam-cli#1840 Redeploying with
Restarting docker and restarting PC does not fix the issue. |
Using SAM on Windows was close to unusable due to this issue. However, using docker in WSL2 mode, I can confirm that the issue has been resolved. With the new windows update, even Windows Home users can run docker using WSL2. The files you're working on must be kept within the Linux subsystem directory for usable speeds. Except for that, this has been a game-changer for me. |
Describe the bug
Sometimes when attempting to re-run/debug a lambda on Windows the build fails with stacktrace:
Subsequent attempts to Run/Debug result in different stacktrace:
To reproduce
Expected behavior
A Lambda is built and executed
Screenshots


First-time error:
Subsequent errors:
Your Environment
Additional context

Inaccessible directory as seen from Explorer even though I'm admin:
Directory can be deleted after PC restart.
Reinstalling SAM CLI didn't help.
Also didn't observe such behavior when using SAM CLI.
The text was updated successfully, but these errors were encountered: