Installation issues on mac

I am new to emacs, and after installed org-mode and org-roam, I try to execute “M-x org-roam-node-find”,an error occurred “Query timeout error: “Query timed out”, 30”. Any help is appreciate!

my config are as follows:

(use-package org-roam
  :ensure t
  :config
  ;; If using org-roam-protocol
  (require 'org-roam-protocol)
  :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)
  :custom
  (org-roam-v2-ack t)
  (org-roam-directory (string-join (cons my/all-notes '("content-org")) "/"))
  (org-roam-capture-templates `(("d" "default" plain "%?"
                                 :unnarrowed t
                                 :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
                                                    "#+TITLE: ${title}
#+AUTHOR: James
#+DATE: %U
#+HUGO_BASE_DIR: ../
#+HUGO_SECTION: notes
")))))

I suspect you might not have a C compiler in your machine, gcc or clang?

Refer to this part of the manual: Org-roam User Manual

Org-roam relies on an Emacs package called emacsql and emacsql-sqlite to work with the sqlite database. Both of them should be installed automatically in your Emacs environment as a prerequisite for Org-roam when you install it.

emacsql-sqlite requires a C compiler (e.g. gcc or clang) to be present in your computer. How to install a C compiler depends on the OS that you use

In addition, I suggest you review the configuration in README of Org-roam repository on GitHub

Yours does not seem to be correct – where is org-roam-db-autosync-mode?

I checked clang in my mac using clang --version:

Apple clang version 14.0.0 (clang-1400.0.29.102)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I think there is a C compiler I can use?

After I added org-roam-db-autosync-mode to my config, the problem still exist.
In addition, M-x org-roam-db-build-cache or M-x org-roam-db-autosync-mode will lead to the same error :
Error (use-package): org-roam/:config: Query timeout error: "Query timed out", 30

What’s the value of your org-roam-directory?

I have never seen this way of setting your dir:

(org-roam-directory (string-join (cons my/all-notes '(“content-org”)) “/”))

Oh I forget to update the modification,the config I am using is:

(use-package org-roam
  :ensure t
  :config
  (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
  (org-roam-db-autosync-mode)
  ;; If using org-roam-protocol
  (require 'org-roam-protocol)
  :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)
  :custom
  (org-roam-v2-ack t)
  (org-roam-directory "~/notes")
  (org-roam-capture-templates `(("d" "default" plain "%?"
                                 :unnarrowed t
                                 :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
                                                    "#+TITLE: ${title}
#+AUTHOR: James
#+DATE: %U
#+HUGO_BASE_DIR: ../
#+HUGO_SECTION: notes
")))))

I make a new directory for convenience

my environment is

emacs Version 28.2 (9.0)
org-roam 2.2.2

@nobiot Thank you for your help, I have solve the probelm,
just install sqlite3 , and add (setq org-roam-database-connector 'sqlite3) before init org-roam
refer to Query timeout error: "Query timed out", 30 · Issue #1196 · org-roam/org-roam · GitHub

1 Like