# Help debugging problem with Pluto notebook

**URL:** <https://discourse.julialang.org/t/help-debugging-problem-with-pluto-notebook/123848>\
**Category:** Pluto\
**Tags:** question\
**Created:** [December 15, 2024, 12:40am UTC](https://discourse.julialang.org/t/help-debugging-problem-with-pluto-notebook/123848 "2024-12-15T00:40:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![adannenberg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adannenberg/32/7869_2.png) [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Post date:** [December 15, 2024, 12:40am UTC](https://discourse.julialang.org/t/help-debugging-problem-with-pluto-notebook/123848/1 "2024-12-15T00:40:51Z")

</div>

Hi. I have a notebook that used to work without problems. I don’t know if my problems stem from my notebook or from a change in Pluto or the other loaded packages. Strangely, the notebook hangs when first launched at 12 of 27 cells and then, if I click on the Pluto icon and then click on the x next to the notebook name and _then_ click again to relaunch, it loads successfully. I haven’t gutted the notebook to create a MWE yet but I hope the info below allows someone to point me in the right direction…

My setup:

```julia
Julia Version 1.11.2
Commit 5e9a32e7af2 (2024-12-01 20:02 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin24.0.0)
  CPU: 10 × Apple M1 Pro
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m1)
Threads: 8 default, 0 interactive, 4 GC (on 8 virtual cores)
Environment:
  JULIA_NUM_THREADS = auto
  JULIA_EDITOR = Visual Studio Code

```

My packages (myFuncs is a local module):

```julia
import Pkg
Pkg.activate()
using Plots, PlutoUI, BenchmarkTools, DataFrames, Dates, Revise, myFuncs

```

Package versions:

```julia
 [6e4b80f9] BenchmarkTools v1.5.0
 [a93c6f00] DataFrames v1.7.0
 [91a5bcdd] Plots v1.40.9
 [c3e4b0f8] Pluto v0.20.3
 [7f904dfe] PlutoUI v0.7.60
 [295af30f] Revise v3.6.4
 [ade2ca70] Dates v1.11.0

```

The error I get:

```julia
julia> using Pluto; Pluto.run()
[ Info: Loading...
┌ Info:
└ Opening http://localhost:1234/?secret=iK4OPKpS in your default browser... ~ have fun!
┌ Info:
│ Press Ctrl+C in this terminal to stop Pluto
└
schedule: Task not runnable
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] enq_work(t::Task)
    @ Base ./task.jl:792
  [3] schedule
    @ ./task.jl:833 [inlined]
  [4] get_workspace(session_notebook::Tuple{Pluto.ServerSession, Pluto.Notebook}; allow_creation::Bool)
    @ Pluto.WorkspaceManager ~/.julia/packages/Pluto/esC4R/src/evaluation/WorkspaceManager.jl:342
  [5] get_workspace
    @ ~/.julia/packages/Pluto/esC4R/src/evaluation/WorkspaceManager.jl:326 [inlined]
  [6] bump_workspace_module(session_notebook::Tuple{Pluto.ServerSession, Pluto.Notebook})
    @ Pluto.WorkspaceManager ~/.julia/packages/Pluto/esC4R/src/evaluation/WorkspaceManager.jl:252
  [7] run_reactive_core!(session::Pluto.ServerSession, notebook::Pluto.Notebook, old_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, new_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, roots::Vector{Pluto.Cell}; save::Bool, deletion_hook::typeof(Pluto.WorkspaceManager.move_vars), user_requested_run::Bool, already_run::Vector{Pluto.Cell}, bond_value_pairs::Base.Iterators.Zip{Tuple{Vector{Symbol}, Vector{Any}}})
    @ Pluto ~/.julia/packages/Pluto/esC4R/src/evaluation/Run.jl:58
  [8] (::Pluto.var"#240#246"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook})()
    @ Pluto ~/.julia/packages/Pluto/esC4R/src/evaluation/Run.jl:481
  [9] withtoken(f::Pluto.var"#240#246"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook}, token::Pluto.Token)
    @ Pluto ~/.julia/packages/Pluto/esC4R/src/evaluation/Tokens.jl:19
 [10] #239
    @ ~/.julia/packages/Pluto/esC4R/src/evaluation/Run.jl:457 [inlined]
 [11] (::Pluto.var"#231#232"{Pluto.var"#239#245"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook}})()
    @ Pluto ~/.julia/packages/Pluto/esC4R/src/evaluation/Tokens.jl:58

```

Thoughts?

---

<div class="post-metadata">

**Author:** ![g-gundam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/g-gundam/32/47593_2.png) [@g-gundam](https://discourse.julialang.org/u/g-gundam)\
**Post date:** [December 15, 2024, 1:30am UTC](https://discourse.julialang.org/t/help-debugging-problem-with-pluto-notebook/123848/2 "2024-12-15T01:30:09Z")

</div>

Did you create a task and schedule it somewhere in the notebook? If a task that’s already done gets scheduled again somehow, you might get `Task not runnable`. Just a guess. It’s hard to say without seeing more code.

---

<div class="post-metadata">

**Author:** ![adannenberg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adannenberg/32/7869_2.png) [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Post date:** [December 15, 2024, 1:52am UTC](https://discourse.julialang.org/t/help-debugging-problem-with-pluto-notebook/123848/3 "2024-12-15T01:52:34Z")

</div>

I didn’t create and schedule a task…

And I understand that it’s really not possible to diagnose w/o seeing the notebook if it’s not an obvious problem. I was hoping that someone more knowledgeable might be able to glean more from the error message than I have.

---

<div class="post-metadata">

**Author:** ![rashid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rashid/32/9398_2.png) [@rashid](https://discourse.julialang.org/u/rashid)\
**Post date:** [December 17, 2024, 6:31am UTC](https://discourse.julialang.org/t/help-debugging-problem-with-pluto-notebook/123848/4 "2024-12-17T06:31:53Z")

</div>

Were you able to fix this issue? I am also facing this issue for some days now. It started appearing after I updated to julia 1.11.2, but I havent been able to fix this by going back to 1.11.1 or even 1.10.7. Also I tried different versions of Pluto itself which also did not fix this issue.

I’m not sure whether this is related but I have only faced this with a notebook where I turn off Pluto Pkg management using the cell:

```julia
let
    using Pkg
    Pkg.activate(Base.current_project())
    Pkg.status()
end

```

Other details:

The error:

```julia
schedule: Task not runnable
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] enq_work(t::Task)
    @ Base ./task.jl:792
  [3] schedule
    @ ./task.jl:833 [inlined]
  [4] #get_workspace#13
    @ ~/.julia/packages/Pluto/esC4R/src/evaluation/WorkspaceManager.jl:342
  [5] get_workspace
    @ ~/.julia/packages/Pluto/esC4R/src/evaluation/WorkspaceManager.jl:326 [inlined]
  [6] bump_workspace_module
    @ ~/.julia/packages/Pluto/esC4R/src/evaluation/WorkspaceManager.jl:252
  [7] run_reactive_core!(session::Pluto.ServerSession, notebook::Pluto.Notebook, old_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, new_topology::PlutoDependencyExplore
r.NotebookTopology{Pluto.Cell}, roots::Vector{Pluto.Cell}; save::Bool, deletion_hook::typeof(Pluto.WorkspaceManager.move_vars), user_requested_run::Bool, already_run::Vector{Pluto.Cell}
, bond_value_pairs::Base.Iterators.Zip{Tuple{Vector{Symbol}, Vector{Any}}})
    @ Pluto ~/.julia/packages/Pluto/esC4R/src/evaluation/Run.jl:58
  [8] (::Pluto.var"#240#246"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook})()
    @ Pluto ~/.julia/packages/Pluto/esC4R/src/evaluation/Run.jl:481
  [9] withtoken(f::Pluto.var"#240#246"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook}, token::Pluto.Token)
    @ Pluto ~/.julia/packages/Pluto/esC4R/src/evaluation/Tokens.jl:19
 [10] #239
    @ ~/.julia/packages/Pluto/esC4R/src/evaluation/Run.jl:457 [inlined]
 [11] (::Pluto.var"#231#232"{Pluto.var"#239#245"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook}})()
    @ Pluto ~/.julia/packages/Pluto/esC4R/src/evaluation/Tokens.jl:58

```

Versions:

```julia
julia> versioninfo()
Julia Version 1.11.2
Commit 5e9a32e7af2 (2024-12-01 20:02 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 24 × Intel(R) Xeon(R) W-3235 CPU @ 3.30GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, cascadelake)
Threads: 16 default, 0 interactive, 8 GC (on 24 virtual cores)
Environment:
  LD_LIBRARY_PATH = /apps/rashid/Apps/mambaforge/lib:
  JULIA_NUM_THREADS = 16
  JULIA_PKG_DEVDIR = /apps/rashid/MyGitProjects
  JULIA_NUM_PRECOMPILE_TASKS = 6

(@v1.11) pkg> status Pluto
Status `~/.julia/environments/v1.11/Project.toml`
  [c3e4b0f8] Pluto v0.20.3

```

---

<div class="post-metadata">

**Author:** ![rashid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rashid/32/9398_2.png) [@rashid](https://discourse.julialang.org/u/rashid)\
**Post date:** [December 17, 2024, 8:51am UTC](https://discourse.julialang.org/t/help-debugging-problem-with-pluto-notebook/123848/5 "2024-12-17T08:51:21Z")

</div>

Issue created here: [Error when opening notebook file: `schedule: Task not runnable` · Issue #3114 · fonsp/Pluto.jl · GitHub](https://github.com/fonsp/Pluto.jl/issues/3114)

---

<div class="post-metadata">

**Author:** ![adannenberg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adannenberg/32/7869_2.png) [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Post date:** [December 17, 2024, 10:48am UTC](https://discourse.julialang.org/t/help-debugging-problem-with-pluto-notebook/123848/6 "2024-12-17T10:48:17Z")

</div>

I was not able to fix it. No idea how to proceed :\<

---

<div class="post-metadata">

**Author:** ![rashid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rashid/32/9398_2.png) [@rashid](https://discourse.julialang.org/u/rashid)\
**Post date:** [December 17, 2024, 11:06am UTC](https://discourse.julialang.org/t/help-debugging-problem-with-pluto-notebook/123848/7 "2024-12-17T11:06:29Z")

</div>

Were you also turning off Pluto Pkg management by doing `Pkg.activate` like what I am doing?

---

<div class="post-metadata">

**Author:** ![adannenberg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adannenberg/32/7869_2.png) [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Post date:** [December 17, 2024, 11:29am UTC](https://discourse.julialang.org/t/help-debugging-problem-with-pluto-notebook/123848/8 "2024-12-17T11:29:57Z")

</div>

yes. i’m investigating the (very ugly) alternative of simply adding another giant cell containing all the functions in my local module, and then using pluto package management as usual. i hate to do that for all the obvious reasons, but it may isolate the problem and make the notebook work.

---

<div class="post-metadata">

**Author:** ![adannenberg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adannenberg/32/7869_2.png) [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Post date:** [December 17, 2024, 12:31pm UTC](https://discourse.julialang.org/t/help-debugging-problem-with-pluto-notebook/123848/9 "2024-12-17T12:31:46Z")

</div>

Ok, here’s the ugly fix that worked for me: Create a `yourModuleNameFunctions.jl` file with the contents of your local module or package, i.e. make `yourModuleNameFunctions.jl` look like this

```julia
#=
module yourModuleName

using thePackagesYourModuleNeeds

export yourFunction1, yourFunction2, ...
=#
function yourFunction1(...
...
end
...
#end # of yourModuleName

```

Now get rid of the `Pkg.activate` statement and add whatever packages you’ve commented out to the `using` statement in your Pluto notebook and (on a following line) do `import("yourModuleNameFunctions.jl")`

That’s it. Works for me. Please let me know if it fixes your issue also, as that makes it more likely that it’s a generally useful kludge 😃

---

<div class="post-metadata">

**Author:** ![rashid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rashid/32/9398_2.png) [@rashid](https://discourse.julialang.org/u/rashid)\
**Post date:** [December 17, 2024, 1:23pm UTC](https://discourse.julialang.org/t/help-debugging-problem-with-pluto-notebook/123848/10 "2024-12-17T13:23:01Z")

</div>

Nice workaround. But I actually can’t get rid of `Pkg.activate` as I am using several locally developing packages which are `dev`ed in my local project.

Hopefully this will get fixed soon if some Pluto developer takes a look at the issue I have created in github.

---

<div class="post-metadata">

**Author:** ![adannenberg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adannenberg/32/7869_2.png) [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Post date:** [December 19, 2024, 2:58am UTC](https://discourse.julialang.org/t/help-debugging-problem-with-pluto-notebook/123848/11 "2024-12-19T02:58:11Z")

</div>

if the problem persists then you could always import _each_ of your locally dev’d packages as per the workaround above. ugly and not generic, but the notebook would work fine.

also, it’s trivial but perhaps still worth noting that, in order to make it easy to recover once the issue is fixed properly, what i do is just take the usual cell

```julia
begin
    using Pkg
    Pkg.activate(Base.current_project())
    Pkg.status()
end

```

and comment it out

```julia
begin
    #=
    using Pkg
    Pkg.activate(Base.current_project())
    Pkg.status()
    =#
end

```

and add a new cell

```julia
begin
    using PkgName1, PkgName2, ...
    import("current_project_functions.jl")
end

```

that way i can go back and forth between the proper way and the kludge with minimal editing.
