aws / aws/aws-sam-cli

sam build error: The process cannot access the file because it is being used by another process

Open
#4,595 9 comments 0 reactions 0 assignees View on GitHub
area/build platform/windows
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

**Describe the bug**

```
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process:
'C:\\Users\\betim\\AppData\\Local\\Temp\\tmpr4kzrh76'
```

**To reproduce**

1. sam init
2. just choose hello world (type script)
3. rename the folder name (also update the path in template.yaml
4. sam build

**Expected behavior**
Success without any error (I have also tried to manually remove the temp file, but it turns out the error is consistent with each time it also generate again, so the root cause will be from `sam build` itself, and it generate the temp file

**Screenshots**
![image](https://user-images.githubusercontent.com/8111748/213605734-7e4c8901-3e11-4ec4-aadf-1828cdfbc75e.png)
**Your Environment**

- OS: Windwos 11 64bit

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.