New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot build database after the update #811
Comments
|
First thing I would check is if you have any duplicate ID's in your files. (let ((org-id-locations org-roam-directory)
org-agenda-files)
(org-id-update-id-locations))If you have duplicate IDs, the As the warning indicates, |
|
I think that might be related since I sometimes run the org-roam from another computer and not sure if this is related or may duplicate the ID? I copied everything in the Not sure if this is related but haven't seen the messages. I don't find a If I tried to build the Am I doing correctly? |
|
You might need to force the rebuild of the file with …Which makes me wonder if we should catch those errors during the builds and wipe the DB when that happens. |
|
Thank you for the comments. I just moved to For example, when I run the Previously it was on Line 985 so something does change but |
|
Following @progfolio's recommendation, could you try to eval this: (let ((org-id-files (org-roam--list-files org-roam-directory))
org-agenda-files)
(org-id-update-id-locations)) |
|
Thanks, the results shown is that: In the So that may be related to the duplicate IDs. How to solve this issue? |
|
I'm afraid you're going to have to manually go through your |
|
Thanks! Found all the problems are due to the |
|
If someone runs into this issue due to having lots of org-IDs in their files, this is a quick and dirty way to remove the IDs (backup your files first!): |
|
I just ran into this issue. In my case it turned out to be dropbox file conflicts I had accumulated over the past 6 years of org files, and the fact that I often attach files to headings, which adds the The code in @zaeph 's comment #811 (comment) was exactly what I needed to figure out the issue and fix. Thanks! |
|
I'm also having this problem, with I first assumed that the database required the first top-level headline for each file to be unique (not true of my files), but changing these headlines has not fixed the issue. I do not have many files containing an yields This has rendered org-roam unusable for about two weeks :/ |
|
Hello, I know it is closed but just in case it's useful for anybody landing in the same issue: To solve it, the code from #811 (comment) was key to point me out to my error. |
Description
Cannot build the org-roam database after the update
Steps to Reproduce
org-roam-db—clearorg-roam-db-build-cachesShows an error:
“EmacSQL had an unhandled condition: "near line 985: UNIQUE constraint failed: headlines.id"”
Backtrace
Debugger entered--Lisp error: (emacsql-error "near line 985: UNIQUE constraint failed: headlines.id")
signal(emacsql-error ("near line 985: UNIQUE constraint failed: headlines.id"))
#f(compiled-function (conn) #<bytecode 0x1136095>)(#<emacsql-sqlite3-connection emacsql-sqlite3-connec$
apply(#f(compiled-function (conn) #<bytecode 0x1136095>) #<emacsql-sqlite3-connection emacsql-sqlite3-$
emacsql-parse(#)
#f(compiled-function (connection sql &rest args) "Send SQL s-expression to CONNECTION and return the r$
apply(#f(compiled-function (connection sql &rest args) "Send SQL s-expression to CONNECTION and return$
emacsql(# [:insert :into headlines :values $v1]$
apply(emacsql # [:insert :into headlines :value$
org-roam-db-query([:insert :into headlines :values $v1] ((["_60q30c1g60o30e1i60o4ac1g60rj8gpl88rj2c1h8$
org-roam-db-build-cache(nil)
funcall-interactively(org-roam-db-build-cache nil)
call-interactively(org-roam-db-build-cache record nil)
command-execute(org-roam-db-build-cache record)
counsel-M-x-action("org-roam-db-build-cache")
ivy-call()
ivy-read("M-x " ("org-roam-db--clear" "toggle-debug-on-error" "org-roam-db-build-cache" "org-roam-find$
counsel-M-x()
funcall-interactively(counsel-M-x)
Expected Results
Actual Results
Environment
Emacs: GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.$
of 2019-12-02
Framework: Doom
Org: Org mode version 9.4 (nil @ /home/haoyan/.emacs.d/.local/straight/$
Org-roam: 1.2.0
Org-roam commit: 2eb0aac
The text was updated successfully, but these errors were encountered: