"Deploy SAM Application": Cannot build layer dependencies: "[Errno 30] Read-only file system"
See original GitHub issueDescribe 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:
- create python SAM Application template with layer
- Add
requirements.txtin layer directory - 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
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:19 (8 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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:
Extensions: Install from VSIX...command to install the VSIX.@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.0version is released? Thanks!