org-roam icon indicating copy to clipboard operation
org-roam copied to clipboard

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

Open otech-nl opened this issue 2 years ago • 51 comments

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/.

  • Emacs: GNU Emacs 28.2 (build 1, aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build 21A559)) of 2023-02-22
  • Framework: N/A
  • Org: Org mode version 9.7-pre (release_9.6.7-543-g501be3 @ /Users/steets/.emacs.d/straight/build/org/)
  • Org-roam: v2.2.2-42-g5c06471
  • sqlite-connector: sqlite

otech-nl avatar Jul 07 '23 09:07 otech-nl

+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.

  • Emacs: GNU Emacs 28.2 (build 1, aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build 21A559)) of 2023-02-22
  • Framework: N/A
  • Org: Org mode version 9.7-pre (release_N/A-N/A-2e2ed4 @ /Users/me/.emacs.d/elpa/org-9.7pre0.20230707.85843/)
  • Org-roam: 2.2.2- sqlite-connector: sqlite
  :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)
  )

max6166 avatar Jul 08 '23 21:07 max6166

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

otech-nl avatar Jul 09 '23 12:07 otech-nl

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

vderyagin avatar Jul 11 '23 13:07 vderyagin

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

max6166 avatar Jul 11 '23 21:07 max6166

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 [email protected] with:

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

This gets rid of the error for me.

If I understand correctly, straight installs the latest version by default ([email protected]). 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?

otech-nl avatar Jul 12 '23 17:07 otech-nl

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 [email protected] with:

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

This gets rid of the error for me.

If I understand correctly, straight installs the latest version by default ([email protected]). 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 avatar Jul 15 '23 22:07 ifinkelstein

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

Itrekr avatar Jul 23 '23 14:07 Itrekr

+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! :)

jmburgos avatar Jul 24 '23 09:07 jmburgos

+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.

Itrekr avatar Jul 24 '23 09:07 Itrekr

Check my previous reply for configuring straight.el.

otech-nl avatar Jul 24 '23 09:07 otech-nl

@otech-nl, I was trying to follow your instructions. I ran straight-freeze-versions and edited the defaul.el file 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...

jmburgos avatar Jul 24 '23 10:07 jmburgos

@otech-nl, I was trying to follow your instructions. I ran straight-freeze-versions and edited the defaul.el file 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!

otech-nl avatar Jul 24 '23 10:07 otech-nl

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

draxil avatar Jul 24 '23 10:07 draxil

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.

jmburgos avatar Jul 24 '23 10:07 jmburgos

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?

Itrekr avatar Jul 24 '23 12:07 Itrekr

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

(package! org :pin "5890ac")

goofansu avatar Jul 25 '23 08:07 goofansu

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 :-)

dustinfarris avatar Jul 26 '23 04:07 dustinfarris

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

goofansu avatar Jul 26 '23 06:07 goofansu

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.

yantar92 avatar Aug 02 '23 18:08 yantar92

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

yanboyang713 avatar Aug 06 '23 12:08 yanboyang713

@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.

yantar92 avatar Aug 06 '23 13:08 yantar92

Thanks @yantar92 . Working now.

yanboyang713 avatar Aug 06 '23 15:08 yanboyang713

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.

goofansu avatar Aug 08 '23 02:08 goofansu

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

dustinfarris avatar Aug 08 '23 02:08 dustinfarris

@dustinfarris Got it, thank you!

goofansu avatar Aug 08 '23 02:08 goofansu

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

progfolio avatar Aug 08 '23 23:08 progfolio

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

Samoed avatar Aug 09 '23 09:08 Samoed

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

jmburgos avatar Aug 09 '23 12:08 jmburgos

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

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

progfolio avatar Aug 09 '23 12:08 progfolio

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

jmburgos avatar Aug 09 '23 15:08 jmburgos