vladholubiev / serverless-libreoffice

Run LibreOffice in AWS Lambda to create PDFs & convert documents
https://vladholubiev.com/serverless-libreoffice
513 stars 75 forks source link

This does not look like a tar archive #10

Closed abdulbarik closed 6 years ago

abdulbarik commented 6 years ago

Hi, First of all thanks for sharing this awesome module. I am trying to use the complied file but getting the error added on subject. I have followed the doc step by step. I uploaded the lo.tar.gz on S3 bucket and created a lambda function with code which is added by you. I am getting following error:

tar: This does not look like a tar archive


gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
START RequestId: 5065489b-7b82-11e8-9818-73a78f241cd9 Version: $LATEST
module initialization error: Error
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
100 243 0 243 0 0 224 0 --:--:-- 0:00:01 --:--:-- 224
tar: This does not look like a tar archive

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
jonogan commented 6 years ago

I'm getting the same error, any solution?

abdulbarik commented 6 years ago

I tried multiple way but no luck :(

vladholubiev commented 6 years ago

@abdulbarik can you please paste the output of ls -al in the local directory where lo.tar.gz is downloaded?

And by the way, I recommend using https://github.com/vladgolubev/aws-lambda-libreoffice, it is much smaller and tested in production

jonogan commented 6 years ago

@vladgolubev I ran the following via lambda to get the contents of the /tmp directory:

fs.readdirSync('/tmp').forEach(file => { console.log(file); })

It does show that lo.tar.gz is the only file in the directory.

I also ran chmod on it to give all users rwx permissions, just in case it was a permissions issue.

Additionally, I unpacked the tar file, then gzipped it myself and uploaded it. When I tried to use gzip to unpack in the lambda I get a 'not in gzip format' error.

Any ideas?

abdulbarik commented 6 years ago

Thanks, @vladgolubev , your recommendation is working great & smoothly. @jonogan You can also use second approach. Closing the issue.

d3netxer commented 4 years ago

I had a similar problem, but I needed to adjust the permissions for the individual lo.tar.gz in the S3 bucket. oops