Roam refuses to sync

Hi,

I just updated my org-roam which I hadn’t done in a few months (since 2.1.0) and I get some trouble with org-roam-db-sync which returns

org-export-define-derived-backend: Unknown keyword: :export-block

When starting Emacs, I got the exact same error when (org-roam-db-autosync-mode) is enabled. First shots after update, I got something like error: selecting deleted buffer at start before bissecting my init to the culprit.

Otherwise, Roam seems to work fine.

I’m sure there is no bug (I don’t see anything as such in OR issues or on Discourse) but something twisting in my config with roam.

Init file is written in Org and tangled with babel, my config:

- Emacs: GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
 of 2022-09-03
- Framework: N/A
- Org: Org mode version 9.5.4 (release_9.5.4-19-g4dff42 @ /usr/share/emacs/29.0.50/lisp/org/)
- Org-roam: 2.2.2- sqlite-connector: sqlite

Output of emacs --debug-init:

Debugger entered--Lisp error: (error "Unknown keyword: :export-block")
  signal(error ("Unknown keyword: :export-block"))
  error("Unknown keyword: %s" :export-block)
  org-export-define-derived-backend(pandoc org :translate-alist ((template . org-pandoc-template)) :export-block "PANDOC" :menu-entry (112 "export via pandoc" ((97 "to asciidoc and open." org-pandoc-export-to-asciidoc-and-open) (65 "as asciidoc." org-pandoc-export-as-asciidoc) (98 "to beamer-pdf and open." org-pandoc-export-to-beamer-pdf-and-open) (66 "to beamer-pdf." org-pandoc-export-to-beamer-pdf) (99 "to context and open." org-pandoc-export-to-context-and-open) (67 "as context." org-pandoc-export-as-context) (100 "to docbook and open." org-pandoc-export-to-docbook-and-open) (68 "as docbook." org-pandoc-export-as-docbook) (120 "to docx and open." org-pandoc-export-to-docx-and-open) (88 "to docx." org-pandoc-export-to-docx) (122 "to dzslides and open." org-pandoc-export-to-dzslides-and-open) (90 "as dzslides." org-pandoc-export-as-dzslides) (101 "to epub3 and open." org-pandoc-export-to-epub3-and-open) (69 "to epub3." org-pandoc-export-to-epub3) (102 "to fb2 and open." org-pandoc-export-to-fb2-and-open) (70 "as fb2." org-pandoc-export-as-fb2) (104 "to html5 and open." org-pandoc-export-to-html5-and-open) (72 "as html5." org-pandoc-export-as-html5) (105 "to icml and open." org-pandoc-export-to-icml-and-open) (73 "as icml." org-pandoc-export-as-icml) (106 "to json and open." org-pandoc-export-to-json-and-open) (74 "as json." org-pandoc-export-as-json) (108 "to latex-pdf and open." org-pandoc-export-to-latex-pdf-and-open) (76 "to latex-pdf." org-pandoc-export-to-latex-pdf) (109 "to man and open." org-pandoc-export-to-man-and-open) (77 "as man." org-pandoc-export-as-man) (107 "to markdown and open." org-pandoc-export-to-markdown-and-open) (75 "as markdown." org-pandoc-export-as-markdown) (103 "to markdown_github and open." org-pandoc-export-to-markdown_github-and-open) (71 "as markdown_github." org-pandoc-export-as-markdown_github) (119 "to mediawiki and open." org-pandoc-export-to-mediawiki-and-open) (87 "as mediawiki." org-pandoc-export-as-mediawiki) (110 "to native and open." org-pandoc-export-to-native-and-open) (78 "as native." org-pandoc-export-as-native) (111 "to odt and open." org-pandoc-export-to-odt-and-open) (79 "to odt." org-pandoc-export-to-odt) (112 "to plain and open." org-pandoc-export-to-plain-and-open) (80 "as plain." org-pandoc-export-as-plain) (118 "to revealjs and open." org-pandoc-export-to-revealjs-and-open) (86 "as revealjs." org-pandoc-export-as-revealjs) (58 "to rst and open." org-pandoc-export-to-rst-and-open) (42 "as rst." org-pandoc-export-as-rst) (114 "to rtf and open." org-pandoc-export-to-rtf-and-open) (82 "as rtf." org-pandoc-export-as-rtf) (115 "to s5." org-pandoc-export-to-s5) (115 "to s5 and open." org-pandoc-export-to-s5-and-open) (121 "to slidy and open." org-pandoc-export-to-slidy-and-open) (89 "as slidy." org-pandoc-export-as-slidy) (116 "to texinfo and open." org-pandoc-export-to-texinfo-and-open) (84 "as texinfo." org-pandoc-export-as-texinfo))) :options-alist ((:pandoc-options "PANDOC_OPTIONS" nil nil space) (:pandoc-metadata "PANDOC_METADATA" nil nil space) (:pandoc-variables "PANDOC_VARIABLES" nil nil space) (:epub-chapter-level "EPUB_CHAPTER_LEVEL" nil nil t) (:epub-cover-image "EPUB_COVER" nil nil t) (:epub-embed-font "EPUB_EMBED_FONT" nil nil newline) (:epub-meta "EPUB_META" nil nil newline) (:epub-css "EPUB_CSS" nil nil newline) (:epub-rights "EPUB_RIGHTS" nil nil newline) (:bibliography "BIBLIOGRAPHY")))
  eval-buffer(#<buffer  *load*-935335> nil "/home/thibaultdep/.emacs.d/elpa/ox-pandoc-1.150707..." nil t)  ; Reading at buffer position 10345
  load-with-code-conversion("/home/thibaultdep/.emacs.d/elpa/ox-pandoc-1.150707..." "/home/thibaultdep/.emacs.d/elpa/ox-pandoc-1.150707..." nil t)
  require(ox-pandoc)
  (if (executable-find "pandoc") (require 'ox-pandoc))
  eval-buffer(#<buffer  *load*-777812> nil "/home/thibaultdep/.emacs.d/elpa/org-ref-20220808.1..." nil t)  ; Reading at buffer position 1976
  load-with-code-conversion("/home/thibaultdep/.emacs.d/elpa/org-ref-20220808.1..." "/home/thibaultdep/.emacs.d/elpa/org-ref-20220808.1..." nil t)
  require(org-ref-export)
  eval-buffer(#<buffer  *load*-46346> nil "/home/thibaultdep/.emacs.d/elpa/org-ref-20220808.1..." nil t)  ; Reading at buffer position 1500
  load-with-code-conversion("/home/thibaultdep/.emacs.d/elpa/org-ref-20220808.1..." "/home/thibaultdep/.emacs.d/elpa/org-ref-20220808.1..." nil t)
  require(org-ref-core)
  eval-buffer(#<buffer  *load*-166917> nil "/home/thibaultdep/.emacs.d/elpa/org-ref-20220808.1..." nil t)  ; Reading at buffer position 1622
  load-with-code-conversion("/home/thibaultdep/.emacs.d/elpa/org-ref-20220808.1..." "/home/thibaultdep/.emacs.d/elpa/org-ref-20220808.1..." t t)
  require(org-ref nil noerror)
  (let ((lib (car --dolist-tail--))) (require lib nil 'noerror) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (while --dolist-tail-- (let ((lib (car --dolist-tail--))) (require lib nil 'noerror) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (let ((--dolist-tail-- libs)) (while --dolist-tail-- (let ((lib (car --dolist-tail--))) (require lib nil 'noerror) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  org-roam-require((org-ref oc))
  org-roam-db-sync()
  (cond (enabled (add-hook 'find-file-hook #'org-roam-db-autosync--setup-file-h) (add-hook 'kill-emacs-hook #'org-roam-db--close-all) (advice-add #'rename-file :after #'org-roam-db-autosync--rename-file-a) (advice-add #'delete-file :before #'org-roam-db-autosync--delete-file-a) (org-roam-db-sync)) (t (remove-hook 'find-file-hook #'org-roam-db-autosync--setup-file-h) (remove-hook 'kill-emacs-hook #'org-roam-db--close-all) (advice-remove #'rename-file #'org-roam-db-autosync--rename-file-a) (advice-remove #'delete-file #'org-roam-db-autosync--delete-file-a) (org-roam-db--close-all) (let ((--dolist-tail-- (org-roam-buffer-list))) (while --dolist-tail-- (let ((buf (car --dolist-tail--))) (save-current-buffer (set-buffer buf) (remove-hook 'after-save-hook #'org-roam-db-autosync--try-update-on-save-h t)) (setq --dolist-tail-- (cdr --dolist-tail--)))))))
  (let ((enabled org-roam-db-autosync-mode)) (cond (enabled (add-hook 'find-file-hook #'org-roam-db-autosync--setup-file-h) (add-hook 'kill-emacs-hook #'org-roam-db--close-all) (advice-add #'rename-file :after #'org-roam-db-autosync--rename-file-a) (advice-add #'delete-file :before #'org-roam-db-autosync--delete-file-a) (org-roam-db-sync)) (t (remove-hook 'find-file-hook #'org-roam-db-autosync--setup-file-h) (remove-hook 'kill-emacs-hook #'org-roam-db--close-all) (advice-remove #'rename-file #'org-roam-db-autosync--rename-file-a) (advice-remove #'delete-file #'org-roam-db-autosync--delete-file-a) (org-roam-db--close-all) (let ((--dolist-tail-- (org-roam-buffer-list))) (while --dolist-tail-- (let ((buf ...)) (save-current-buffer (set-buffer buf) (remove-hook ... ... t)) (setq --dolist-tail-- (cdr --dolist-tail--))))))))
  (let ((last-message (current-message))) (progn (set-default 'org-roam-db-autosync-mode (cond ((eq arg 'toggle) (not (default-value 'org-roam-db-autosync-mode))) ((and (numberp arg) (< arg 1)) nil) (t t)))) (if (boundp 'global-minor-modes) (progn (setq global-minor-modes (delq 'org-roam-db-autosync-mode global-minor-modes)) (if (default-value 'org-roam-db-autosync-mode) (progn (setq global-minor-modes (cons 'org-roam-db-autosync-mode global-minor-modes)))))) (let ((enabled org-roam-db-autosync-mode)) (cond (enabled (add-hook 'find-file-hook #'org-roam-db-autosync--setup-file-h) (add-hook 'kill-emacs-hook #'org-roam-db--close-all) (advice-add #'rename-file :after #'org-roam-db-autosync--rename-file-a) (advice-add #'delete-file :before #'org-roam-db-autosync--delete-file-a) (org-roam-db-sync)) (t (remove-hook 'find-file-hook #'org-roam-db-autosync--setup-file-h) (remove-hook 'kill-emacs-hook #'org-roam-db--close-all) (advice-remove #'rename-file #'org-roam-db-autosync--rename-file-a) (advice-remove #'delete-file #'org-roam-db-autosync--delete-file-a) (org-roam-db--close-all) (let ((--dolist-tail-- (org-roam-buffer-list))) (while --dolist-tail-- (let (...) (save-current-buffer ... ...) (setq --dolist-tail-- ...))))))) (run-hooks 'org-roam-db-autosync-mode-hook (if (default-value 'org-roam-db-autosync-mode) 'org-roam-db-autosync-mode-on-hook 'org-roam-db-autosync-mode-off-hook)) (if (called-interactively-p 'any) (progn (customize-mark-as-set 'org-roam-db-autosync-mode) (if (and (current-message) (not (equal last-message (current-message)))) nil (let ((local "")) (message "Org-Roam-Db-Autosync mode %sabled%s" (if (default-value ...) "en" "dis") local))))))
  org-roam-db-autosync-mode()
  eval-buffer(#<buffer  *load*-793065> nil "/home/thibaultdep/git/dotemacs/init.el" nil t)  ; Reading at buffer position 24060
  load-with-code-conversion("/home/thibaultdep/git/dotemacs/init.el" "/home/thibaultdep/git/dotemacs/init.el" nil nil)
  load("/home/thibaultdep/git/dotemacs/init.el" nil nil t)
  load-file("~/git/dotemacs/init.el")
  org-babel-load-file("~/git/dotemacs/init.org")
  eval-buffer(#<buffer  *load*> nil "/home/thibaultdep/.emacs" nil t)  ; Reading at buffer position 48
  load-with-code-conversion("/home/thibaultdep/.emacs" "/home/thibaultdep/.emacs" t t)
  load("~/.emacs" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x1f342a9a679a6cad>) #f(compiled-function () #<bytecode -0x1f3c6feddc0a97f5>) t)
  command-line()
  normal-top-level()

It looks like the error comes from Org-ref? Can’t be sure. How about trying removing it?

Thank you for your help. You’re right, I get the same error when calling org-ref. However, org-ref has been disabled in my workflow for months and is not active at start-up.

I quite don’t understand how it interferes with OR syncing, I do have cite:reference org-ref citations in pretty much all my files but it shouldn’t be interpreted as such as long as org-ref is disabled.

I’ll dig in and let you know.

Org-roam has require org-ref. It returns nil if it is not in the load-path but it does seem to do something afterwords if it exits in your load path. The error log seems to indicate the error originates from this statement. This is why I’m suggesting you to remove the package altogether from your directory if you haven’t done so yet.

I could be barking at the wrong tree, of course. But I don’t have org-ref in my system and I don’t have the error…