Emacsql-sqlite not running

I am using emacs 29.1 on debian 12. I installed emacs 29.1 from bookworm-backports repository using apt package manager.

I am trying to use org-roam with the elpa packages installed solely from debian stable apt repository. For this purpose, I installed following elpa-* packages using apt:

  with-editor                    3.0.5          external              Use the Emacsclient as $EDITOR
  transient                      0.3.7          external              Emacs key and popup interface for complex keybindings
  swiper                         0.13.4         external              Isearch with an overview. Oh, man!
  smex                           3.0            external              M-x interface with Ido-style fuzzy matching.
  seq                            2.23           external              Sequence manipulation functions
  rainbow-delimiters             2.1.5          external              Highlight brackets according to their depth
  projectile                     2.7.0          external              Manage and navigate projects in Emacs easily
  org-roam                       2.2.1          external              A database abstraction layer for Org-mode
  magit-section                  3.3.0          external              Sections for read-only buffers
  magit                          3.3.0          external              A Git porcelain inside Emacs.
  lua-mode                       20210802       external              a major-mode for editing Lua scripts
  ivy                            0.13.4         external              Incremental Vertical completYon
  git-commit                     3.3.0          external              Edit Git commit messages
  emacsql-sqlite                 3.1.1          external              EmacSQL back-end for SQLite
  emacsql                        3.1.1          external              High-level SQL database front-end
  dash                           2.19.1         external              A modern list library for Emacs
  counsel                        0.13.4         external              Various completion functions using Ivy
  compat                         29.1.3.4       external              Emacs Lisp Compatibility Library

All these “external” packages are in-fact installed using sudo apt install commands. Mainly the apt repo package names are elpa-* prepended, meaning, if the package name is displayed above as org-roam the apt command that was used to install it is sudo apt install elpa-org-roam.

These packages are located in my system under /usr/share/emacs/site-lisp/elpa-src/:

% ls -la /usr/share/emacs/site-lisp/elpa-src/        
total 80K
drwxr-xr-x 20 root root 4.0K Nov 18 20:09 .
drwxr-xr-x  7 root root 4.0K Nov 18 20:09 ..
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 compat-29.1.3.4
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 counsel-0.13.4
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 dash-2.19.1
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 emacsql-3.1.1
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 emacsql-sqlite-3.1.1
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 git-commit-3.3.0
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 ivy-0.13.4
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 lua-mode-20210802
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 magit-3.3.0
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 magit-section-3.3.0
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 org-roam-2.2.1
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 projectile-2.7.0
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 rainbow-delimiters-2.1.5
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 seq-2.23
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 smex-3.0
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 swiper-0.13.4
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 transient-0.3.7
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 with-editor-3.0.5

and here is the contents of the org-roam directory:

% ls -la /usr/share/emacs/site-lisp/elpa-src/org-roam-2.2.1 
total 300K
drwxr-xr-x  2 root root 4.0K Nov 18 20:09 .
drwxr-xr-x 20 root root 4.0K Nov 18 20:09 ..
-rw-r--r--  1 root root  14K Apr 30  2022 org-roam-autoloads.el
-rw-r--r--  1 root root  39K Apr 30  2022 org-roam-capture.el
-rw-r--r--  1 root root  11K Apr 30  2022 org-roam-compat.el
-rw-r--r--  1 root root  17K Apr 30  2022 org-roam-dailies.el
-rw-r--r--  1 root root  32K Apr 30  2022 org-roam-db.el
-rw-r--r--  1 root root  14K Apr 30  2022 org-roam.el
-rw-r--r--  1 root root 2.8K Apr 30  2022 org-roam-export.el
-rw-r--r--  1 root root  13K Apr 30  2022 org-roam-graph.el
-rw-r--r--  1 root root 4.6K Apr 30  2022 org-roam-id.el
-rw-r--r--  1 root root 2.0K Apr 30  2022 org-roam-log.el
-rw-r--r--  1 root root 6.6K Apr 30  2022 org-roam-migrate.el
-rw-r--r--  1 root root  28K Apr 30  2022 org-roam-mode.el
-rw-r--r--  1 root root  48K Apr 30  2022 org-roam-node.el
-rw-r--r--  1 root root 3.5K Apr 30  2022 org-roam-overlay.el
-rw-r--r--  1 root root  296 Apr 30  2022 org-roam-pkg.el
-rw-r--r--  1 root root 8.8K Apr 30  2022 org-roam-protocol.el
-rw-r--r--  1 root root  19K Apr 30  2022 org-roam-utils.el

Now, here is the org-roam config part in my init.el file:

	(use-package org-roam
	  :custom
	  (org-roam-database-connector 'sqlite)	  
	  (org-roam-directory "~/org/roam")
	  (org-roam-completion-everywhere t)
	  :config
	  (require 'org-roam-dailies) ;; Ensure the keymap is available
	  (org-roam-db-autosync-enable))

However, when I enter into my daily page using C-c n d d I get, “:no_entry: Error (use-package): org-roam/:config: Process emacsql-sqlite not running: finished” in my Warnings buffer. From time to time, as I restart emacs and re-try org-roam after some small changes to my init.el file in order to remedy the issue, I also see “:no_entry: Error (use-package): org-roam/:config: Selecting deleted buffer” error in my Warnings buffer.

I am unable to see my backlinks, nor I am able to jump to linked org-roam documents in between them.

My question is:

  1. how can I resolve this error?
  2. do I have to include (use-package emacsql-sqlite) and (use-package emacsql) directives to my init.el file as well? Currently I don’t have these two lines included.

Some notes: I know that the org-roam documentation recommends using emacsql-sqlite-builtin instead of emacsql-sqlite. However, since the former package is not yet available in debian bookworm repository, I decided to employ the latter package.

Question: is debian 29.1 unable to work with emacsql-sqlite package?

People coming to this thread should follow the conversation in the following thread: Installing solely from debian apt repositories is problematic