I have this weird error I don't understand :

#+begin_src plantuml :file img/example-uml.png
class Example {
- value : Integer
- other : Double
+ up()
+ down()

This fails with a wrong type argument : char-or-string-p, nil. It seems to be a problem with the :file header arg as using other nonsensical values such as :file 1 outputs wrong type argument stringp, 1. And :file "example.png" outputs wrong type argument : char-or-string-p, nil as well. If I remove it, the block complains it has to have a :file argument.

This is the relevant defun in ob-plantuml. But it never uses char-or-string-p to validate the arguments. So maybe it's something with the org block ?

I'll add that I have org-plantuml-jar-path set properly and that the creation of the image does work in plantuml-mode, which is all the more frustrating.

I use emacs 27.1 and org-mode version 9.3.

Can someone help me ?


Edit : added the backtrace

Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
  org-babel-execute:plantuml("@startuml\nclass Example {\n- value : Integer\n- othe..." ((:colname-names) (:rowname-names) (:result-params "replace" "file") (:result-type . value) (:results . "replace file") (:exports . "results") (:session . "none") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:file . "img/example-uml.png")))
  org-babel-execute-src-block(nil ("plantuml" "@startuml\nclass Example {\n- value : Integer\n- othe..." ((:colname-names) (:rowname-names) (:result-params "file" "replace") (:result-type . value) (:results . "file replace") (:exports . "results") (:file . "img/example-uml.png") (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no") (:session . "none")) "" nil 4196 "(ref:%s)"))
  funcall-interactively(org-ctrl-c-ctrl-c nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
  • 1
    That error message can come from many places. The best thing to do is to M-x toggle-debug-on-error, repeat the evaluation of the block and post the backtrace that you get. That wil pinpoint the problem much better.
    – NickD
    Feb 3, 2021 at 13:00
  • FWIW, when I evaluate the block with this header: :file example.png, everythng works.
    – NickD
    Feb 3, 2021 at 13:03
  • Do you have plantuml installed? That's so weird Feb 3, 2021 at 13:08
  • Of course I have plantuml installed, otherwise the evaluation would fail.
    – NickD
    Feb 3, 2021 at 13:09
  • Sure, I don't understand why it'd fail on my install. I'll debug soon. Feb 3, 2021 at 13:12

1 Answer 1


Updating org-mode from 9.3 to 9.4.4 has fixed the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.