Comments (4)
Thanks for taking another look at this. No problem to add missing deps to the slim image during the build. Very helpful to have the underlying issue surfaced of course. I also appreciate the debugging tip about adding the logger.
Thanks for the fix!
from exiftool-vendored.js.
- Node 16 isn't supported.
16-bullseye-slim
does haveperl
preinstalled, but if your CI image is something else (like the alpine variant), know that your image needsperl
installed.- It'd be helpful to include a working example. Where is
mkdirp
coming from? - You might want to either
await mkdirp
or use a sync mkdirp variant. - BatchCluster does register for all childProcess exit events. See the node docs. Listening for process.on("UncaughtException") would be way overstepping, given there's no way for me to only capture exceptions batch-cluster is "responsible" for
- You aren't awaiting
exiftool.end()
. I suspect this is the main issue causing your zombies.
from exiftool-vendored.js.
Thanks for the detailed reply @mceachen
I knew I should have taken more time to strip down the example, sorry.
Here is a stripped down repro.
Doesn't seem that node16 is the issue as 18 fails with same error...
Node 16 isn't supported.
Old project that is not actively developed. But that doesn't seem to be the issue here as 18 has the same issue.
16-bullseye-slim does have perl preinstalled, but if your CI image is something else (like the alpine variant), know that your image needs perl installed.
If it turns out this is a missing perl or whatever issue, that information isn't getting surfaced. Maybe that isn't it.
It'd be helpful to include a working example. Where is mkdirp coming from?
You might want to either await mkdirp or use a sync mkdirp variant.
Sure. Repro above stripping out copy and mkdir stuff to show that isn't related to the problem (it was synchronous mkdirp under the hood FWIW)
BatchCluster does register for all childProcess exit events. See the node docs. Listening for process.on("UncaughtException") would be way overstepping, given there's no way for me to only capture exceptions batch-cluster is "responsible" for
Fair enough. In a parallelized build there are a lot of places the node process can crash. I just wanted to make sure we weren't ending up with zombie processes due to build crashes where .end()
was not getting called. But maybe it is related to your next point and batchcluster does a sane job of terminating child processes during a node crash.
To be clear, I wasn't implying you would handle other codes' exceptions or prevent node from crashing...just that you would detect node is crashing and do some cleanup to avoid zombie processes if batchcluster isn't doing that itself already.
You aren't awaiting exiftool.end(). I suspect this is the main issue causing your zombies.
Thanks. Could be. I'll open a separate issue if I continue to notice zombie processes after build crashes.
from exiftool-vendored.js.
I pulled your repo and tried to reproduce locally:
node:18-bullseye
works finenode:18-bullsye-slim
fails with the error you described.
If you change your exiftool
instance to include a logger:
exiftool = new ExifTool({ taskTimeoutMillis: 5000, logger: () => require("batch-cluster").ConsoleLogger }),
You'll see the following output:
$ gulp build
[04:20:13] Using gulpfile /code/gulpfile.js
[04:20:13] Starting 'build'...
BatchProcess(104).onStderr(): Can't locate mro.pm in @INC (you may need to install the mro module) (@INC contains: /code/node_modules/exiftool-vendored.pl/bin/lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at /usr/lib/x86_64-linux-gnu/perl-base/overload.pm line 123.
Turns out that Node's -slim
image doesn't include some perl modules that ExifTool relies on, including mro
.
It's even easier to validate by hand:
$ docker run -v.:/code -it node:18-bullseye-slim bash
root@5c5130e1a33d:/# cd /code
root@5c5130e1a33d:/code# node_modules/exiftool-vendored.pl/bin/exiftool -Creator= /code/src/files/dummy.pdf
Can't locate mro.pm in @INC (you may need to install the mro module) (@INC contains: node_modules/exiftool-vendored.pl/bin/lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at /usr/lib/x86_64-linux-gnu/perl-base/overload.pm line 123.
I'll update the docs and error handling to detect this and throw this as an error in the future.
from exiftool-vendored.js.
Related Issues (20)
- Random error when doing Write HOT 1
- `ExifTool.readRaw` incorrectly has return type `Promise<Tags>` HOT 1
- DefaultExifToolOptions HOT 3
- -g vs -G produces different tag values HOT 2
- incorrect video create date HOT 10
- Stuck forever if perl is missing HOT 2
- Asynchronous operations that weren't stopped HOT 2
- Video `Create Date` with GPS inferred timezone HOT 10
- Wrong timezone offset is parsed from `TimeCreated` tag when using `inferTimezoneFromDatestamps` HOT 4
- Adding values to numericTags does not reflect in Tags type, nor is the function allowed to be properly extended to fix the return value HOT 2
- Regression on timezone extraction from an iPhone photo HOT 3
- "No success message": success regex isn't reliable indicator of "success" HOT 3
- problem with ignoreShebang HOT 3
- GPSLatitude and GPSLongitude differs from GPSPosition HOT 6
- Treat "exiftool-vendored.exe" and "exiftool-vendored.pl" more as optional dependencies HOT 1
- Delete all tags except specified (returns `TypeError`) HOT 5
- inferTimezoneFromDatestamps does not detect UTC/Z/+00:00 timezones HOT 1
- Hang and then timeout on certain files HOT 3
- Perl not installed error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exiftool-vendored.js.