rxliuli / joplin-utils

Joplin-based community tool
https://joplin-utils.rxliuli.com/
MIT License
235 stars 36 forks source link

[Bug]: Edits to notes are lost, if "too many open files" in Linux #87

Closed shervinemami closed 5 months ago

shervinemami commented 1 year ago

Confirmation

The tool/kit where the error occurred

joplin-vscode-plugin

Describe the bug

Hi, sometimes when I made edits to notes in VS Code, I was losing the edits after a few minutes, even if I clicked Save! (The notes revert to the original content that was in the Joplin app, not in VS Code).

I think I found my problem: When I run the Joplin app in dev mode, Joplin dev mode opens but it also prints some warning messages about too many open file handles:

$ /tmp/.mount_JoplinujJBlM/@joplinapp-desktop --env dev
[1292369:1024/232742.097145:ERROR:file_path_watcher_inotify.cc(315)] inotify_init() failed: Too many open files (24)
[1292369:1024/232742.128408:ERROR:proxy_config_service_linux.cc(620)] inotify_init failed: Too many open files (24)

After I increased my soft limit to 8000 by following "https://manishrjain.com/increase-open-file-limits-ubuntu", and logging out & back in, now I'm not seeing those warning messages and my edits in VS Code aren't being lost.

So I think you should put a warning to Linux users that they might need to increase their soft file limit count, otherwise they can lose changes from their notes!

Steps to reproduce the behavior

Start from scratch without Joplin & plugin: rm -rf ~/.joplin* ~/.config/joplin* Install Joplin 2.12.19 on Ubuntu 22.04 (using wget command on https://joplinapp.org/help/). Run Joplin app Run Joplin dev mode. Enable Web Clipper in Joplin and copy the token. Open VS Code 1.83.0, install Joplin plugin 1.3.0 from the marketplace. Enter token and port number into the plugin settings. Restart VS Code. Open Joplin panel. In "Welcome!" folder, open the "1. Welcome" note. Enter "Testing from VS Code" near the top of the file and save it. Look in Joplin app (dev mode), view that welcome note. Maybe see that Joplin app didn't get the changed content from VS Code! Restart VS Code. Open Joplin panel to view that welcome note. After the plugin grabs the welcome note from Joplin, now the note in VS Code is missing the edit that we saved! It has returned to the content that was in the Joplin app before the changes in VS Code.

log file

combined.log error.log

Additional context

No response

rxliuli commented 1 year ago

I'm not sure where the problem is coming from here, it seems like it's a warning printed by joplin itself, maybe it should go to the joplin project report.

But can you try opening it directly in an external editor without using the vscode plug-in? Determine if notes are still being lost. Sorry, I only have a mac, so I can't reproduce the problem.

shervinemami commented 5 months ago

I'm still having this problem, but I haven't figured out the root cause, I stopped using Joplin on Linux desktop since my important notes were getting corrupted.