Skip to content

Unexpected error: EMFILE: too many open files, open 'C:\Users\Administrator\AppData\Roaming\marktext\preferences.json' #2906

Closed

Description

@wendaott

Description

An unexpected error occurred in the main process.

Stack Trace

Error: EMFILE: too many open files, open 'C:\Users\Administrator\AppData\Roaming\marktext\preferences.json'
    at Object.openSync (fs.js:466:3)
    at Object.func [as openSync] (electron/js2c/asar_bundle.js:5:1812)
    at Object.readFileSync (fs.js:368:35)
    at Object.e.readFileSync (electron/js2c/asar_bundle.js:5:8583)
    at ElectronStore.get store [as store] (D:\Program Files\Mark Text\resources\app.asar\node_modules\conf\dist\source\index.js:262:29)
    at ElectronStore._get (D:\Program Files\Mark Text\resources\app.asar\node_modules\conf\dist\source\index.js:451:33)
    at ElectronStore.get (D:\Program Files\Mark Text\resources\app.asar\node_modules\conf\dist\source\index.js:149:25)
    at tn.getItem (D:\Program Files\Mark Text\resources\app.asar\dist\electron\main.js:2:303467)
    at tn.getPreferedEol (D:\Program Files\Mark Text\resources\app.asar\dist\electron\main.js:2:303650)
    at Wt.openTabs (D:\Program Files\Mark Text\resources\app.asar\dist\electron\main.js:2:281474)

Version

Mark Text: v0.16.3
Operating system: Windows_NT x64 10.0.17763 (win32)

Activity

  1. fxha commented on Jan 21, 2022

    @fxha
    Contributor

    Thank you for taking the time to report this issue. This seems to be an issue with your OS that to many file handles are opened. Did you opened a deep folder in MarkText, like C:\?

  2. added
    🐛 bug
    🐞 pri/critical
    🐹 platform/windows
    on May 16, 2026
  3. Jocs commented on May 23, 2026

    @Jocs
    Member

    Closing — EMFILE: too many open files is an OS-level file-descriptor exhaustion error, not a MarkText bug per se. The trace shows fs.openSync failing on preferences.json, which means the process (or the whole system) had hit its open-file limit before this call.

    This typically happens when something else on the machine leaks file handles (Windows Search indexers, certain antivirus products, or a runaway script) and MarkText just happens to be the first process to fail when the limit is exhausted.

    If you can reproduce this on a fresh boot with only MarkText running, please reopen with the version and steps — that would indicate an actual fd leak inside MarkText. Otherwise this is environmental.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐹 platform/windows🐛 bug🐞 pri/critical

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions