aws-lambda-libreoffice
aws-lambda-libreoffice copied to clipboard
ENOENT: no such file or directory, open '/opt/lo.tar.br'
hello! I am getting the error ENOENT: no such file or directory, open '/opt/lo.tar.br' I am using the docker image, not the deprecated libreoffice-lambda-layer, so I am assuming lo.tar.br is included in the docker (that's right?) I am trying to use the convertTo method. am I missing something in my configuration?
this is my Dockerfile:
FROM public.ecr.aws/shelf/lambda-libreoffice-base:7.4-node16-x86_64
COPY mybundle.js ${LAMBDA_TASK_ROOT}
# our bundle excludes AWS-SDK, and it is not included in the libreoffice base docker image!
# we need to install it
COPY package.json ${LAMBDA_TASK_ROOT}
RUN npm install
CMD [ "mybundle.handler" ]
This is the CDK code:
this.libreofficeFunction = new lambda.DockerImageFunction(this, 'reporterDocker'+this.env, {
code: lambda.DockerImageCode.fromImageAsset('reporterdocker'),
functionName: `reporterDocker${this.env}`,
memorySize: 1024,
ephemeralStorageSize: Size.mebibytes(1024),
timeout: Duration.seconds(60),
});
Silly error. As I was migrating from the lambda layer version to the new docker version, I didn't notice that my aws-lambda-libreoffice in the package.json was stuck in the old version. That is why I got the error about "lo.tar.br": that file was required for the layer version, but not in the new docker version. After reinstalling the latest version of this library, the error is gone (now I have a different error, but that's another history)