shelfio / libreoffice-lambda-layer

MIT License
108 stars 21 forks source link

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

Open matiasbattocchia opened 3 years ago

matiasbattocchia commented 3 years ago

Using any of these layers / compression methods.

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
danielhstahl commented 2 years ago

I get this error as well

superqd commented 2 years ago

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

reneesu99 commented 1 year ago

Hi, did anyone ever solve this?

gitthub89 commented 7 months ago

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