sam init quickstart templates failing on windows
Description:
sam init {{ any flags }}
will fail with fresh installs on windows. I can replicate with defaults or a smattering of various options. (For reference, I'm trying to create a node16.x project Hello World project).
I have SAM and AWS CLI installed on a fresh windows 11 machine. I can replicate the issue with identical output with a fresh install of both CLIs on a windows 10 machine. The CLI will make it through all interactive prompts or flags properly, but throw an error when actually creating the project locally. I can repro the problem in command prompt or Powershell (PSCore 7.x) .The non-verbose error is
Error: Unstable state when updating repo. Check that you have permissions to create/delete files in C:\Users\taran\AppData\Roaming\AWS SAM directory or file an issue at https://github.com/aws/aws-sam-cli/issues
Steps to reproduce:
- Start with clean (No AWS products installed) install of Windows 11 (the issue seems to effect windows 10 too so dealers choice).
- Ensure python and git are installed
- Install latest AWS CLI and SAM CLI from their respective MSIs, pulled from the getting started docs.
- Create a fresh AWS account, create a user with the generic Admin role. Create CLI credentials for this user. (not sure much of this matters but this is what I did) (Enable MFA on the root user, do more best practices etc etc etc).
- Run aws configure using the aforementioned access keys
- create a blank directory and cd into it
- run sam init -> quickstart templates -> option 10 for node 16 -> option 1 for zip -> option 1 for not typescript. -> No to Xray -> default app name (Not sure if it makes a difference but I did have docker desktop installed and running, I tried this with image deployments too. Same results)
Observed result:
PS C:\Users\taran\SAM> sam init --debug
2022-07-02 16:50:13,858 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2022-07-02 16:50:13,858 | Using config file: samconfig.toml, config environment: default
2022-07-02 16:50:13,858 | Expand command line arguments to:
2022-07-02 16:50:13,858 | --package_type=Zip --output_dir=.
You can preselect a particular runtime or package type when using the `sam init` experience.
Call `sam init --help` to learn more.
Which template source would you like to use?
1 - AWS Quick Start Templates
2 - Custom Template Location
Choice: 1
Choose an AWS Quick Start application template
1 - Hello World Example
2 - Multi-step workflow
3 - Serverless API
4 - Scheduled task
5 - Standalone function
6 - Data processing
7 - Infrastructure event management
8 - Machine Learning
Template: 1
Use the most popular runtime and package type? (Python and zip) [y/N]: N
Which runtime would you like to use?
1 - dotnet6
2 - dotnet5.0
3 - dotnetcore3.1
4 - go1.x
5 - graalvm.java11 (provided.al2)
6 - graalvm.java17 (provided.al2)
7 - java11
8 - java8.al2
9 - java8
10 - nodejs16.x
11 - nodejs14.x
12 - nodejs12.x
13 - python3.9
14 - python3.8
15 - python3.7
16 - python3.6
17 - ruby2.7
18 - rust (provided.al2)
Runtime: 10
What package type would you like to use?
1 - Zip
2 - Image
Package type: 1
Based on your selections, the only dependency manager available is npm.
We will proceed copying the template using npm.
Select your starter template
1 - Hello World Example
2 - Hello World Example TypeScript
Template: 1
Would you like to enable X-Ray tracing on the function(s) in your application? [y/N]: N
Project name [sam-app]:
2022-07-02 16:50:32,915 |
Cloning from https://github.com/aws/aws-sam-cli-app-templates (process may take a moment)
2022-07-02 16:50:32,916 | Configure core.longpaths=true in git clone. You might also need to enable long paths in Windows registry.
2022-07-02 16:50:44,289 | Removing old repo at C:\Users\taran\AppData\Roaming\AWS SAM\aws-sam-cli-app-templates
2022-07-02 16:50:45,685 | Copying from C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates to C:\Users\taran\AppData\Roaming\AWS SAM\aws-sam-cli-app-templates
2022-07-02 16:50:52,140 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-core, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219940>)
2022-07-02 16:50:52,140 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-core, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219940>)
2022-07-02 16:50:52,140 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-events, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219940>)
2022-07-02 16:50:52,141 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-events, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219940>)
2022-07-02 16:50:52,141 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-runtime-interface-client, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219940>)
2022-07-02 16:50:52,141 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-runtime-interface-client, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219940>)
2022-07-02 16:50:52,142 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-serialization, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219940>)
2022-07-02 16:50:52,142 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-serialization, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219940>)
2022-07-02 16:50:52,143 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219940>)
2022-07-02 16:50:52,144 | rmtree failed in <built-in function unlink> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\helloworld\native-image.properties, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219900>)
2022-07-02 16:50:52,146 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\helloworld, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219900>)
2022-07-02 16:50:52,147 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A2198C0>)
2022-07-02 16:50:52,148 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,149 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A2197C0>)
2022-07-02 16:50:52,150 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219780>)
2022-07-02 16:50:52,152 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219600>)
2022-07-02 16:50:52,153 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A2195C0>)
2022-07-02 16:50:52,156 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219500>)
2022-07-02 16:50:52,157 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-gradle, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A2192C0>)
2022-07-02 16:50:52,164 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-core, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,166 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-core, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,166 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-events, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,166 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-events, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,167 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-runtime-interface-client, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,167 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-runtime-interface-client, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,167 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-serialization, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,167 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-serialization, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,168 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,170 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219740>)
2022-07-02 16:50:52,171 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A2196C0>)
2022-07-02 16:50:52,172 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219780>)
2022-07-02 16:50:52,173 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219640>)
2022-07-02 16:50:52,177 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A2194C0>)
2022-07-02 16:50:52,179 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219480>)
2022-07-02 16:50:52,182 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219380>)
2022-07-02 16:50:52,183 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11\cookiecutter-aws-sam-graalvm-maven, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219300>)
2022-07-02 16:50:52,185 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java11, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A005EC0>)
2022-07-02 16:50:52,194 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-core, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219980>)
2022-07-02 16:50:52,195 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-core, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219980>)
2022-07-02 16:50:52,195 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-events, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219980>)
2022-07-02 16:50:52,196 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-events, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219980>)
2022-07-02 16:50:52,196 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-runtime-interface-client, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219980>)
2022-07-02 16:50:52,196 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-runtime-interface-client, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219980>)
2022-07-02 16:50:52,196 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-serialization, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219980>)
2022-07-02 16:50:52,197 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-serialization, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219980>)
2022-07-02 16:50:52,198 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219980>)
2022-07-02 16:50:52,198 | rmtree failed in <built-in function unlink> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\helloworld\native-image.properties, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219840>)
2022-07-02 16:50:52,200 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\helloworld, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219840>)
2022-07-02 16:50:52,201 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219900>)
2022-07-02 16:50:52,202 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,202 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219700>)
2022-07-02 16:50:52,203 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src\main, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219740>)
2022-07-02 16:50:52,206 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction\src, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219780>)
2022-07-02 16:50:52,207 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}\HelloWorldFunction, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219640>)
2022-07-02 16:50:52,209 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle\{{cookiecutter.project_name}}, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219440>)
2022-07-02 16:50:52,210 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-gradle, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219200>)
2022-07-02 16:50:52,218 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-core, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,219 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-core, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,220 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-events, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,220 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-events, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,220 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-runtime-interface-client, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,221 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-runtime-interface-client, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,221 | rmtree failed in <built-in function scandir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-serialization, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,221 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws\aws-lambda-java-serialization, details: (<class 'FileNotFoundError'>, FileNotFoundError(2, 'The system cannot find the path specified'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,222 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image\com.amazonaws, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219880>)
2022-07-02 16:50:52,224 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF\native-image, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A2196C0>)
2022-07-02 16:50:52,225 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources\META-INF, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219680>)
2022-07-02 16:50:52,226 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main\resources, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219740>)
2022-07-02 16:50:52,227 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src\main, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219540>)
2022-07-02 16:50:52,230 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction\src, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A2194C0>)
2022-07-02 16:50:52,231 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}\HelloWorldFunction, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219400>)
2022-07-02 16:50:52,233 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven\{{cookiecutter.project_name}}, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A219380>)
2022-07-02 16:50:52,234 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17\cookiecutter-aws-sam-graalvm-maven, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A2191C0>)
2022-07-02 16:50:52,236 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm\java17, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A005EC0>)
2022-07-02 16:50:52,237 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2\graalvm, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A005F00>)
2022-07-02 16:50:52,241 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates\provided.al2, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A005F40>)
2022-07-02 16:50:52,563 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls\aws-sam-cli-app-templates, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E6A005E00>)
2022-07-02 16:50:52,564 | rmtree failed in <built-in function rmdir> for C:\Users\taran\AppData\Local\Temp\tmpkn0ngyls, details: (<class 'OSError'>, OSError(41, 'The directory is not empty'), <traceback object at 0x0000021E69FE8100>)
2022-07-02 16:50:52,565 | Template is not provided in context, skip adding project type metric
2022-07-02 16:50:52,566 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '4051ee11-2e95-423d-ab51-2d657db33725', 'installationId': 'eda45204-2efc-44cd-b956-ac7563effaad', 'sessionId': '5840cdc0-ce22-4ebb-a35a-18419c48e119', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.8.8', 'samcliVersion': '1.53.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam init', 'duration': 38708, 'exitReason': 'AppTemplateUpdateException', 'exitCode': 1}}]}
2022-07-02 16:50:53,150 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: Unstable state when updating repo. Check that you have permissions to create/delete files in C:\Users\taran\AppData\Roaming\AWS SAM directory or file an issue at https://github.com/aws/aws-sam-cli/issues
PS C:\Users\taran\SAM>
Expected result:
No errors, fresh SAM template fun
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: WIndows 11 OS Build 22000.739
sam --version: 1.53.0- AWS region: us-east-1
AWS CLI version: 2.7.12 git for windows 2.37.0
facing the same issue
Hi @RickardTaran @Rishiv15 can you please follow here to opt in to remove the MAX_PATH limitation? That should remove the errors.
All... I don't think MAX PATH will solve this. The path written to /Users/[username]/AppPath when the SAM CLI is installed need to follow a common naming convention for each segment. In all other segments you use dashes (e.g. cookiecutter-aws-sam-hello-python) such that the segment has no spaces. That is not the case with the "AWS SAM" segment which follows "Roaming". If the installer code is changed to write that segment as "aws-sam" in keeping with the rest of the path, that should solve the problem. That is indicated by the fact that putting the path in double quotes along with --location works fine,,, meaning it is not a MAX PATH issue.
I tried disabling MAX_PATH and managed to get the exact same error as the one of this issue. When I enabled MAX_PATH again, there is no error at all when running sam init.
I noticed the space in "AWS SAM" in the path, but that doesn't seem to cause any issue in my investigation. The error originated from https://github.com/aws/aws-sam-cli/blob/33f4b97142d6f07f8ed3009b2547bdb51e2b5139/samcli/lib/utils/git_repo.py#L164, where it tries to remove the existing directory before persisting the new one after git clone. If the --location is supplied with a Giturl (e.g. sam init --location git+ssh://[email protected]/aws-samples/cookiecutter-aws-sam-python.git, this code path will be triggered. But if --location is supplied with a local path ( e.g. sam init --location "C:\Users[your_user_name]\AppData\Roaming\AWS SAM\aws-sam-cli-app-templates\python3.9\cookiecutter-aws-sam-hello-python"), this code path won't be activated. That might be why there's no error at all.
@john-zenden Can you confirm if you provided --location with a Git URL or a local path? Also, can you try if enabling MAX_PATH works for you? Thanks!
I have the same issue
This is work for me Open the Powershell as administrator then type:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
Hey @hawflau, the change you recommended (also documented by @HusseinMoHu above) did work. But I still think this is worth leaving open, maybe as a feature request since having to do this is not a documented step. It would be nice to see one of the following done:
- refactor the app so this registry key is not needed
- add this change into the MSI if possible
- add this change to the installation steps in the Getting Started guide.
The problem for me was the MAX LENGTH path on windows 10. Thanks
@hawflau I used the local path, not a git URI. my case was:
sam init --locaiton "C:\Users[your_user_name]\AppData\Roaming\AWS SAM\aws-sam-cli-app-templates\python3.9\cookiecutter-aws-sam-hello-python"
I will try the MAX_PATH fix going against the local path and see what happens.
All... OK, after setting MAX_PATH via PowerShell I uninstalled and reinstalled the client. sam init worked fine. I have not tried adding a file path with --location.
Would love to learn more about how the MSI is created. I have done a little of that in other languages, and I think a nice fix would be to have a registry check in the MSI process and if the long file name key is not set to 1, offer the ability to set it as part of the MSI install process.
@RickardTaran @john-zenden thanks for suggestions. We will look into if we can do something with the registry through MSI.
The documentation update should be something that we can do relatively sooner.
The Powershell command run against the Windows registry worked for me. My AWS DevOps training is back on track as a result.
A thousand thanks!
-->Symon
This is happening to me in IIntellij IDEA 2022.1.3 Build #IU-221.5921.22, built on June 21, 2022. I have the AWS CLI and the AWS SAM CLI installed on a Windows 10 machine. When using the AWS Serverless Application wizard to create a new AWS SAM project it would throw this exception:
java.lang.RuntimeException: Could not execute sam init!: [Cloning from https://github.com/aws/aws-sam-cli-app-templates (process may take a moment), Error: Unstable state when updating repo. Check that you have permissions to create/delete files in C:\Users\xxxxxx\AppData\Roaming\AWS SAM directory or file an issue at https://github.com/aws/aws-sam-cli/issues]
at software.aws.toolkits.jetbrains.services.lambda.wizard.SamInitRunner.execute$lambda-1(SamInitRunner.kt:55)
at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:680)
at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:658)
at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2094)
at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:143)
at software.aws.toolkits.jetbrains.services.lambda.wizard.SamInitRunner.execute(SamInitRunner.kt:33)
at software.aws.toolkits.jetbrains.services.lambda.wizard.SamProjectBuilder.runSamInit(SamProjectGeneratorIntelliJShims.kt:94)
at software.aws.toolkits.jetbrains.services.lambda.wizard.SamProjectBuilder$setupRootModel$1.run$lambda-0(SamProjectGeneratorIntelliJShims.kt:76)
at com.intellij.openapi.roots.ModuleRootModificationUtil.lambda$updateModel$9(ModuleRootModificationUtil.java:147)
at com.intellij.openapi.roots.ModuleRootModificationUtil.modifyModel(ModuleRootModificationUtil.java:155)
at com.intellij.openapi.roots.ModuleRootModificationUtil.updateModel(ModuleRootModificationUtil.java:146)
at software.aws.toolkits.jetbrains.services.lambda.wizard.SamProjectBuilder$setupRootModel$1.run(SamProjectGeneratorIntelliJShims.kt:75)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:493)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:244)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:244)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
@gmarshall56 Look through this thread... You need to run this in Powershell:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" ` -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
@john-zenden Yeah, I saw that earlier before I created my lengthy post however I was not convinced that that was in fact the agreed upon solution to the issue.
Yes, I ran that command in Powershell and now the AWS Toolkit in Intellij is creating a complete project. Thank you.
Hope this gets fixed soon so others don't spend 2 hours trouble shooting this like I did
@gmarshall56 I'd like to see them change the "AWS SAM" segment to "aws-sam" to remove the space. I believe that is really where the root of the problem lies, because if you run sam init --location "..." and you put your AppData path in quotes it works as well.
Closing this as from the discussion above it relates to SAM CLI needing Windows long path enabled. We shorten our paths in our starting templates and added better logging to help customers with this problem (https://github.com/aws/aws-sam-cli/pull/4328).
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.