Doom-emacs: [BUG] Ob-async does not work.

Created on 4 Nov 2019  ·  25Comments  ·  Source: hlissner/doom-emacs

the bug output
error in process sentinel: Cannot open load file: No such file or directory, org-version.el
see issues
if you clean uprm -rf ~/.emacs.d/.local/straight/build/org-plus-contrib/*.elc. it's working.
But, we got new problem, the emacs can not find org version. similar like this issues.

:lang org bug resolved

Most helpful comment

Nice! It works! 💯

All 25 comments

We have this hack in place to prevent this issue. I cannot reproduce it. Please include your M-x doom/info and steps to reproduce it.

Also, ob-async is already installed by Doom. You do not need to install or configure it yourself.

Also, ob-async is already installed by Doom. You do not need to install or configure it yourself.

I knew, Ob-async included in org feature. I just added (use-package! ob-async) in my config file. if you do not configure this. the ob async does not work.

We have this hack in place to prevent this issue. I cannot reproduce it. Please include your M-x doom/info and steps to reproduce it.

emacs   version    26.3
        features   NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS
        build      Sep 02, 2019
        buildopts  (--with-ns '--enable-locallisppath=/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules)
        windowsys  ns
        daemonp    server-running
doom    version    2.0.9
        build      HEAD -> develop, origin/develop, origin/HEAD 04a2cb94c 2019-11-02 23:34:34 -0800
system  type       darwin
        config     x86_64-apple-darwin18.2.0
        shell      /bin/zsh
        uname      Darwin 19.0.0 Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64 x86_64
        path       (~/.poetry/bin/ /usr/local/opt/texinfo/bin/ /usr/local/opt/nss/bin/ ~/anaconda3/bin/ /usr/local/opt/imagemagick@6/bin/ ~/.cargo/bin/ /usr/local/bin/ /usr/local/opt/texinfo/bin/ /usr/bin/ /bin/ /usr/sbin/ /sbin/ /Applications/VMware Fusion.app/Contents/Public/ /Library/TeX/texbin/ /usr/local/MacGPG2/bin/ /opt/X11/bin/ /Applications/Wireshark.app/Contents/MacOS/ /usr/local/opt/ ~/go/bin/ /Applications/Emacs.app/Contents/MacOS/libexec/)
config  envfile    envvar-file
        elc-files  0
        modules    (:input chinese :completion company helm ivy :ui doom doom-dashboard doom-quit hl-todo modeline nav-flash ophints (popup +all +defaults) treemacs vc-gutter vi-tilde-fringe window-select workspaces :editor file-templates fold rotate-text snippets :emacs dired electric ibuffer vc :tools (eval +overlay) flycheck (lookup +docsets) lsp magit :lang cc common-lisp data emacs-lisp ess go (haskell +intero) julia latex markdown nix (org +dragndrop +hugo +ipython +pandoc +present) python sh :app (rss +org) :config (default +smartparens) :private spacemacs-default)
        packages   (n/a)
        elpa       (n/a)

that will help you easy test : Org-src:

+BEGIN_SRC sh :async

sleep 4s && echo 'done'

+END_SRC

+RESULTS:

: done

make sure results has output async task ID : 569af356b1428415f897587c8a351308
if you get issue that not find org-version.el
try run this:

+BEGIN_SRC sh

rm -rf ~/.emacs.d/.local/straight/build/org-plus-contrib/*.elc

+END_SRC

Ah, I can reproduce it. Try this and see if it resolves the issue:

(add-hook! 'ob-async-pre-execute-src-block-hook
           (load (expand-file-name "init.el" user-emacs-directory)))

thanks, it's solved the issue. but if the user place initialization logic in ob-async-pre-execute-src-block-hook, which runs before execution of every src block. such as Julia:
(add-hook 'ob-async-pre-execute-src-block-hook '(lambda () (setq inferior-julia-program-name "/nix/store/qzpr1kwkhnz55mdlq8skc5sqrc6l2j2b-system-path/bin/julia") ))

added your config
`ob-async.el.

Value ((lambda nil (setq inferior-julia-program-name "/nix/store/qzpr1kwkhnz55mdlq8skc5sqrc6l2j2b-system-path/bin/julia")) (lambda (&rest _) (load (expand-file-name "init.el" user-emacs-directory))))

new issue.
error in process sentinel: async-handle-result: Cannot open load file: No such file or directory, ob-julia error in process sentinel: Cannot open load file: No such file or directory, ob-julia
So, how to write a config which can be load of both no error.

How about:

(defadvice! +org-init-doom-during-async-executation-a (orig-fn &rest args)
    :around #'ob-async-org-babel-execute-src-block
    (let ((ob-async-pre-execute-src-block-hook
           (cons (lambda () (load (expand-file-name "init.el" user-emacs-directory)))
                 ob-async-pre-execute-src-block-hook)))
      (apply orig-fn args)))

This should ensure that our hook is always first.

(defadvice! +org-init-doom-during-async-executation-a (orig-fn &rest args)
    :around #'ob-async-org-babel-execute-src-block
    (let ((ob-async-pre-execute-src-block-hook
           (cons (lambda () (load (expand-file-name "init.el" user-emacs-directory)))
                 ob-async-pre-execute-src-block-hook)))
      (apply orig-fn args)))

error in process sentinel: async-handle-result: Cannot open load file: No such file or directory, org error in process sentinel: Cannot open load file: No such file or directory, org

debug info :


Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory" "org")
signal(file-missing ("Cannot open load file" "No such file or directory" "org"))
async-handle-result((lambda (result) (with-current-buffer # (let ((default-directory "/home/gtrun/project/my-code/my-julia/")) (save-excursion (cond ((member "none" ...) (message "result silenced")) ((member "silent" ...) (message ...)) (t (goto-char #) (let ... ... ... ...))) (run-hooks (quote org-babel-after-execute-hook)))))) (async-signal (file-missing "Cannot open load file" "No such file or directory" "org")) #)
async-when-done(# "finishedn")

Those errors don't seem related, but try this:

(defadvice! +org-init-doom-during-async-executation-a (orig-fn &rest args)
    :around #'ob-async-org-babel-execute-src-block
    (let ((ob-async-pre-execute-src-block-hook
           ;; Ensure our hook is always first
           (cons `(lambda ()
                    (load ,doom-autoload-file)
                    (load ,doom-package-autoload-file))
                 ob-async-pre-execute-src-block-hook)))
      (apply orig-fn args)))

Those errors don't seem related, but try this:

(defadvice! +org-init-doom-during-async-executation-a (orig-fn &rest args)
    :around #'ob-async-org-babel-execute-src-block
    (let ((ob-async-pre-execute-src-block-hook
           ;; Ensure our hook is always first
           (cons `(lambda ()
                    (load ,doom-autoload-file)
                    (load ,doom-package-autoload-file))
                 ob-async-pre-execute-src-block-hook)))
      (apply orig-fn args)))

error in process sentinel: async-handle-result: Symbol’s function definition is void: after! error in process sentinel: Symbol’s function definition is void: after!

I cannot reproduce these new errors, but try this:

(defadvice! +org-init-doom-during-async-executation-a (orig-fn &rest args)
    :around #'ob-async-org-babel-execute-src-block
    (let ((ob-async-pre-execute-src-block-hook
           ;; Ensure our hook is always first
           (cons `(lambda ()
                    (load ,(expand-file-name "init.el" doom-emacs-dir)))
                 ob-async-pre-execute-src-block-hook)))
      (apply orig-fn args)))

If possible, can you hop on our discord? I don't want to spam here.

Is this issue solved? I have the latest version of doom as 11/19/2019 20:30 PDT. But I still have missing org-version.el file.

Is this issue solved? I have the latest version of doom as 11/19/2019 20:30 PDT. But I still have missing org-version.el file.

~Sure, No any issue appears in my config with lastest doom-version. You only need one config to your doom. for async~
~(use-package! 'ob-async)~
No longer in my config
tested on darwin and nixos

emacs   version    26.3
        features   NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS
        build      Sep 02, 2019
        buildopts  (--with-ns '--enable-locallisppath=/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules)
        windowsys  ns
        daemonp    server-running
doom    version    2.0.9
        build      HEAD -> develop, origin/develop, origin/HEAD ff179b080 2019-11-18 18:13:59 -0800
system  type       darwin
        config     x86_64-apple-darwin18.2.0
        shell      /bin/zsh
        uname      Darwin 19.0.0 Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64 x86_64
        path       (~/.poetry/bin/ ~/.cargo/bin/ /usr/local/bin/ /usr/bin/ /bin/ /usr/sbin/ /sbin/ /Applications/VMware Fusion.app/Contents/Public/ /Library/TeX/texbin/ /usr/local/MacGPG2/bin/ /usr/local/share/dotnet/ /opt/X11/bin/ ~/.dotnet/tools/ /Applications/Wireshark.app/Contents/MacOS/ ~/.poetry/bin/ /usr/local/opt/texinfo/bin/ /usr/local/opt/nss/bin/ ~/anaconda3/bin/ /usr/local/opt/imagemagick@6/bin/ ~/.cargo/bin/ /usr/local/opt/ ~/go/bin/ /Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_14/ /Applications/Emacs.app/Contents/MacOS/libexec-x86_64-10_14/ /Applications/Emacs.app/Contents/MacOS/libexec/)
config  envfile    envvar-file
        elc-files  0
        modules    (:input chinese :completion company helm ivy :ui doom doom-dashboard doom-quit hl-todo indent-guides modeline nav-flash ophints (popup +all +defaults) treemacs vc-gutter vi-tilde-fringe window-select workspaces :editor file-templates fold rotate-text snippets :emacs dired electric ibuffer vc :term eshell :tools (eval +overlay) flycheck (lookup +docsets) lsp magit pass upload :lang cc common-lisp data emacs-lisp ess go (haskell +intero) julia latex markdown nix (org +dragndrop +hugo +ipython +pandoc +present) python scheme sh :app (rss +org) :config (default +smartparens) :private spacemacs-default my-org my-code)
        packages   (n/a)
        elpa       (n/a)

I can no longer reproduce the issue. @ztlevi Try doom build.

(use-package! 'ob-async)

Don't do this. It is unnecessary and loads all of org. ob-async will be automatically loaded if your src block has a non-nil :async property.

I still get the error.

error in process sentinel: async-handle-result: Cannot open load file: No such file or directory, org-version.el
error in process sentinel: Cannot open load file: No such file or directory, org-version.el

I am using org-wild-notifier. Can you please try this package and enable it M-x org-wild-notifier-mode

(package! org-wild-notifier)
(use-package! org-wild-notifier
  :defer t
  :init
  (add-hook 'doom-post-init-hook #'org-wild-notifier-mode t)
  :config
  (setq org-wild-notifier-alert-time 15
        alert-default-style (if IS-MAC 'osx-notifier 'libnotify)))

@ztlevi

  1. Added (package! org-wild-notifier) to ~/.doom.d/packages.el
  2. Added your use-package! block to ~/.doom.d/config.el
  3. doom refresh
  4. Restart Emacs
  5. Opened an org file and executed

    #+BEGIN_SRC sh :async t
    sleep 2
    echo 25
    #+END_SRC
    

Ran without issue. Ran it multiple times, even.

Currently on 24efd5b90 with Emacs 26.3.

Side-note: doom-post-init-hook doesn't exist anymore. It was replaced with doom-after-init-modules-hook some time ago, so org-wild-notifier isn't even loading.

What about you trigger it manually? Did you get the error?

Side-note: doom-post-init-hook doesn't exist anymore. It was replaced with doom-after-init-modules-hook some time ago, so org-wild-notifier isn't even loading.

this issue not about org-babel-async. I tried to download the org-wild-notifier. also got the same error report.

Agh. I see it. It's the way org-wild-notifier scrapes your org agenda files. It uses async much like ob-async does, except unlike ob-async, it doesn't provide us a way to inject Doom's state before it runs.

This is non-trivial to fix from Doom's side. I suggest using org-alert instead (or org-notify, included with org-plus-contrib).

Emm, org-alert doesn't really work. While org-notify does pop notification but it repeats the notification every two minutes which is very annoying.

Is this possible to fix it from org-wild-notifier-mode? If so, I would like to open a issue

As of 30f72da I've employed a new solution to this and the ob-async problem, which should resolve your issue with org-wild-notifier-mode. Let me know if that isn't the case.

(You'll need to doom build after doom upgrade for this to fully work, unless the org package gets updated)

Nice! It works! 💯

Was this page helpful?
0 / 5 - 0 ratings