org-roam / org-roam

Rudimentary Roam replica with Org-mode
https://www.orgroam.com
GNU General Public License v3.0
5.44k stars 476 forks source link

Wrong type argument: integer-or-marker-p, nil #2361

Open otech-nl opened 1 year ago

otech-nl commented 1 year ago

Description

I use org-roam on Linux and Windows, and recently added MacOS to the mix. The configuration that worked for me on other platforms now gives a "Wrong type argument: integer-or-marker-p, nil" when the org-roam db is updated.

Steps to Reproduce

The relevant part of my config (with straight use-package):

  (use-package org-roam
    :ensure t
    :init
    (setq org-roam-v2-ack t)
    :after org
)

The error occurs when I start Emacs, but I can also trigger it with org-roam-db-sync.

I also tried to remove the org-roam database and the complete straight folder before starting Emacs to force a clean start, but this gives the same result.

Backtrace

I don't get a backtrace, even with debug-on-error t (or --debug-init). Instead I get the following message for each of my org-roam files:

Error (org-roam): Failed to process <filename>.org with error Wrong type argument: integer-or-marker-p, nil, skipping... Disable showing Disable logging

This error messages comes from org-roam-db.el:698, which is confirmed because I see the message "Processing modified files..."

Expected Results

Updated database without errors

Actual Results

Error messages as described above.

The database does get filled with tables and data. I can't say if its complete.

Environment

Emacs installed with homebrew cask, which uses https://emacsformacosx.com/.

max6166 commented 1 year ago

+1. Exactly the same problem.

The only clue I've been able to find is that the probem seems to be related to links. Both of my probloematic files contain links. One has external links and the other org-roam links. Deleting the links solves the problem.

  :ensure t
  :custom
  (org-roam-directory (file-truename "~/org/org-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
  (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
  (org-roam-db-autosync-mode)
  (require 'org-roam-protocol)
  )
otech-nl commented 1 year ago

I checked a subset of my notes that got successfully imported and can confirm they did not contain links.

vderyagin commented 1 year ago

Also had this, slightly downgrading org-mode (to commit 9082fa889) resolved the issue, didn't investigate further than that

max6166 commented 1 year ago

Below is a simple node example that triggers the error. There are no square brackets around the link info. This is the complete text of the node.

:PROPERTIES:
:ID:       C8AD00C6-A447-4BA4-B844-E48262019C1B
:END:
#+title: Test

id:D6765314-53B6-4D90-A0F7-889154A4C361

Removing the colon from the last line fixes the problem.

:PROPERTIES:
:ID:       C8AD00C6-A447-4BA4-B844-E48262019C1B
:END:
#+title: Test

idD6765314-53B6-4D90-A0F7-889154A4C361
otech-nl commented 1 year ago

Also had this, slightly downgrading org-mode (to commit 9082fa889) resolved the issue, didn't investigate further than that

Thanks! With straight.el I can pin my version in .emacs.d/straight/versions/default.el to org@9.5.5 with:

(("org" . "8ef6205a560cd3a92f8c5f8fe34953b80121c2cb"))
:gamma

This gets rid of the error for me.

If I understand correctly, straight installs the latest version by default (org@9.7-pre). The above suggests that this pre-release breaks org-roam. I am not sure if/how to inform the maintainers of org/org-roam. Any suggestions?

ifinkelstein commented 1 year ago

Quick note that M-x straight-freeze-versions should be run first to write the .emacs.d/straight/versions/default.el file. This will lock down all package versions, unless the file is edited to remove all but the org-related commit.

Also had this, slightly downgrading org-mode (to commit 9082fa889) resolved the issue, didn't investigate further than that

Thanks! With straight.el I can pin my version in .emacs.d/straight/versions/default.el to org@9.5.5 with:

(("org" . "8ef6205a560cd3a92f8c5f8fe34953b80121c2cb"))
:gamma

This gets rid of the error for me.

If I understand correctly, straight installs the latest version by default (org@9.7-pre). The above suggests that this pre-release breaks org-roam. I am not sure if/how to inform the maintainers of org/org-roam. Any suggestions?

Itrekr commented 1 year ago

I also have this issue. Any note with links fully messes up my emacs somehow.

jmburgos commented 1 year ago

+1 Same problem here. I am using:

Org roam: v2.2.2-42-g5c06471 Org mode version 9.7-pre (release_9.6.7-572-g39de4a) GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.17.8) of 2023-05-09.

So if using the pre-release version of org mode is the problem, how do I exactly reverse to a previous version? I am using straight, but I my expertise is very thin. From what was described before, I need to:

  1. Run straight-freeze-versions to generate the default.el file.
  2. Edit the org entry in the file

... and then? I am not sure how to force straight to re-install org mode. Could you give me some points? Thanks! :)

Itrekr commented 1 year ago

+1 Same problem here. I am using:

Org roam: v2.2.2-42-g5c06471 Org mode version 9.7-pre (release_9.6.7-572-g39de4a) GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.17.8) of 2023-05-09.

