My app is a slackbot running on a aws provider using a nodejs runtime. It uses ffmpeg which I have installed as a layer following “publish-aws-lambda-layers-serverless-framework”. My app successfully deploys but fails at runtime because it cannot find the ffmpeg library.
2021-04-05T05:46:21.228Z 5e009ce7-d39c-4597-947f-4f50c711837a ERROR Could not find ffmpeg executable, tried "/var/task/node_modules/@ffmpeg-installer/linux-x64/ffmpeg", "/var/task/node_modules/@ffmpeg-installer/ffmpeg/node_modules/@ffmpeg-installer/linux-x64/ffmpeg" and "/var/task/node_modules/@ffmpeg-installer/linux-x64/ffmpeg"
I have the feeling the path I am using to find the binary is incorrect. Where would a binary be loaded in this scenario? Is there a way to debug to find out? Is there a way to explicitly set the path for a binary?
I have seen this forum topic but the implication seems to be the binary install location in python envs is different?
Here is my serverless.yml file:
org: edoror
app: audio-clipper
service: audio-clipper-slackbot
plugins:
- serverless-offline
useDotenv: true
provider:
name: aws
runtime: nodejs12.x
region: us-west-2
memorySize: 128
environment:
SLACK_SIGNING_SECRET: ${env:SLACK_SIGNING_SECRET}
SLACK_BOT_TOKEN: ${env:SLACK_BOT_TOKEN}
functions:
app:
handler: dist/index.handler
events:
- http:
method: post
path: /slack/events
layers:
- {Ref: FfmpegLambdaLayer}
layers:
ffmpeg:
path: layer