aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Bug: SAM Installer Configures Path with Space

Open john-zenden opened this issue 4 years ago • 3 comments

This is related to/exposed in #1891

Description:

I commented in 1891 that I overcame the error by explicitly setting the --location argument with the full path in double quotes, like this:

sam init --location "C:\Users[my username]\AppData\Roaming\AWS SAM\aws-sam-cli-app-templates\python3.9\cookiecutter-aws-sam-hello-python"

This appears to be happening because the "AWS SAM" folder in the path has a space. Recommend changing to "AWS-SAM" following the rest of the path naming conventions you seem to be following...

Steps to reproduce:

Try sam init without args after installing on windows with current MSI.

Observed result:

You should get:

Error: Unstable state when updating repo. Check that you have permissions to create/delete files in C:\Users[username]\AppData\Roaming\AWS SAM directory or file an issue at https://github.com/aws/aws-sam-cli/issues

Expected result:

Prompting for various arguments.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Windows 11
  2. sam --version: SAM CLI, version 1.53.0
  3. AWS region: us-east-1

john-zenden avatar Jul 02 '22 02:07 john-zenden

Can confirm, I'm getting the same error when using sam init.

Ol1BoT avatar Jul 02 '22 07:07 Ol1BoT

It is required to opt in to remove the MAX_PATH limitation. Please follow here for the instructions.

Closing as duplicate of #4031

hawflau avatar Jul 03 '22 18:07 hawflau

same issue here: my return message:

PS C:\Windows\system32> New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
>> -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force


LongPathsEnabled : 1
PSPath           : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
PSParentPath     : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
PSChildName      : FileSystem
PSDrive          : HKLM
PSProvider       : Microsoft.PowerShell.Core\Registry

thedarkknight197 avatar Feb 28 '24 17:02 thedarkknight197