question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unstable state when updating repo. Check that you have permissions to create/delete files

See original GitHub issue

Hi, When I am trying to create a project in IntelliJ , getting below error. 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\aravi\AppData\Roaming\AWS SAM directory or file an issue at https://github.com/aws/aws-sam-cli/issues]

SAM CLI, version 1.53.0

Thanks, Aravind

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

21reactions
AJESH-CRcommented, Aug 8, 2022
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

Try running following command administrator in PowerShell, it’s worked for me. https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell#enable-long-paths-in-windows-10-version-1607-and-later

This is the actual cause playing behind all the troubles.

fatal: cannot create directory at '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':
 Filename too long
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
7reactions
jfusscommented, Aug 1, 2022

You are also on Windows and I know the file path length can be an issue. You can try doing https://github.com/aws/aws-sam-cli/issues/4031#issuecomment-1183633630

This is also a duplicate of #4031. Not sure if you did look at open issues but if you didn’t please do that before creating. Makes it much easier to follow and track on our end and already has a workaround (which I think is just the solution to this at this point).

Closing

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS Serverless Application Model init error on Pycharm
Open PowerShell in admin mode and type this and execute. New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" ` -Name ...
Read more >
(windows11)AWS sam init 에러: sam unstable state ... - 티스토리
(windows11)AWS sam init 에러: sam unstable state when updating repo. check that you have permissions to create/delete files.
Read more >
Fathur Rohman - Medium
... Error: Unstable state when updating repo. Check that you have permissions to create/delete files in C:\Users\aravi\AppData\Roaming\AWS SAM directory or ...
Read more >
AWS SAM policy templates - AWS Serverless Application Model
CodeCommitCrudPolicy, Gives permissions to create/read/update/delete objects ... Gives access to get detected and analyzed documents from Amazon Textract.
Read more >
Windows で SAM CLI の sam init コマンドを実行するとエラー ...
Check that you have permissions to create/delete files in ... てから sam init を対話的に実行すると Error: Unstable state when updating repo.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found