GithubHelp home page GithubHelp logo

Comments (4)

mattpr avatar mattpr commented on June 1, 2024 1

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.

mceachen avatar mceachen commented on June 1, 2024
  1. Node 16 isn't supported.
  2. 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.
  3. It'd be helpful to include a working example. Where is mkdirp coming from?
  4. You might want to either await mkdirp or use a sync mkdirp variant.
  5. 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
  6. You aren't awaiting exiftool.end(). I suspect this is the main issue causing your zombies.

from exiftool-vendored.js.

mattpr avatar mattpr commented on June 1, 2024

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

Node 18

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.

mceachen avatar mceachen commented on June 1, 2024

I pulled your repo and tried to reproduce locally:

  • node:18-bullseye works fine
  • node: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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.