aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 819 forks source link

Couldn't deploy custom Lambda Layer from yumda #4825

Closed ErickWendel closed 3 years ago

ErickWendel commented 4 years ago

Note: If your issue/bug is regarding the AWS Amplify Console service, please log it in the Amplify Console GitHub Issue Tracker

Amplify CLI Version 4.24.0

Describe the bug I'm trying to install custom layers using yumda. So I've installed the GraphicsMagick on /amplify/backend/function/gm/opt. When I deploy I see the "An error occurred hashing directory" error.

To Reproduce Steps to reproduce the behavior:

  1. Install the GraphicsMagick package on /opt layer
docker run --rm \
    -v "$PWD"/amplify/backend/function/gm/opt:/lambda/opt \
    lambci/yumda:2 yum install -y GraphicsMagick
  1. Runamplify push
  2. See error:
An error occurred hashing directory /Users/erickwendel/Documents/pocs/amplify/meme-maker/app/amplify/backend/function/gm/opt
An error occurred during the push operation: An error occurred hashing directory /Users/erickwendel/Documents/pocs/amplify/meme-maker/app/amplify/backend/function/gm/opt

Expected behavior Upload the custom package and inject on the runtime

What is Configured?

Environment ``` System: OS: macOS 10.15.3 CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz Memory: 116.02 MB / 8.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 14.0.0 - /usr/local/bin/node npm: 6.14.6 - /usr/local/bin/npm Browsers: Brave Browser: 81.1.9.76 Chrome: 83.0.4103.116 Safari: 13.0.5 npmGlobalPackages: @aws-amplify/cli: 4.24.0 autocannon: 4.6.0 create-react-app: 3.4.1 fkill-cli: 6.0.1 npm: 6.14.6 ntl: 5.0.0 serverless: 1.67.0 sloc: 0.2.1 ```
jhockett commented 4 years ago

Hi @ErickWendel, is there a reason your /opt folder has a : at the end of it? The CLI seems to failing to find the /opt folder.

ErickWendel commented 4 years ago

Hi @ErickWendel, is there a reason your /opt folder has a : at the end of it? The CLI seems to failing to find the /opt folder.

Hey @jhockett thanks for the response! Actually, using : is just a separator on Docker. The Docker volume is mapping from my local machine "$PWD"/amplify/backend/function/gm/opt to the container /opt. So the :

attilah commented 3 years ago

Closing in favor of #6144

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.