denolehov / obsidian-git

Backup your Obsidian.md vault with git
MIT License
6.12k stars 251 forks source link

[Bug]: : Error: spawn ENAMETOOLONG #725

Closed hannesdelbeke closed 1 week ago

hannesdelbeke commented 1 month ago

Describe the bug

When I start Obsidian, git doesn't commit anymore. Instead I get an error.

Relevant errors (if available) from notifications or console (CTRL+SHIFT+I)

git: Everything is up-to-date
plugin:obsidian-git:45237 git obsidian error: Error: spawn ENAMETOOLONG
plugin:obsidian-git:26944 Uncaught (in promise) Error: Error: spawn ENAMETOOLONG
    at GitExecutorChain.onFatalException (plugin:obsidian-git:26944:79)
    at GitExecutorChain.eval (plugin:obsidian-git:26936:24)
    at Generator.throw (<anonymous>)
    at rejected (plugin:obsidian-git:25805:29)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Steps to reproduce

start Obsidian

Expected Behavior

create a git commit then a git push

Addition context

No response

Operating system

Windows

Installation Method

None

Plugin version

2.24.1

hannesdelbeke commented 1 month ago

i manually commited my files, let's see if this error comes back. it's gone for now.

hannesdelbeke commented 1 month ago

seems to commit and push fine now

Vinzent03 commented 1 month ago

Great it's solved. Same as #238 A solution is probably to set the commit message not via command line argument, but per an extra input file.

hannesdelbeke commented 1 month ago

it's solved for me, which is great. 🥳

what I'm concerned about: I rely on Obsidian Git to auto backup my notes, which the plugin failed to do. I can close this issue, since my problem is solved, but the problem wont be prevented in the future for anyone else.

Recently I've been manually checking git weekly, since a merge issue lead to my notes not being backed up for 4 months 😱 I wouldn't have noticed this bug otherwise. Before this, Git obsidian auto backed up my notes without issues for the last 2+ years.

curtainteddy commented 1 month ago

Encountered the same issue with the Iconize plugin. Deleting the pre-defined icon packs and adding my local icon pack caused many file changes. Fixed it by adding the icon folder to .gitignore.

If it's applicable and you have bulk of redundant files, try doing this.

Vinzent03 commented 1 week ago

I limit now the amount of files to list in the commit message. This should solve this issue. a0416edf5f3ac5d9adc9fc37cf9a9c932583ced4