doomemacs / doomemacs

An Emacs framework for the stubborn martian hacker
MIT License
19.39k stars 3.05k forks source link

emacsql-sqlite has failed immediately on opening emacs #7319

Open Jdogzz opened 1 year ago

Jdogzz commented 1 year ago

I confirm that...

Expected behavior

Open emacs and have it launch successfully.

Current behavior

emacs opens and throws an error saying emacsql-sqlite has failed immediately. Here's the output of the error:

Warning (initialization): An error occurred while loading ‘/home/myuser/.config/emacs/.local/etc/@/init.28.elc’:

Error caused by user's config or system: /home/myuser/.config/doom/config.el, (error /home/myuser/.config/emacs/.local/straight/build-28.2/emacsql/sqlite/emacsql-sqlite has failed immediately)

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace. Disable showing Disable logging

Here is the output from doom doctor:

The doctor will see you now...

> Checking your Emacs version...
> Checking for Doom's prerequisites...
> Checking for Emacs config conflicts...
> Checking for great Emacs features...
> Checking for private config conflicts...
> Checking for stale elc files...
> Checking for problematic git global settings...
> Checking Doom Emacs...
  x There was an unexpected runtime error
    Message: /home/myuser/.config/emacs/.local/straight/build-28.2/emacsql/sqlite/emacsql-sqlite has failed immediately
    Backtrace:
      (error "%s has failed immediately" "/home/myuser/.config/emacs/.local/straight/build-28.2/emacsql...
      (#[385 "\305 \210\306\307\211\310\311\"\312\313!\203\314!\202\315\316\317...
      (apply #[385 "\305 \210\306\307\211\310\311\"\312\313!\203\314!\202\315\316...
      (#[128 "\300\211\203\211@\303\"\210A\266\202\202\210\303\302\"\301\211\203+\2...
      (apply #[128 "\300\211\203\211@\303\"\210A\266\202\202\210\303\302\"\301\211\20...
      (initialize-instance #s(#s(eieio--class emacsql-sqlite-connection "A connection to a SQLite dat...
      (#[385 "\302\2119\203\211\303N\206\202\211\262\304>\204\"\305\306\307D...
      (apply #[385 "\302\2119\203\211\303N\206\202\211\262\304>\204\"\305\306\...
      (make-instance emacsql-sqlite-connection :file "~/.config/emacs/.local/cache/org-roam.db")
      (emacsql-sqlite "~/.config/emacs/.local/cache/org-roam.db")
      (org-roam-db)
      (org-roam-db-sync)
    ! Wrote extended backtrace to ~/.config/emacs/.local/state/logs/cli.doom.230729095948.17487.error

This appears to be identical to the issue thread here on Discord: https://discord.com/channels/406534637242810369/1106846641987780660/1106846641987780660

The suggestion there was that a compile step was missing for emacsql-sqlite.

Steps to reproduce

  1. Install doom emacs fresh.
  2. Activate org-roam in init.el with "(org +roam2)
  3. Add extremely minimal org-roam config in config.el:
    (after! org
    (setq org-roam-directory "~/org/")
    (org-roam-db-autosync-mode)
    )
  4. Run doom sync -u
  5. Open emacs

(This was enough to trigger a failure some time after launch in an Ubuntu VM and on my actual system, but it didn't cause the more severe loading failure that I'm experiencing with my full config on my actual system as reported above. I'm in the process of diagnosing where my actual config is breaking things. I suspect some part of the rest of my org config is causing an immediate load of the org-roam part of my config since after dumping a huge block of the org part of my config above my org-roam part of my config, I see it causing the transition from the gentle failure to more severe loading failure)

System Information

https://pastebin.com/SrA6re1t

zhyzky commented 1 year ago

I got the same issue. However, you can build sqlite yourself with this

cd .config/emacs/.local/straight/build-XXX/emacsql/sqlite
make

And the problem went away if the build finished without error.

anegg0 commented 8 months ago

Thank you, @zhyzky , that worked for me, running emacs native comp 29.1