-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package task aws lambda not able to find module and package name month is wrong #6
Comments
Hi tamtamoanxx, |
Yes The contents of the package are correct visually. The only thing that I could find is that I’m coding all this in a windows environment that could be part of the issue. If I zip all the contents manually it works just fine.
|
Are you able to create a simple projects that exhibits this behaviour which I can try and run? What about if you upload the zipped file manually, does it work then? |
I will generate the project and send it over to you shortly. It is the same result if I upload manually. Thanks,
|
Same here. Reproducible at Windows 8. It looks like a permission issue on files in nested folders. To reproduce:
|
Same here with Windows 8. I have deployed correctly after doing a little patch to archiver\lib\core.js changing the data.mode to 777 near line 179: if (typeof data.mode === 'number') { |
I bumped the adm-zip version to the latest one which I hope will resolve this issue. I also tested it in a Windows 7 VM and it all worked fine. |
Hi Tim-B I just tested the new version 0.4.0 (Windows 8.1) but deps are not detected . If I change core.js it works fine. |
I realised I should have bumped node-archiver not adm-zip, but node-archiver is already the latest version. It might be worth reporting this upstream: https://github.com/archiverjs/node-archiver I can't rule out that my implementation isn't to blame, but the options say "When using the bulk or file methods, fs stat data is used as the default value." so perhaps it's not correctly reading the stat data on Windows. I might look into replacing the whole zip library with a different one. |
as far I can see your implementation is correct. I tried to unzip the package with windows and with unix and they seem ok, so I think it's something about the unzip process of lambda. p.d. |
I have a suspicion of what it is, it looks like zips don't support unix file permissions explicitly - but some zip implementations specify them via a custom field in the ZIP header: http://stackoverflow.com/questions/13633488/can-i-store-unix-permissions-in-a-zip-file-built-with-apache-ant If I run a zip generated on my machine (Ubuntu) through zipinfo most of the file permissions are -rw-rw-r--, but I suspect it's reading and therefore setting incorrect permissions on Windows. When lambda unzips the package on linux it abides by the faulty file permissions in the zip. Would you be able to somehow share a zip generated on your machine and I'll run it through zipinfo to see if the permissions differ. |
So on my machine your zip produces:
But when I generate the same zip I get:
I think the problem could be that the execute bit is missing on directories. I'll take a look and see if I can either fix that, or strip the permission information automatically. |
I did a bit of a monkey patch which I think will fix this issue by making all files and folders have 777 permissions. https://github.com/Tim-B/grunt-aws-lambda/blob/master/tasks/lambda_package.js#L76 Hopefully that will fix the issue, it would be great if someone who uses Windows could give the latest version a try and let me know how they go. |
I ended up making my own aws lambda app template with gulp tasks. Gulp-zip doesn't have any issues. Besides, I needed package files and node modules lists config per function. |
Aws is unable to locate node modules but when I zip it up manually it is able to locate them.
Also the package name date is one month behind.
The text was updated successfully, but these errors were encountered: