PumasAI / QuartoNotebookRunner.jl

MIT License
61 stars 8 forks source link

ERROR: Cell attributes must be a dictionary. #170

Closed felixcremer closed 1 month ago

felixcremer commented 1 month ago

I am trying to preview a quarto notebook which used to work before, but now I get the following error. I suspect that I wronly formatted something, but it would be nice, if I could get an indicator where to look for my mistake.

This is the error I got and attached is the quarto file that throws the error. Renamed to a .txt because of githubs upload filter.

ERROR: Julia server returned error after receiving "run" command:
Failed to run notebook: /home/fcremer/Documents/PyramidScheme/docs/juliacon.qmd
ERROR: Cell attributes must be a dictionary.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] extract_cell_options(source::String; file::String, line::Int64)
    @ QuartoNotebookRunner ~/.julia/packages/QuartoNotebookRunner/Mx5PG/src/server.jl:824
  [3] extract_cell_options
    @ ~/.julia/packages/QuartoNotebookRunner/Mx5PG/src/server.jl:797 [inlined]
  [4] raw_markdown_chunks(path::String)
    @ QuartoNotebookRunner ~/.julia/packages/QuartoNotebookRunner/Mx5PG/src/server.jl:320
  [5] raw_text_chunks
    @ ~/.julia/packages/QuartoNotebookRunner/Mx5PG/src/server.jl:276 [inlined]
  [6] QuartoNotebookRunner.File(path::String, options::Dict{String, Any})
    @ QuartoNotebookRunner ~/.julia/packages/QuartoNotebookRunner/Mx5PG/src/server.jl:19
  [7] (::QuartoNotebookRunner.var"#35#38"{Bool, Dict{String, Any}, Server, String})()
    @ QuartoNotebookRunner ~/.julia/packages/QuartoNotebookRunner/Mx5PG/src/server.jl:977
  [8] lock(f::QuartoNotebookRunner.var"#35#38"{Bool, Dict{String, Any}, Server, String}, l::ReentrantLock)
    @ Base ./lock.jl:229
  [9] borrow_file!(f::QuartoNotebookRunner.var"#26#30"{Nothing, Bool, Dict{String, Any}, QuartoNotebookRunner.var"#chunk_callback#61"{TCPSocket}, Server}, server::Server, path::String; optionally_create::Bool, options::Dict{String, Any})
    @ QuartoNotebookRunner ~/.julia/packages/QuartoNotebookRunner/Mx5PG/src/server.jl:970
 [10] borrow_file!
    @ ~/.julia/packages/QuartoNotebookRunner/Mx5PG/src/server.jl:961 [inlined]
 [11] #run!#25
    @ ~/.julia/packages/QuartoNotebookRunner/Mx5PG/src/server.jl:930 [inlined]
 [12] _handle_response(socket::TCPSocket, notebooks::Server, request::@NamedTuple{type::String, content::Union{Dict{String, Any}, String}}, showprogress::Bool)
    @ QuartoNotebookRunner ~/.julia/packages/QuartoNotebookRunner/Mx5PG/src/socket.jl:270
 [13] (::QuartoNotebookRunner.var"#53#60"{Bool, Base.RefValue{Bool}, Server, Base.UUID})()
    @ QuartoNotebookRunner ~/.julia/packages/QuartoNotebookRunner/Mx5PG/src/socket.jl:199
ERROR: Internal julia server error

Stack trace:
    at writeJuliaCommand (file:///opt/quarto/bin/quarto.js:41572:19)
    at eventLoopTick (ext:core/01_core.js:153:7)
    at async executeJulia (file:///opt/quarto/bin/quarto.js:41481:22)
    at async Object.execute (file:///opt/quarto/bin/quarto.js:41261:20)
    at async renderExecute (file:///opt/quarto/bin/quarto.js:77765:27)
    at async renderFileInternal (file:///opt/quarto/bin/quarto.js:77933:43)
    at async renderFiles (file:///opt/quarto/bin/quarto.js:77801:17)
    at async render (file:///opt/quarto/bin/quarto.js:82629:21)
    at async renderForPreview (file:///opt/quarto/bin/quarto.js:83655:26)
    at async render (file:///opt/quarto/bin/quarto.js:83538:29)

juliacon.txt

MichaelHatherly commented 1 month ago

Perhaps line 130,

#| eval:false

The missing space between : and false might be a problem for the YAML parser perhaps.

I am trying to preview a quarto notebook which used to work before

Which version did this notebook work fine on, and which version are you on now?

felixcremer commented 1 month ago

Thanks, yes, that was the line that made problems. I don't know whether it was the exact version that worked or whether I introduced the formatting error somehow between the successful and failing run.

The failing run was on QuartoNotebookRunner 0.9.0.