You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
serverless package should not attempt to follow symlinks in excluded directories #6890
Reproduce by creating a serverless.yml with the following included:
package:
exclude:
- example/
And then creating an example/ dir and a broken symlink inside it, eg. mkdir example/; ln -s /does/not/exist example/broken.
Running serverless package on this will cause an ENOENT error.
Error: ENOENT: no such file or directory, open '/home/adys/src/_/web/scripts/broken_symlink'
at Package.getFileContent (/home/adys/.local/share/yarn/global/node_modules/serverless/lib/plugins/package/lib/zipService.js:134:15)
at Package.getFileContentAndStat (/home/adys/.local/share/yarn/global/node_modules/serverless/lib/plugins/package/lib/zipService.js:123:12)
at Array.map (<anonymous>)
at WriteStream.<anonymous> (/home/adys/.local/share/yarn/global/node_modules/serverless/lib/plugins/package/lib/zipService.js:92:46)
at WriteStream.emit (events.js:210:5)
at WriteStream.EventEmitter.emit (domain.js:476:20)
at /home/adys/.local/share/yarn/global/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:231:14
at /home/adys/.local/share/yarn/global/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:258:16
at FSReqCallback.oncomplete (fs.js:146:23)
Incidentally, excluded directories should be skipped. I have a directory under exclude that contains tens of millions of files and it's causing serverless to hang for hours and run OOM.
Activity
jleclanche commentedon Oct 26, 2019
Incidentally, excluded directories should be skipped. I have a directory under
excludethat contains tens of millions of files and it's causing serverless to hang for hours and run OOM.medikoo commentedon Oct 28, 2019
This should definitely be fixed with: #6580
Still interim patch for current packaging implementation is welcome.
jleclanche commentedon Oct 28, 2019
@medikoo Agreed, and I guess with whatever fixes that we should make sure the
excludedirectory is skipped.medikoo commentedon Oct 28, 2019
Yes, there's no point to inspect excluded directories. If it happens, it's already a sign of some inefficiency
thewizarodofoz commentedon Mar 10, 2020
@medikoo can you share an update on this please?
medikoo commentedon Mar 16, 2020
@thewizarodofoz #6580 is on a todo list as one of the priorities, but delivery date is uncertain, and I wouldn't expect that soon.
Anyway if you can come up with a fix that patches current implementation PR is definitely welcome