oleeskild / digitalgarden

275 stars 158 forks source link

Build error: EMFILE: too many open files #221

Closed davidkopp closed 10 months ago

davidkopp commented 10 months ago

I have only 250 notes in my public digital garden, however, somehow that seems to be too much (I'm using an own server for the build). If I delete e.g. half of them the build works again.

[11ty] Problem writing Eleventy templates: (more in DEBUG output)
[11ty] 1. Having trouble writing to "dist/index.html" from "./src/site/notes/Welcome.md" (via EleventyTemplateError)
[11ty] 2. (./src/site/_includes/layouts/index.njk)
[11ty]   Template render error: (/usr/src/app/src/site/_includes/components/pageheader.njk)
[11ty]   EleventyShortcodeError: Error with Nunjucks shortcode `favicons` (via Template render error)
[11ty] 3. EMFILE: too many open files, open 'dist/favicon.ico' (via Template render error)
[11ty]
[11ty] Original error stack trace: Error: EMFILE: too many open files, open 'dist/favicon.ico'

[...]

ERROR: "build:eleventy" exited with 1.

There are some issues around this problem known for eleventy: https://github.com/11ty/eleventy/issues?q=is%3Aissue+EMFILE However, with my knowledge I was not able to fix the problem.

davidkopp commented 10 months ago

Found a solution after looking for the issue in relation to Node.js... https://stackoverflow.com/questions/8965606/node-and-error-emfile-too-many-open-files

ulimit -n

→ 1024 (too less)

I'm now using the following Docker / Podman build command:

podman build --ulimit nofile=10000:10000  .