# Org roam error, "Error running timer"

**URL:** <https://org-roam.discourse.group/t/org-roam-error-error-running-timer/3305>\
**Category:** Troubleshooting\
**Created:** [November 28, 2023, 3:11pm UTC](https://org-roam.discourse.group/t/org-roam-error-error-running-timer/3305 "2023-11-28T15:11:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_khaled\_mustafa](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/_khaled_mustafa/32/1198_2.png) [@\_khaled\_mustafa](https://org-roam.discourse.group/u/_khaled_mustafa)\
**Post date:** [November 28, 2023, 3:11pm UTC](https://org-roam.discourse.group/t/org-roam-error-error-running-timer/3305/1 "2023-11-28T15:11:05Z")

</div>

What ever org-roam command the run I get the following error `Error running timer: (error "Selecting deleted buffer")`.

This Doom Emacs install is on a fresh Ubuntu 22.04.3 LTS, and I have also tried Ubuntu 23.10.1 (Mantic Minotaur) and still the same error.

This is my org-roam configuration:

```auto
(use-package! org-roam
  :ensure t
  :init
  (setq org-roam-v2-ack t)
  :custom
  (org-roam-directory "~/RoamNotes")
  (org-roam-completion-everywhere t)
  (org-roam-dailies-capture-templates
    '(("d" "default" entry "* %<%I:%M %p>: %?"
       :if-new (file+head "%<%Y-%m-%d>.org" "#+title: %<%Y-%m-%d>\n"))))
  :bind (("C-c n l" . org-roam-buffer-toggle)
         ("C-c n f" . org-roam-node-find)
         ("C-c n i" . org-roam-node-insert)
         :map org-mode-map
         ("C-M-i" . completion-at-point)
         :map org-roam-dailies-map
         ("Y" . org-roam-dailies-capture-yesterday)
         ("T" . org-roam-dailies-capture-tomorrow))
  :bind-keymap
  ("C-c n d" . org-roam-dailies-map)
  :config
  (require 'org-roam-dailies) ;; Ensure the keymap is available
  (org-roam-db-autosync-mode))

```

And this is the backtrace of the error:

```auto
  set-buffer(#<killed buffer>)
  (save-current-buffer (set-buffer buf) (org-reveal '(4)))
  (closure ((buf . #<killed buffer>)) nil (save-current-buffer (set-buffer buf) (org-reveal '(4))))()
  apply((closure ((buf . #<killed buffer>)) nil (save-current-buffer (set-buffer buf) (org-reveal '(4)))) nil)
  timer-event-handler([t 25958 838 237811 nil (closure ((buf . #<killed buffer>)) nil (save-current-buffer (set-buffer buf) (org-reveal '(4)))) nil nil 85000 nil])

```

I have tried the following:

- Delete the `org-roam-db` and then run `org-roam-db-sync`.
- Going into emacsql directory \>\> sqlite and running `make`.

Thank you all in advance.

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [November 29, 2023, 2:01am UTC](https://org-roam.discourse.group/t/org-roam-error-error-running-timer/3305/2 "2023-11-29T02:01:34Z")

</div>

Is this similar / same?

> <https://github.com/org-roam/org-roam/issues/2391>
>
> \### Description
> When I do a org-roam-capture, and I have a prompt option set in… my template, the minibuffer is prompting an error saying
> 
> \> \[Error running timer 'org-reveal': (error "'org-element-at-point' cannot be used in non-Org buffer #\\\<buffer \*Minibuf-1\*\\\> (minibuffer-mode)")\]
> 
> I can still continue to type into the prompt without issues but it bugged me. I tried to search for where org-reveal is being called but couldn't find it. 
> 
> \#### Steps to Reproduce
> 
> I use doom emacs. The org-roam configuration with which I can reproduce the error showing is just by adding an option to the default template.
> 
> 1. Add option to default roam-capture-template 
> \`(setq org-roam-capture-templates '(("d" "default" plain
> "Author: %^{Author} %?"
> :if-new (file+head "%\<%Y%m%d%H%M%S\>-${slug}.org" "#+title: ${title}\\n")
> :unnarrowed t)))\`
> 2. Run org-roam-capture
> 
> \#### Backtrace
> \`\`\`emacs-lisp
> Debugger entered--Lisp error: (error "‘org-element-at-point’ cannot be used in non-Org b...")
> error("\`org-element-at-point' cannot be used in non-Org b..." #\<buffer \*Minibuf-1\*\> minibuffer-mode)
> org-element-at-point(nil cached)
> org-before-first-heading-p()
> org-at-encrypted-entry-p()
> org-decrypt-entry()
> org-reveal((4))
> apply(org-reveal (4))
> timer-event-handler(\[t 25868 6866 410149 nil org-reveal ((4)) nil 130000 nil\])
> #\<subr completing-read-default\>("Author: " nil nil nil nil org-capture--prompt-history nil nil)
> apply((#\<subr completing-read-default\> "Author: " nil nil nil nil org-capture--prompt-history nil nil))
> vertico--advice(#\<subr completing-read-default\> "Author: " nil nil nil nil org-capture--prompt-history nil nil)
> apply(vertico--advice #\<subr completing-read-default\> ("Author: " nil nil nil nil org-capture--prompt-history nil nil))
> completing-read-default("Author: " nil nil nil nil org-capture--prompt-history nil nil)
> completing-read("Author: " nil nil nil nil org-capture--prompt-history nil nil)
> org-completing-read("Author: " nil nil nil nil org-capture--prompt-history nil)
> org-capture-fill-template("Author: %^{Author} %?")
> org-roam-capture--fill-template("Author: %^{Author} %?")
> org-roam-capture--prepare-buffer()
> org-capture-set-target-location(nil)
> org-capture(nil "d")
> org-roam-capture-(:goto nil :info nil :keys nil :templates nil :node #s(org-roam-node :file nil :file-title nil :file-hash nil :file-atime nil :file-mtime nil :id "325706cf-c721-404e-9d8e-a2dc210754d2" :level nil :point nil :todo nil :priority nil :scheduled nil :deadline nil :title "newNode" :properties nil :olp nil :tags nil :aliases nil :refs nil) :props (:immediate-finish nil :call-location #\<marker at 8390 in config\_doom.org\>))
> org-roam-capture(nil)
> funcall-interactively(org-roam-capture nil)
> command-execute(org-roam-capture)\`
> \`\`\` 
> 
> \#### Expected Results
> 
> No error showing
> 
> \#### Actual Results
> 
> \> \[Error running timer 'org-reveal': (error "'org-element-at-point' cannot be used in non-Org buffer #\\\<buffer \*Minibuf-1\*\\\> (minibuffer-mode)")\]
> 
> \### Environment
> 
> \- Framework: Doom
> \- Org: Org mode version 9.7 (9.7-??-e90a8a69a @ /home/kaypro/.config/emacs/.local/straight/build-28.2/org/)
> \- Org-roam: 5c06471
> \- sqlite-connector: sqliteCopy info below this line into issue:
> \- Emacs: GNU Emacs 28.2 (build 1, x86\_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0)
> of 2023-03-16, modified by Debian

I suspect it is related to Doom using an unreleased version of Org.

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [November 29, 2023, 6:28am UTC](https://org-roam.discourse.group/t/org-roam-error-error-running-timer/3305/3 "2023-11-29T06:28:16Z")

</div>

Is this you on Reddit and you have found a solution?

[https://www.reddit.com/r/emacs/comments/185y78r/org\_roam\_error\_error\_running\_timer/](https://www.reddit.com/r/emacs/comments/185y78r/org_roam_error_error_running_timer/)

---

<div class="post-metadata">

**Author:** ![\_khaled\_mustafa](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/_khaled_mustafa/32/1198_2.png) [@\_khaled\_mustafa](https://org-roam.discourse.group/u/_khaled_mustafa)\
**Post date:** [January 5, 2024, 11:24am UTC](https://org-roam.discourse.group/t/org-roam-error-error-running-timer/3305/4 "2024-01-05T11:24:09Z")

</div>

Yeah, thank you so much for the help, and I am sorry for not checking on the forum.
