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.

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

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

6reactions
JadenSimoncommented, Jul 11, 2022

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.
2reactions
ryancabanascommented, Jul 11, 2022

@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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS LAMBDA "errorMessage": "[Errno 30] Read-only file system
Apparently you're trying to write a file where is not permitted. Lambda currently only supports writing files to the /tmp directory.
Read more >
sam build - AWS Serverless Application Model
The sam build command processes your AWS SAM template file, application code, and any applicable language-specific files and dependencies.
Read more >
Deploy a Lambda Layer and Function Together via SAM
In this post, I'll be sharing how we can instead package those dependencies into a Lambda Layer, and deploy that alongside a SAM...
Read more >
Creating an AWS SAM CLI project with Typescript and Both ...
Recently I was introduced to using the SAM CLI to create AWS Lambda deployments. As always, I love experimenting with new tools, ...
Read more >
DEEP DIVE INTO AWS SAM BUILDING AND PACKAGING ...
In this episode I talk to Eric Johnson, Developer Advocate for Serverless at AWS and we go into de depths of AWS SAM...
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