I got a problem while using org-roam in my wsl2 emacs, when I type "M-x org-roam-db-build-cache ",I got a Warning info:
Warning (org-roam): Skipping unreadable file while building cache: /mnt/f/testroam/20210104102645-test.org
It seems that the db is not update correctly after I change my org file,what’s the problem?
And I run “M-x org-roam-find-file”,but on file can be found.
My emacs Environment:
Emacs: GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20)
of 2020-09-15
Framework: N/A
Org: Org mode version 9.3 (release_9.3 @ /usr/share/emacs/27.1/lisp/org/)
What’s in the test.org file?
I have a similar set up (WSL2, but org-roam-directory being symlink pointing to an iCloud folder on the Windows side); I have no problem.
The warning says Emacs/Org-roam cannot read the file. So I would guess something is not right in the file. Can you open it from normal Emacs, or from your shell (bash, I guess?)?
In addition, I suspect you would have a dedicated buffer called “*Warning*” that lists what went wrong when Org-roam was reading your files to update the DB – e.g. failed to parse aliases, etc. Try to see if you have a Warning buffer and see if you can find out the cause of your DB update problem.
True. Can’t reproduce the problem.
I use Org Mode 9.4.4 (same Emacs 27.1).
Perhaps update Org Mode and Org-roam both?
I would have no other ideas why you get this.
I would try toggle-debug-on-error, and if that does not tell you why, then edebug to see if I can get to the bottom of it… There are only two locations ins org-roam-db.el where that message is written.
Sorry, alternatively… Is it possible that you modified the file on the Windows side, and the line feed or carriage return character are not compatible between the two systems?? I am stubbing in the dark, so disregard this if you know this is no issue.
Are you creating and changing the same file on both side of the systems (create in Win and change in Linux,etc.?). I stick to one OS for the same file. That could be a factor…
The directory I created is empty, and I use org-roam-find-file to create the test file.
I have trying to delete the elc and recompile the org-roam package but the problem still there.
I have to use debugger to see what is going on in the org-roam-db.el,thanks for your help!
the db can be update normally by “M-x org-roam-db-build-cache”
I just wanna catch what does org-roam-db–insert-links function do in the programme?
And comment this line will cause no backlinks show in the buffer.
I don’t know; I am not a developer of this package. You could look further inside that function, but it sounds like a defect in the function. You might like to report it in the project’s GitHub repo.
By the looks of the function’s name, I guess it looks at the file (current buffer, I think), and tries to extract links.
Perhaps if there is no file with a link, it does not handle it properly, and gives you an unnecessary error. If I hadn’t had any other file, perhaps I would have gotten the same error.
I just tried my own theory… I still cannot reproduce the error. I changed org-roam-directory to make the db empty (initialized, so empty db file), and then added the test file… I do not have the error.
Finally, I downgrade the org-roam package to org-roam-20201001.430,that package solve the problem, thinks a lot!
at a glance,the method is difference compare with org-roam-1.2.3