Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when opening notebook file: schedule: Task not runnable #3114

Closed
rashidrafeek opened this issue Dec 17, 2024 · 10 comments · Fixed by #3119
Closed

Error when opening notebook file: schedule: Task not runnable #3114

rashidrafeek opened this issue Dec 17, 2024 · 10 comments · Fixed by #3119
Labels
bug Something isn't working package manager Pluto's built-in package manager

Comments

@rashidrafeek
Copy link

rashidrafeek commented Dec 17, 2024

Recently I have started getting the following error while trying to open a notebook:

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.NotebookT
opology{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_p
airs::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

If I go back to the Pluto main page, press "x" to stop the notebook and press play button from there to run it, then it runs fine. For me the following notebook is enough to reproduce the issue,

### A Pluto.jl notebook ###
# v0.20.3

using Markdown
using InteractiveUtils

# ╔═╡ 477dd47c-e81c-4564-9bc5-0894e29e08e4
let
    using Pkg
    Pkg.activate(Base.current_project())
    Pkg.status()
end

# ╔═╡ Cell order:
# ╠═477dd47c-e81c-4564-9bc5-0894e29e08e4

However, I have observed that it does not error everytime and does run sometimes. I have only observed it when I switch off Pluto Pkg management specifically using a cell with:

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

and have not observed when Pluto Pkg management is on. But I'm not sure whether they are related. A recording of the issue:

plutopkgissue2.mp4

This was also reported by another user in discourse here.

Other details:

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
@rossviljoen
Copy link

I'm seeing the same issue, also only when using Pkg.activate(Base.current_project())

@ujimushi
Copy link

Please try running (@v1.11) pkg> add Pkg in package mode before running Pluto.run().

However, in the code presented, Base.current_project() is nothing, so I think it will result in an error anyway.

Try Pkg.activate() or Pkg.activate("your_project_path").

@rashidrafeek
Copy link
Author

However, in the code presented, Base.current_project() is nothing, so I think it will result in an error anyway.

Base.current_project() will return the project path based on where the code is running from or if it is not running in a project then it will return nothing. In my case I am running the code from inside a project. Even if it returns nothing, the code is not even running to give that error. As you can see, the error is in the terminal and not in the notebook.

@bertrandkerres
Copy link

I'm seeing the same issue since a few days, also using current_project() as environment.

In addition to @rashidrafeek 's comment,

If I go back to the Pluto main page, press "x" to stop the notebook and press play button from there to run it, then it runs fine.

I can add that stopping Pluto and exiting Julia (i.e. Ctrl+C, exit()) and then starting a new Julia session also makes the notebook run in my case.

@fonsp fonsp added bug Something isn't working package manager Pluto's built-in package manager labels Dec 18, 2024
@fonsp
Copy link
Owner

fonsp commented Dec 18, 2024

Thanks for the report! Does this also happen on older Pluto versions? Or old Julia versions (Julia 1.10) with the latest Pluto version?

@isboonto
Copy link

Thanks for the report! Does this also happen on older Pluto versions? Or old Julia versions (Julia 1.10) with the latest Pluto version?

I have the problem with Julia 1.10 as well.

@adannenberg
Copy link

adannenberg commented Dec 18, 2024

fwiw, see here for an ugly workaround until the issue is fixed

also, i chose to post on discourse rather than github for this issue. was that a poor choice? is it generally ok to post requests for help with error messages that may or may not be package-related to github? i guess @rashidrafeek 's MWE makes it fair game...

@bertrandkerres
Copy link

Thanks for the report! Does this also happen on older Pluto versions? Or old Julia versions (Julia 1.10) with the latest Pluto version?

I made a fresh environment with Julia 1.11, Pluto 0.19.47 and the MWE from above and could create the issue, but unfortunately not consistently reproduce it.

When the issue occurred, I had another Julia/Pluto process running at the same time. But I'm also having trouble to reproduce the issue with 2 processes :-/.

julia> versioninfo()
Julia Version 1.11.1
Commit 8f5b7ca12ad (2024-10-16 10:53 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 28 × Intel(R) Core(TM) i7-14700KF
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, alderlake)
Threads: 1 default, 0 interactive, 1 GC (on 28 virtual cores)
Environment:
  JULIA_PKG_SERVER = juliahub.com

(julia-test) pkg> st
Status `~/source/julia-test/Project.toml`
⌃ [c3e4b0f8] Pluto v0.19.47

@fonsp
Copy link
Owner

fonsp commented Dec 20, 2024

Should be fixed by Pluto 0.20.4! Otherwise let me know!

@rashidrafeek
Copy link
Author

Thanks for the quick fix. Upgrading fixed the the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working package manager Pluto's built-in package manager
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants