libreoffice-lambda-layer icon indicating copy to clipboard operation
libreoffice-lambda-layer copied to clipboard

permission denied open /tmp/instdir/program/libplc4.so

Open matiasbattocchia opened this issue 3 years ago • 4 comments

Using any of these layers / compression methods.

  • arn:aws:lambda:us-east-1:764866452798:layer:libreoffice-brotli:1
  • arn:aws:lambda:us-east-1:764866452798:layer:libreoffice-gzip:1

Lambda logs:

Response
{
  "errorType": "Error",
  "errorMessage": "EACCES: permission denied, open '/tmp/instdir/program/libplc4.so'",
  "trace": [
    "Error: EACCES: permission denied, open '/tmp/instdir/program/libplc4.so'"
  ]
}

Function Logs
START RequestId: ddc1ce12-64b0-4cfd-8336-02e276dbbceb Version: $LATEST
2021-04-20T02:53:36.200Z	ddc1ce12-64b0-4cfd-8336-02e276dbbceb	ERROR	Invoke Error 	{"errorType":"Error","errorMessage":"EACCES: permission denied, open '/tmp/instdir/program/libplc4.so'","code":"EACCES","errno":-13,"syscall":"open","path":"/tmp/instdir/program/libplc4.so","stack":["Error: EACCES: permission denied, open '/tmp/instdir/program/libplc4.so'"]}
END RequestId: ddc1ce12-64b0-4cfd-8336-02e276dbbceb
REPORT RequestId: ddc1ce12-64b0-4cfd-8336-02e276dbbceb	Duration: 4473.39 ms	Billed Duration: 4474 ms	Memory Size: 512 MB	Max Memory Used: 148 MB

Request ID
ddc1ce12-64b0-4cfd-8336-02e276dbbceb

matiasbattocchia avatar Apr 20 '21 02:04 matiasbattocchia

I get this error as well

danielhstahl avatar Oct 21 '21 11:10 danielhstahl

Did anyone ever solve this? I hit this as well. Did you have to call something to change the permissions?

superqd avatar Jun 07 '22 02:06 superqd

Hi, did anyone ever solve this?

reneesu99 avatar Jun 21 '23 21:06 reneesu99

Trying to set the permission might work:

def extract_libreoffice():
        tar_path = '/opt/lo.tar.gz'
        if os.path.exists(tar_path):
            logger.info("Extracting LibreOffice...")
            with tarfile.open(tar_path, 'r:gz') as tar:
                tar.extractall('/tmp')
            **os.chmod('/tmp/instdir', 0o755, follow_symlinks=True)**
            logger.info("Extraction complete.")
        else:
            logger.error("Tar file for LibreOffice not found.")
        libreoffice_extracted = True

gitthub89 avatar Dec 17 '23 16:12 gitthub89