So if using the pre-release version of org mode is the problem, how do I exactly reverse to a previous version? I am using straight, but I my expertise is very thin. From what was described before, I need to:

  1. Run straight-freeze-versions to generate the default.el file.
  2. Edit the org entry in the file

... and then? I am not sure how to force straight to re-install org mode. Could you give me some points? Thanks! :)

I second this. If someone could explain how to get this done for the novices like me/us I'd be very grateful. My whole workflow is broken now so I'd love to fix it.

otech-nl commented 1 year ago

Check my previous reply for configuring straight.el.

jmburgos commented 1 year ago

@otech-nl, I was trying to follow your instructions. I ran straight-freeze-versions and edited the defaul.elfile as you did. But I am not sure what to do after that. I did straight-pull org and straight-merge org, but my org mode version is still 9.7-pre. As I said, my expertise is thin... :)

An of course, this happens when I on a deadline and I need to use org-roam a lot. Murphy's law, I guess...

otech-nl commented 1 year ago

@otech-nl, I was trying to follow your instructions. I ran straight-freeze-versions and edited the defaul.elfile as you did. But I am not sure what to do after that. I did straight-pull org and straight-merge org, but my org mode version is still 9.7-pre. As I said, my expertise is thin... :)

You may have to delete org from .emacs.d/straight/repos and/or .emacs.d/straight/build and restart Emacs

An of course, this happens when I on a deadline and I need to use org-roam a lot. Murphy's law, I guess...

More like Finagle's corollary ;) Good luck!

draxil commented 1 year ago

Is there a bug report for this in org-mode?

jmburgos commented 1 year ago

Thank you @otech-nl, deleting org from those locations was the key, and in hindsight something obvious to do. Now I am in org 9.5.5. and everything works fine. Hopefully this will get sorted soon.

Itrekr commented 1 year ago

Check my previous reply for configuring straight.el.

I can't get straight.el to work. I have tried using straight-freeze-versions but this gives me a vague error that "Caches are still outdated; something is seriously wrong" but I can't find the cause of this. Am I missing some glaringly obvious step in the straight.el process?

goofansu commented 1 year ago

I confirm the latest stable version 9.6.7 also works. Configure in packages.el if using Doom Emacs:

(package! org :pin "5890ac")
dustinfarris commented 1 year ago

I confirm the latest stable version 9.6.7 also works. Configure in packages.el if using Doom Emacs:

(package! org :pin "5890ac")

Thanks for the tip, but where did you get that commit? I couldn't find it anywhere.

I pegged to 9.6.7 with:

(package! org :pin "ca873f7")

and things are working much smoother now :-)

goofansu commented 1 year ago

@dustinfarris In the link: https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tag/?h=release_9.6.7

yantar92 commented 1 year ago

See my comment in https://github.com/radian-software/straight.el/issues/1107 for the likely reason. I believe that the issue belongs to straight.

yanboyang713 commented 1 year ago

Hello @dustinfarris ,

I pined to "ca873f7" and "5890ac", but still does not work. Which version of emacs are you using? I am using 28.2. Thanks

yantar92 commented 1 year ago

@yanboyang713 You may need to re-compile everything that depends on Org. Because the issue is related to inlined functions that may be left in mixed state if you switched back-and-forth between the pins.

