aws-toolkit-vscode: "Deploy SAM Application": Cannot build layer dependencies: "[Errno 30] Read-only file system"

Describe the bug

When use VS Command Deploy SAM Application with dependencies layer, build status is failed.

However, deploy process was continuing and create insufficient layer object(only requirements.txt file)

execution log is in additional context.

failed reason is [Errno 30] Read-only file system: '.aws-sam'.

when run command without AWS-ToolKit as below, dependencies ware resolved and create layer.

mkdir -p /tmp/aws-toolkit-vscode/samDeploytpFy2M/build 
 /usr/local/bin/sam build --build-dir /tmp/aws-toolkit-vscode/samDeploytpFy2M/build --template /Users/<USERNAME>/git/sam_test/lambda-python3.9/template.yaml

template.yml

Resources:
  HelloWorldFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: hello_world/
      Handler: app.lambda_handler
      Runtime: python3.9
      Architectures:
        - x86_64
      Layers:
        - !Ref MyLayer
      Events:
        HelloWorld:
          Type: Api
          Properties:
            Path: /hello
            Method: get
  MyLayer:
    Type: AWS::Serverless::LayerVersion
    Properties:
      Description: Layer description
      ContentUri: my_layer/
      CompatibleRuntimes:
        - python3.9
    Metadata:
      BuildMethod: python3.9

my_layer/requirements.txt has only line: requests

To Reproduce

Steps to reproduce the behavior:

  1. create python SAM Application template with layer
  2. Add requirements.txt in layer directory
  3. run VS Command Deploy SAM Application

Expected behavior Build requirements.txt dependencies and create layer

Desktop (please complete the following information):

  • OS: Darwin x64 20.6.0
  • Visual Studio Code Extension Host Version: 1.63.2
  • AWS Toolkit Version: 1.34.

Additional context

sam_deploy.log

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 19 (8 by maintainers)

Commits related to this issue

Most upvoted comments

https://github.com/aws/aws-toolkit-vscode/pull/2755 is a potential solution though it would be very helpful if anyone experiencing this problem could try out the fix:

  1. Download and extract the following VSIX: aws-toolkit-vscode-1.46.0-3e2137d9f381.vsix.zip
  2. In VS Code, run the Extensions: Install from VSIX... command to install the VSIX.
    • The default shortcut for opening the command palette is ctrl-shift-p for Windows/Linux and cmd-shift-p for Mac
  3. Reload VS Code and verify that the Toolkit has the new version.

@JadenSimon

I too confirm that the above VSIX allows me to, once again, successfully use debugging with aws-sam-cli v1.53.0. Thanks!

I take it this AWS Toolkit preview will simply be overwritten once the official 1.46.0 version is released? Thanks!

AWS Toolkit 1.46 includes a fix for this.

I take it this AWS Toolkit preview will simply be overwritten once the official 1.46.0 version is released? Thanks!

Yeah it should, at least from my experience. If it doesn’t do it automatically then you can manually upgrade using the extensions tab.

@JadenSimon

For my issue (that I wrongly posted here) that’s somewhat related to this one, I just wanted to let you know that rolling back to aws-sam-cli 1.52.0 fixed the issue for me. Thanks!