0

I recently formatted my laptop's hard drive and reinstalled my OS (Manjaro in dual boot with Windows 11). I restored my entire emacs configuration on Manjaro and everything seems to work properly, except for org-roam. Every time I call the org-roam-node-find function, I got a message saying "Selecting deleted buffer". The same happens when I manually evaluate the org-roam use-package block in my init.el file. This is my org-roam config:

(use-package org-roam
      :ensure t
      :custom
      (org-roam-directory (file-truename "/mnt/Data/MEGA/Notes/Roam"))
      :bind (("C-c n l" . org-roam-buffer-toggle)
             ("C-c n f" . org-roam-node-find)
             ("C-c n g" . org-roam-graph)
             ("C-c n i" . org-roam-node-insert)
             ("C-c n c" . org-roam-capture)
             ;; Dailies
             ("C-c n j" . org-roam-dailies-capture-today))
      :config
      (org-roam-setup)
            (setq org-roam-node-display-template "${title:*} ${tags:55}")
      ;; If using org-roam-protocol
      (require 'org-roam-protocol))

And this is the full log of the error I get when I evaluate that use-package block:

Debugger entered--Lisp error: (error "Selecting deleted buffer")
  #f(compiled-function (connection) "Return true if the end of the buffer has a properly-formatted prompt." #<bytecode 0x15715abaaa11>)(#<emacsql-sqlite-connection emacsql-sqlite-connection-15715ac878bc>)
  apply(#f(compiled-function (connection) "Return true if the end of the buffer has a properly-formatted prompt." #<bytecode 0x15715abaaa11>) #<emacsql-sqlite-connection emacsql-sqlite-connection-15715ac878bc> nil)
  emacsql-waiting-p(#<emacsql-sqlite-connection emacsql-sqlite-connection-15715ac878bc>)
  #f(compiled-function (connection &optional timeout) "Block until CONNECTION is waiting for further input." #<bytecode 0x15715aba6d21>)(#<emacsql-sqlite-connection emacsql-sqlite-connection-15715ac878bc>)
  apply(#f(compiled-function (connection &optional timeout) "Block until CONNECTION is waiting for further input." #<bytecode 0x15715aba6d21>) #<emacsql-sqlite-connection emacsql-sqlite-connection-15715ac878bc> nil)
  emacsql-wait(#<emacsql-sqlite-connection emacsql-sqlite-connection-15715ac878bc>)
  #f(compiled-function (#<emacsql-sqlite-connection emacsql-sqlite-connection-15715ac878bc> (:file "~/.config/emacs/org-roam.db"))
  apply(#f(compiled-function 
  #f(compiled-function (&rest args) #<bytecode 0x15715aca7ee9>)(#<emacsql-sqlite-connection emacsql-sqlite-connection-15715ac878bc> (:file "~/.config/emacs/org-roam.db"))
  apply(#f(compiled-function (&rest args) #<bytecode 0x15715aca7ee9>) #<emacsql-sqlite-connection emacsql-sqlite-connection-15715ac878bc> (:file "~/.config/emacs/org-roam.db"))
  initialize-instance(#<emacsql-sqlite-connection emacsql-sqlite-connection-15715ac878bc> (:file "~/.config/emacs/org-roam.db"))
  #f(compiled-function (class &rest slots) "Default constructor for CLASS `eieio-default-superclass'.\nSLOTS are the initialization slots used by `initialize-instance'.\nThis static method is called when an object is constructed.\nIt allocates the vector used to represent an EIEIO object, and then\ncalls `initialize-instance' on that object." #<bytecode 0x1571591a5669>)(emacsql-sqlite-connection :file "~/.config/emacs/org-roam.db")
  apply(#f(compiled-function (class &rest slots) "Default constructor for CLASS `eieio-default-superclass'.\nSLOTS are the initialization slots used by `initialize-instance'.\nThis static method is called when an object is constructed.\nIt allocates the vector used to represent an EIEIO object, and then\ncalls `initialize-instance' on that object." #<bytecode 0x1571591a5669>) emacsql-sqlite-connection (:file "~/.config/emacs/org-roam.db"))
  make-instance(emacsql-sqlite-connection :file "~/.config/emacs/org-roam.db")
  emacsql-sqlite("~/.config/emacs/org-roam.db")
  org-roam-db()
  org-roam-db-sync()
  org-roam-db-autosync-mode(1)
  org-roam-setup()
  (progn (org-roam-setup) (setq org-roam-node-display-template "${title:*} ${tags:55}") (require 'org-roam-protocol) t)
  (condition-case err (progn (org-roam-setup) (setq org-roam-node-display-template "${title:*} ${tags:55}") (require 'org-roam-protocol) t) ((debug error) (funcall use-package--warning40 :config err)))
  (lambda nil (condition-case err (progn (org-roam-setup) (setq org-roam-node-display-template "${title:*} ${tags:55}") (require 'org-roam-protocol) t) ((debug error) (funcall use-package--warning40 :config err))))()
  eval-after-load(org-roam (lambda nil (condition-case err (progn (org-roam-setup) (setq org-roam-node-display-template "${title:*} ${tags:55}") (require 'org-roam-protocol) t) ((debug error) (funcall use-package--warning40 :config err)))))
  (progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil) (enable-theme 'use-package) (setq custom-enabled-themes (remq 'use-package custom-enabled-themes))) (custom-theme-set-variables 'use-package '(org-roam-directory (file-truename "/mnt/Data/MEGA/Notes/Roam") nil nil "Customized with use-package org-roam"))) (if (fboundp 'org-roam-buffer-toggle) nil (autoload #'org-roam-buffer-toggle "org-roam" nil t)) (if (fboundp 'org-roam-node-find) nil (autoload #'org-roam-node-find "org-roam" nil t)) (if (fboundp 'org-roam-graph) nil (autoload #'org-roam-graph "org-roam" nil t)) (if (fboundp 'org-roam-node-insert) nil (autoload #'org-roam-node-insert "org-roam" nil t)) (if (fboundp 'org-roam-capture) nil (autoload #'org-roam-capture "org-roam" nil t)) (if (fboundp 'org-roam-dailies-capture-today) nil (autoload #'org-roam-dailies-capture-today "org-roam" nil t)) (eval-after-load 'org-roam #'(lambda nil (condition-case err (progn (org-roam-setup) (setq org-roam-node-display-template "${title:*} ${tags:55}") (require 'org-roam-protocol) t) ((debug error) (funcall use-package--warning40 :config err))))) (progn (let* ((name "C-c n l") (key (if (vectorp name) name (read-kbd-macro name))) (kmap (or (if (and nil ...) (symbol-value nil) nil) global-map)) (kdesc (cons (if (stringp name) name (key-description name)) (if (symbolp nil) nil 'nil))) (binding (lookup-key kmap key))) (let ((entry (assoc kdesc personal-keybindings)) (details (list #'org-roam-buffer-toggle (if ... nil binding)))) (if entry (setcdr entry details) (add-to-list 'personal-keybindings (cons kdesc details)))) (define-key kmap key #'org-roam-buffer-toggle)) (let* ((name "C-c n f") (key (if (vectorp name) name (read-kbd-macro name))) (kmap (or (if (and nil ...) (symbol-value nil) nil) global-map)) (kdesc (cons (if (stringp name) name (key-description name)) (if (symbolp nil) nil 'nil))) (binding (lookup-key kmap key))) (let ((entry (assoc kdesc personal-keybindings)) (details (list #'org-roam-node-find (if ... nil binding)))) (if entry (setcdr entry details) (add-to-list 'personal-keybindings (cons kdesc details)))) (define-key kmap key #'org-roam-node-find)) (let* ((name "C-c n g") (key (if (vectorp name) name (read-kbd-macro name))) (kmap (or (if (and nil ...) (symbol-value nil) nil) global-map)) (kdesc (cons (if (stringp name) name (key-description name)) (if (symbolp nil) nil 'nil))) (binding (lookup-key kmap key))) (let ((entry (assoc kdesc personal-keybindings)) (details (list #'org-roam-graph (if ... nil binding)))) (if entry (setcdr entry details) (add-to-list 'personal-keybindings (cons kdesc details)))) (define-key kmap key #'org-roam-graph)) (let* ((name "C-c n i") (key (if (vectorp name) name (read-kbd-macro name))) (kmap (or (if (and nil ...) (symbol-value nil) nil) global-map)) (kdesc (cons (if (stringp name) name (key-description name)) (if (symbolp nil) nil 'nil))) (binding (lookup-key kmap key))) (let ((entry (assoc kdesc personal-keybindings)) (details (list #'org-roam-node-insert (if ... nil binding)))) (if entry (setcdr entry details) (add-to-list 'personal-keybindings (cons kdesc details)))) (define-key kmap key #'org-roam-node-insert)) (let* ((name "C-c n c") (key (if (vectorp name) name (read-kbd-macro name))) (kmap (or (if (and nil ...) (symbol-value nil) nil) global-map)) (kdesc (cons (if (stringp name) name (key-description name)) (if (symbolp nil) nil 'nil))) (binding (lookup-key kmap key))) (let ((entry (assoc kdesc personal-keybindings)) (details (list #'org-roam-capture (if ... nil binding)))) (if entry (setcdr entry details) (add-to-list 'personal-keybindings (cons kdesc details)))) (define-key kmap key #'org-roam-capture)) (let* ((name "C-c n j") (key (if (vectorp name) name (read-kbd-macro name))) (kmap (or (if (and nil ...) (symbol-value nil) nil) global-map)) (kdesc (cons (if (stringp name) name (key-description name)) (if (symbolp nil) nil 'nil))) (binding (lookup-key kmap key))) (let ((entry (assoc kdesc personal-keybindings)) (details (list #'org-roam-dailies-capture-today (if ... nil binding)))) (if entry (setcdr entry details) (add-to-list 'personal-keybindings (cons kdesc details)))) (define-key kmap key #'org-roam-dailies-capture-today))))
  (condition-case err (progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil) (enable-theme 'use-package) (setq custom-enabled-themes (remq 'use-package custom-enabled-themes))) (custom-theme-set-variables 'use-package '(org-roam-directory (file-truename "/mnt/Data/MEGA/Notes/Roam") nil nil "Customized with use-package org-roam"))) (if (fboundp 'org-roam-buffer-toggle) nil (autoload #'org-roam-buffer-toggle "org-roam" nil t)) (if (fboundp 'org-roam-node-find) nil (autoload #'org-roam-node-find "org-roam" nil t)) (if (fboundp 'org-roam-graph) nil (autoload #'org-roam-graph "org-roam" nil t)) (if (fboundp 'org-roam-node-insert) nil (autoload #'org-roam-node-insert "org-roam" nil t)) (if (fboundp 'org-roam-capture) nil (autoload #'org-roam-capture "org-roam" nil t)) (if (fboundp 'org-roam-dailies-capture-today) nil (autoload #'org-roam-dailies-capture-today "org-roam" nil t)) (eval-after-load 'org-roam #'(lambda nil (condition-case err (progn (org-roam-setup) (setq org-roam-node-display-template "${title:*} ${tags:55}") (require ...) t) ((debug error) (funcall use-package--warning40 :config err))))) (progn (let* ((name "C-c n l") (key (if (vectorp name) name (read-kbd-macro name))) (kmap (or (if ... ... nil) global-map)) (kdesc (cons (if ... name ...) (if ... nil ...))) (binding (lookup-key kmap key))) (let ((entry (assoc kdesc personal-keybindings)) (details (list ... ...))) (if entry (setcdr entry details) (add-to-list 'personal-keybindings (cons kdesc details)))) (define-key kmap key #'org-roam-buffer-toggle)) (let* ((name "C-c n f") (key (if (vectorp name) name (read-kbd-macro name))) (kmap (or (if ... ... nil) global-map)) (kdesc (cons (if ... name ...) (if ... nil ...))) (binding (lookup-key kmap key))) (let ((entry (assoc kdesc personal-keybindings)) (details (list ... ...))) (if entry (setcdr entry details) (add-to-list 'personal-keybindings (cons kdesc details)))) (define-key kmap key #'org-roam-node-find)) (let* ((name "C-c n g") (key (if (vectorp name) name (read-kbd-macro name))) (kmap (or (if ... ... nil) global-map)) (kdesc (cons (if ... name ...) (if ... nil ...))) (binding (lookup-key kmap key))) (let ((entry (assoc kdesc personal-keybindings)) (details (list ... ...))) (if entry (setcdr entry details) (add-to-list 'personal-keybindings (cons kdesc details)))) (define-key kmap key #'org-roam-graph)) (let* ((name "C-c n i") (key (if (vectorp name) name (read-kbd-macro name))) (kmap (or (if ... ... nil) global-map)) (kdesc (cons (if ... name ...) (if ... nil ...))) (binding (lookup-key kmap key))) (let ((entry (assoc kdesc personal-keybindings)) (details (list ... ...))) (if entry (setcdr entry details) (add-to-list 'personal-keybindings (cons kdesc details)))) (define-key kmap key #'org-roam-node-insert)) (let* ((name "C-c n c") (key (if (vectorp name) name (read-kbd-macro name))) (kmap (or (if ... ... nil) global-map)) (kdesc (cons (if ... name ...) (if ... nil ...))) (binding (lookup-key kmap key))) (let ((entry (assoc kdesc personal-keybindings)) (details (list ... ...))) (if entry (setcdr entry details) (add-to-list 'personal-keybindings (cons kdesc details)))) (define-key kmap key #'org-roam-capture)) (let* ((name "C-c n j") (key (if (vectorp name) name (read-kbd-macro name))) (kmap (or (if ... ... nil) global-map)) (kdesc (cons (if ... name ...) (if ... nil ...))) (binding (lookup-key kmap key))) (let ((entry (assoc kdesc personal-keybindings)) (details (list ... ...))) (if entry (setcdr entry details) (add-to-list 'personal-keybindings (cons kdesc details)))) (define-key kmap key #'org-roam-dailies-capture-today)))) ((debug error) (funcall use-package--warning40 :catch err)))
  (progn (use-package-ensure-elpa 'org-roam '(t) 'nil) (defvar use-package--warning40 #'(lambda (keyword err) (let ((msg (format "%s/%s: %s" ... keyword ...))) (display-warning 'use-package msg :error)))) (condition-case err (progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil) (enable-theme 'use-package) (setq custom-enabled-themes (remq 'use-package custom-enabled-themes))) (custom-theme-set-variables 'use-package '(org-roam-directory (file-truename "/mnt/Data/MEGA/Notes/Roam") nil nil "Customized with use-package org-roam"))) (if (fboundp 'org-roam-buffer-toggle) nil (autoload #'org-roam-buffer-toggle "org-roam" nil t)) (if (fboundp 'org-roam-node-find) nil (autoload #'org-roam-node-find "org-roam" nil t)) (if (fboundp 'org-roam-graph) nil (autoload #'org-roam-graph "org-roam" nil t)) (if (fboundp 'org-roam-node-insert) nil (autoload #'org-roam-node-insert "org-roam" nil t)) (if (fboundp 'org-roam-capture) nil (autoload #'org-roam-capture "org-roam" nil t)) (if (fboundp 'org-roam-dailies-capture-today) nil (autoload #'org-roam-dailies-capture-today "org-roam" nil t)) (eval-after-load 'org-roam #'(lambda nil (condition-case err (progn ... ... ... t) (... ...)))) (progn (let* ((name "C-c n l") (key (if ... name ...)) (kmap (or ... global-map)) (kdesc (cons ... ...)) (binding (lookup-key kmap key))) (let ((entry ...) (details ...)) (if entry (setcdr entry details) (add-to-list ... ...))) (define-key kmap key #'org-roam-buffer-toggle)) (let* ((name "C-c n f") (key (if ... name ...)) (kmap (or ... global-map)) (kdesc (cons ... ...)) (binding (lookup-key kmap key))) (let ((entry ...) (details ...)) (if entry (setcdr entry details) (add-to-list ... ...))) (define-key kmap key #'org-roam-node-find)) (let* ((name "C-c n g") (key (if ... name ...)) (kmap (or ... global-map)) (kdesc (cons ... ...)) (binding (lookup-key kmap key))) (let ((entry ...) (details ...)) (if entry (setcdr entry details) (add-to-list ... ...))) (define-key kmap key #'org-roam-graph)) (let* ((name "C-c n i") (key (if ... name ...)) (kmap (or ... global-map)) (kdesc (cons ... ...)) (binding (lookup-key kmap key))) (let ((entry ...) (details ...)) (if entry (setcdr entry details) (add-to-list ... ...))) (define-key kmap key #'org-roam-node-insert)) (let* ((name "C-c n c") (key (if ... name ...)) (kmap (or ... global-map)) (kdesc (cons ... ...)) (binding (lookup-key kmap key))) (let ((entry ...) (details ...)) (if entry (setcdr entry details) (add-to-list ... ...))) (define-key kmap key #'org-roam-capture)) (let* ((name "C-c n j") (key (if ... name ...)) (kmap (or ... global-map)) (kdesc (cons ... ...)) (binding (lookup-key kmap key))) (let ((entry ...) (details ...)) (if entry (setcdr entry details) (add-to-list ... ...))) (define-key kmap key #'org-roam-dailies-capture-today)))) ((debug error) (funcall use-package--warning40 :catch err))))
  eval((progn (use-package-ensure-elpa 'org-roam '(t) 'nil) (defvar use-package--warning40 #'(lambda (keyword err) (let ((msg ...)) (display-warning 'use-package msg :error)))) (condition-case err (progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil) (enable-theme 'use-package) (setq custom-enabled-themes (remq ... custom-enabled-themes))) (custom-theme-set-variables 'use-package '(org-roam-directory ... nil nil "Customized with use-package org-roam"))) (if (fboundp 'org-roam-buffer-toggle) nil (autoload #'org-roam-buffer-toggle "org-roam" nil t)) (if (fboundp 'org-roam-node-find) nil (autoload #'org-roam-node-find "org-roam" nil t)) (if (fboundp 'org-roam-graph) nil (autoload #'org-roam-graph "org-roam" nil t)) (if (fboundp 'org-roam-node-insert) nil (autoload #'org-roam-node-insert "org-roam" nil t)) (if (fboundp 'org-roam-capture) nil (autoload #'org-roam-capture "org-roam" nil t)) (if (fboundp 'org-roam-dailies-capture-today) nil (autoload #'org-roam-dailies-capture-today "org-roam" nil t)) (eval-after-load 'org-roam #'(lambda nil (condition-case err ... ...))) (progn (let* ((name "C-c n l") (key ...) (kmap ...) (kdesc ...) (binding ...)) (let (... ...) (if entry ... ...)) (define-key kmap key #'org-roam-buffer-toggle)) (let* ((name "C-c n f") (key ...) (kmap ...) (kdesc ...) (binding ...)) (let (... ...) (if entry ... ...)) (define-key kmap key #'org-roam-node-find)) (let* ((name "C-c n g") (key ...) (kmap ...) (kdesc ...) (binding ...)) (let (... ...) (if entry ... ...)) (define-key kmap key #'org-roam-graph)) (let* ((name "C-c n i") (key ...) (kmap ...) (kdesc ...) (binding ...)) (let (... ...) (if entry ... ...)) (define-key kmap key #'org-roam-node-insert)) (let* ((name "C-c n c") (key ...) (kmap ...) (kdesc ...) (binding ...)) (let (... ...) (if entry ... ...)) (define-key kmap key #'org-roam-capture)) (let* ((name "C-c n j") (key ...) (kmap ...) (kdesc ...) (binding ...)) (let (... ...) (if entry ... ...)) (define-key kmap key #'org-roam-dailies-capture-today)))) ((debug error) (funcall use-package--warning40 :catch err)))) nil)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

My elisp knowledge is very basic so I don't know how to interpret this output. I tried to run org-roam-db-sync but I get the same "Selecting deleted buffer" error. I deleted the org-roam folder and reinstalled it but it didn't help and I wasn't able to find anything helpful on internet. Any suggestion is really appreciated!

4
  • I can't tell where it's going off the rails, partly because of ignorance, partly because the code is compiled and partly because there is an eieio layer that inevitably tends to hide things. It seems to me that the problem is an emacsql problem, rather than an org-roam problem, so I would try to see if I could get the emacsql layer working first. But unfortunately I cannot tell you how to do that. Hopefully, somebody with experience could give you some debugging hints.
    – NickD
    Jan 21, 2022 at 16:19
  • 1
    Yes emacsql was probably the first problem since at the begninning I realised I haven't installed it, but even after installing it I still get the error message...but if that is the issue maybe I might find something more useful on internet using emacsql as keyword, I'll give it a try. Jan 23, 2022 at 15:49
  • Did you resolve this? I have the same error using org-roam on a new computer and also trying to use forge / ghub gives the same error.
    – slackline
    May 20, 2022 at 9:53
  • I have finally solved this thanks to the comment in this thread which suggested the need to recompile the code under emacsql-sqlite-[INSTALLED_VERSION]/sqlite/ runnning make within the directory. For me I was told the binary was up-to-date so I deleted it and re-compiled, bingo everything worked again.
    – slackline
    May 22, 2022 at 15:13

1 Answer 1

0

Sticking this in as a solution but as suggested in this answer on Reddit if you recompile the emacsql-sqlite binary it might solve the problem (worked for me).

cd ~/.confg/emacs/elpa/emacsql-sqlite/sqlite
rm -f emacs-sqlite
make

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.