yanboyang713 commented 1 year ago

Thanks @yantar92 . Working now.

goofansu commented 1 year ago

I pegged to 9.6.7 with:

(package! org :pin "ca873f7")

Hi @dustinfarris, where did you get the ca873f7 commit? I found 5890ac is not usable when doom upgrade.

dustinfarris commented 1 year ago

5890ac is the tag ref.  The actual commit that was tagged is ca873f7

https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?h=release_9.6.7&id=ca873f7fe47546bca19821f1578a6ab95bf5351c

goofansu commented 1 year ago

@dustinfarris Got it, thank you!

progfolio commented 1 year ago

Should be fixed on develop branch of straight.el. Testing is appreciated.

Samoed commented 1 year ago

@progfolio For me, everything is working at the latest commit

jmburgos commented 1 year ago

I am still having the issue with release_9.6.7-644-gf80c82. :(

progfolio commented 1 year ago

I am still having the issue with release_9.6.7-644-gf80c82. :(

What's the output of M-x straight-version?

jmburgos commented 1 year ago

(HEAD -> master, origin/master, origin/HEAD) ff63b15 2023-06-15

progfolio commented 1 year ago

(HEAD -> master, origin/master, origin/HEAD) ff63b15 2023-06-15

You would need to update to straight's "develop" branch. e.g.

(setq straight-repository-branch "develop")

Before straight's bootstrapping snippet.

jmburgos commented 1 year ago

Ah! You are right @progfolio. Now things are working!

gicrisf commented 1 year ago

Quick step-by-step instructions for Doom emacs users:

To rollback org, look at the last line of package! org expression...

(package! org
  :recipe (:host github
          ...)
  :pin "5890ac") ;; <--- Edit this line with the right commit. This one works on my machine.

... and save the file.

No, you can run ~/.config/emacs/bin/doom install. Wait for Doom to install every package again. During the installation, you should see this line:

 - Checked out org: 5890ac

Finally, start your Emacs and enjoy your org-roam while waiting for further updates.

Samoed commented 1 year ago

@gicrisf You can pin org-mode version in doom/packages.el. And after that delete org repos and then doom sync.

gicrisf commented 1 year ago

@Samoed Does it work too?! This is great, I thought the modules would be loaded first

Enemoy commented 1 year ago

I pinned it according to @gicrisf but I still have the same error in files that contain links. The error messages start to stack up. I can still use org mode but every time I update my config I have the same error and the links in documents don't work. Do I have to pin the version in packages.el or where do I have to pin it? And which version of the package should I pin?

I am new to the whole (doom) emacs thing and I am really confused, sorry.

I get these error messages:

⛔ Warning (emacs): Org version mismatch.  Org loading aborted.
This warning usually appears when a built-in Org version is loaded
prior to the more recent Org version.

Version mismatch is commonly encountered in the following situations:

1. Emacs is loaded using literate Org config and more recent Org
   version is loaded inside the file loaded by ‘org-babel-load-file’.
   ‘org-babel-load-file’ triggers the built-in Org version clashing
   the newer Org version attempt to be loaded later.

   It is recommended to move the Org loading code before the
   ‘org-babel-load-file’ call.

2. New Org version is loaded manually by setting ‘load-path’, but some
   other package depending on Org is loaded before the ‘load-path’ is
   configured.
   This "other package" is triggering built-in Org version, again
   causing the version mismatch.

   It is recommended to set ‘load-path’ as early in the config as
   possible.

3. New Org version is loaded using straight.el package manager and
   other package depending on Org is loaded before straight triggers
   loading of the newer Org version.

   It is recommended to put

    (straight-use-package 'org)

   early in the config.  Ideally, right after the straight.el
   bootstrap.  Moving ‘use-package’ :straight declaration may not be
   sufficient if the corresponding ‘use-package’ statement is
   deferring the loading.
⛔ Error (org-roam): Failed to process <file> with error Wrong type argument: integer-or-marker-p, nil, skipping...
⛔ Error (org-roam): Failed to process<file> with error Wrong type argument: integer-or-marker-p, nil, skipping...

It does say config successfully reloaded! though. I have neither babel nor straight (consciously) installed and there is no load-path anywhere in my config.

jacmoe commented 1 year ago

@Enemoy :

Since you are using Doom Emacs, you are using straight and other supporting packages . . .

Pin Org in packages.el ->

;; Fix for org-roam link issue (package! org :pin "ca873f7")

Then remove the .local directory in the main Doom dir.

Then simply run doom sync - since you removed the local dir, Doom should automatically download and install all the packages.

It should all complete without errors.

Now, you can safely and successfully perform doom upgrade

64J0 commented 1 year ago

+1 facing this problem as well.


This workaround solved the problem in my case: https://github.com/org-roam/org-roam/issues/2361#issuecomment-1632943836.

As mentioned in the comment (using an external link), after pinning the version we need to run M-x straight-thaw-versions.

AlecVercruysse commented 1 year ago

@progfolio Thank you for looking into this, moving to the development branch of straight.el fixes this problem for me.

zot commented 9 months ago

For anyone using elpaca, this use-package clause works for me (maybe there's a better one, beats me):

(use-package org
  ;; pin org at 9.6 for now
  ;; modified from elpaca/cache/gnu-elpa.eld to use the release_9.6 branch
  :elpaca (:package "org" :repo "git://git.sv.gnu.org/emacs/elpa" :local-repo "org" :branch "release_9.6" :files ("*" (:exclude ".git" "etc/schema" "contrib" "mk" "testing" "lisp/org-install.el"))))
progfolio commented 9 months ago

For anyone using elpaca, this use-package clause works for me (maybe there's a better one, beats me):

(use-package org
  ;; pin org at 9.6 for now
  ;; modified from elpaca/cache/gnu-elpa.eld to use the release_9.6 branch
  :elpaca (:package "org" :repo "git://git.sv.gnu.org/emacs/elpa" :local-repo "org" :branch "release_9.6" :files ("*" (:exclude ".git" "etc/schema" "contrib" "mk" "testing" "lisp/org-install.el"))))

Shouldn't need the workaround if you are using Elpaca. See the test case below:

Test Case [How to run this test?](https://github.com/progfolio/elpaca/wiki/Troubleshooting#the-elpaca-test-macro) ```emacs-lisp (elpaca-test :early-init (setq elpaca-menu-functions '(elpaca-menu-org elpaca-menu-melpa)) :init (elpaca (compat :files ("*" (:exclude ".git")) :local-repo "compat" :repo "https://github.com/emacs-compat/compat")) (elpaca org) (elpaca org-roam (setq org-roam-directory "/tmp/test/" org-roam-v2-ack t)) (elpaca-wait) (org-roam-db-sync)) ```
Host Env
elpaca1008684 HEAD -> feat/version-checks
isntaller0.6
emacsGNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.18.0) of 2023-12-06
gitgit version 2.43.0
Output ```emacs-lisp INFO Scraping files for loaddefs... INFO Scraping files for loaddefs...done GEN ../elpaca-autoloads.el Cloning into '/tmp/elpaca.wsMEx5/elpaca/repos/elpaca'... Your branch is up to date with 'origin/master'. Checking /tmp/elpaca.wsMEx5/elpaca/repos/elpaca... Compiling /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/elpaca-info.el... Compiling /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/elpaca-log.el... Compiling /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/elpaca-manager.el... Compiling /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/elpaca-menu-elpa.el... Compiling /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/elpaca-menu-melpa.el... Compiling /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/elpaca-menu-org.el... Compiling /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/elpaca-process.el... Compiling /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/elpaca-test.el... Compiling /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/elpaca-ui.el... Compiling /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/elpaca.el... Checking /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/doc... Compiling /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/doc/early-init.el... Compiling /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/doc/init.el... Checking /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/extensions... Compiling /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/extensions/elpaca-use-package.el... Checking /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/images... Checking /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/test... Compiling /tmp/elpaca.wsMEx5/elpaca/repos/elpaca/test/elpaca-test.el... Done (Total of 11 files compiled, 3 skipped in 4 directories) Downloading MELPA recipes... Downloading MELPA recipes...100% Clearing removed files... Clearing removed files...done Processing modified files... Processing modified files...4% Unable to read file "/home/n/git/Emacs/org-html-themes/setup/theme-readtheorg.setup" Unable to read file "/home/n/git/Emacs/org-html-themes/setup/theme-readtheorg.setup" Unable to read file "/home/n/git/Emacs/org-html-themes/setup/theme-readtheorg.setup" Unable to read file "/home/n/git/Emacs/org-html-themes/setup/theme-readtheorg.setup" Processing modified files...11% Processing modified files...12% Processing modified files...13% Processing modified files...17% Processing modified files...24% Processing modified files...31% Processing modified files...32% Processing modified files...37% Processing modified files...44% Processing modified files...45% Processing modified files...46% Processing modified files...47% Processing modified files...48% Processing modified files...49% Processing modified files...50% Processing modified files...51% Processing modified files...52% Processing modified files...53% Processing modified files...54% Processing modified files...61% Processing modified files...77% Processing modified files...90% Processing modified files...91% Processing modified files...92% Processing modified files...93% Processing modified files...94% Processing modified files...99% Processing modified files...done Test Env Elpaca ad60abc HEAD -> master, origin/master, origin/HEAD installer: 0.6 emacs-version: GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.18.0) of 2023-12-06 git --version: git version 2.43.0 ```
zot commented 9 months ago

Huh, well it was loading 0rg 9.7.X and breaking org-roam until I fixed it with that just a few days ago. So at least one person had the problem (me).

progfolio commented 9 months ago

Huh, well it was loading 0rg 9.7.X and breaking org-roam until I fixed it with that just a few days ago. So at least one person had the problem (me).

Here's another test, explicitly listing the version of Org (9.7-pre):

Test Case [How to run this test?](https://github.com/progfolio/elpaca/wiki/Troubleshooting#the-elpaca-test-macro) ```emacs-lisp (elpaca-test :early-init (setq elpaca-menu-functions '(elpaca-menu-org elpaca-menu-melpa)) :init (elpaca (compat :files ("*" (:exclude ".git")) :local-repo "compat" :repo "https://github.com/emacs-compat/compat")) (elpaca org) (elpaca org-roam (setq org-roam-directory "/tmp/test/" org-roam-v2-ack t)) (elpaca-wait) (org-roam-db-sync) (org-version nil 'full 'message)) ```
Host Env
elpaca1008684 HEAD -> feat/version-checks
isntaller0.6
emacsGNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.18.0) of 2023-12-06
gitgit version 2.43.0
Output ```emacs-lisp INFO Scraping files for loaddefs... INFO Scraping files for loaddefs...done GEN ../elpaca-autoloads.el Cloning into '/tmp/elpaca.KZ2kgv/elpaca/repos/elpaca'... Your branch is up to date with 'origin/master'. Checking /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca... Compiling /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/elpaca-info.el... Compiling /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/elpaca-log.el... Compiling /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/elpaca-manager.el... Compiling /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/elpaca-menu-elpa.el... Compiling /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/elpaca-menu-melpa.el... Compiling /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/elpaca-menu-org.el... Compiling /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/elpaca-process.el... Compiling /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/elpaca-test.el... Compiling /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/elpaca-ui.el... Compiling /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/elpaca.el... Checking /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/doc... Compiling /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/doc/early-init.el... Compiling /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/doc/init.el... Checking /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/extensions... Compiling /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/extensions/elpaca-use-package.el... Checking /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/images... Checking /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/test... Compiling /tmp/elpaca.KZ2kgv/elpaca/repos/elpaca/test/elpaca-test.el... Done (Total of 11 files compiled, 3 skipped in 4 directories) Downloading MELPA recipes... Downloading MELPA recipes...100% Clearing removed files... Clearing removed files...done Processing modified files... Processing modified files...4% Unable to read file "/home/n/git/Emacs/org-html-themes/setup/theme-readtheorg.setup" Unable to read file "/home/n/git/Emacs/org-html-themes/setup/theme-readtheorg.setup" Unable to read file "/home/n/git/Emacs/org-html-themes/setup/theme-readtheorg.setup" Unable to read file "/home/n/git/Emacs/org-html-themes/setup/theme-readtheorg.setup" Processing modified files...11% Processing modified files...12% Processing modified files...13% Processing modified files...17% Processing modified files...24% Processing modified files...28% Processing modified files...32% Processing modified files...33% Processing modified files...38% Processing modified files...44% Processing modified files...45% Processing modified files...46% Processing modified files...47% Processing modified files...48% Processing modified files...49% Processing modified files...50% Processing modified files...51% Processing modified files...52% Processing modified files...53% Processing modified files...54% Processing modified files...55% Processing modified files...59% Processing modified files...64% Processing modified files...87% Processing modified files...90% Processing modified files...91% Processing modified files...92% Processing modified files...93% Processing modified files...94% Processing modified files...97% Processing modified files...done Org mode version 9.7-pre (9.7-pre-n/a-gb8d27b @ /tmp/elpaca.KZ2kgv/elpaca/builds/org/) Test Env Elpaca ad60abc HEAD -> master, origin/master, origin/HEAD installer: 0.6 emacs-version: GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.18.0) of 2023-12-06 git --version: git version 2.43.0 ```

Do you recall what steps you took to see the error? Were packages updated and then the error started happening, fresh install, etc?

kentbull commented 7 months ago

Straight package manage user here.

Pinning to "ca873f7" worked for me with the following config:

(use-package org-roam
  :straight (org-roam :type git :host github :repo "org-roam/org-roam" :commit "ca873f7")
  :init
  (setq org-roam-v2-ack t)
  :after org
  :custom
  (org-roam-directory "~/org/roam-brain")
  (org-roam-completion-everywhere t)
  :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))
  :config
  (org-roam-setup))

Once you pin the version then you need to restart Emacs.

progfolio commented 7 months ago

Kent Bull notifications@github.com writes:

:straight (org-roam :type git :host github :repo "org-roam/org-roam" :commit "ca873f7") Once you pin the version then you need to restart Emacs.

FYI, straight.el has no :commit recipe keyword.

From the README:

We support :branch, but not :commit or :version-regexp. To lock a package to a specific commit, use a lockfile. See also #246 for discussion of extensions to the recipe to support package pinning, which is a planned feature.

You'll want to use a lockfile.

For Elpaca users, lockfiles are a planned feature. However, Elpaca does have more flexible recipe keywords such as :ref and :pin.

kentbull commented 7 months ago

Ok, thanks for the correction. You're right. This means I don't know why it works for me.

lum7na commented 5 months ago

I've identified a temporary fix if you're using Org 9.7.

https://github.com/org-roam/org-roam/blob/8667e441876cd2583fbf7282a65796ea149f0e5f/org-roam-db.el#L572

Due to modifications in the Org Element API, the begin property was removed, leading to the aforementioned error. Replacing (org-element-property :begin link)) with (aref (org-element-property :standard-properties link) 0) can resolve this issue.

yantar92 commented 5 months ago

lum7na @.***> writes:

I've identified a temporary fix if you're using Org 9.7.

https://github.com/org-roam/org-roam/blob/8667e441876cd2583fbf7282a65796ea149f0e5f/org-roam-db.el#L572

Due to modifications in the Org Element API, the begin property was removed, leading to the aforementioned error.

This is not true. :begin property is still there, but the implementation details of the org-element object structure have changed.

Replacing (org-element-property :begin link)) with (aref (org-element-property :standard-properties link) 0) can resolve this issue.

I advice against using this implementation detail. (org-element-property :begin link)) still works. But you may have to make sure that the inlined functions are re-compiled. After upgrading Org mode, all the users (including org-roam) of Org element API must be re-compiled.

-- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92

cbkerr commented 2 months ago

Just a ping for anyone who pinned to an older version of org, you'll want to update to org 9.7.5 for a security vulnerability fix.

Org-roam from straight.el worked for me after I deleted the straight/build directory to trigger a rebuild of everything.

bff12 commented 2 months ago

I had the same problem but it's because I didn't rebuild all the packages when migrating to emacs-plus 30 on macOS. (package-recompile-all) can help anyone who has the same problem.