Pluto.jl icon indicating copy to clipboard operation
Pluto.jl copied to clipboard

Wrong filepaths of sample notebooks?

Open jamblejoe opened this issue 2 years ago • 2 comments

Opening the first sample notebook on WSL Ubuntu I get

IOError: realpath("/mnt/c/home/goran/.julia/pluto_notebooks/sample Getting started 1.jl"): no such file or directory (ENOENT)
Stacktrace:
  [1] uv_error
    @ ./libuv.jl:97 [inlined]
  [2] realpath(path::String)
    @ Base.Filesystem ./path.jl:477
  [3] open(session::Pluto.ServerSession, path::String; run_async::Bool, compiler_options::Nothing, as_sample::Bool, clear_frontmatter::Bool, notebook_id::Base.UUID)
    @ Pluto.SessionActions ~/.julia/packages/Pluto/rBF1P/src/webserver/SessionActions.jl:61
  [4] (::Pluto.var"#try_launch_notebook_response#315"{Pluto.var"#try_launch_notebook_response#298#316"{Pluto.ServerSession}})(action::typeof(Pluto.SessionActions.open), path_or_url::String; title::String, advice::String, home_url::String, as_redirect::Bool, action_kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol, Symbol}, NamedTuple{(:as_sample, :clear_frontmatter), Tuple{Bool, Bool}}})
    @ Pluto ~/.julia/packages/Pluto/rBF1P/src/webserver/Static.jl:205
  [5] (::Pluto.var"#305#324")(request::HTTP.Messages.Request)
    @ Pluto ~/.julia/packages/Pluto/rBF1P/src/webserver/Static.jl:358
  [6] (::Pluto.var"#293#309"{Bool, Pluto.var"#305#324", Pluto.ServerSession, Pluto.var"#add_set_secret_cookie!#306"{Pluto.ServerSession}})(request::HTTP.Messages.Request)
    @ Pluto ~/.julia/packages/Pluto/rBF1P/src/webserver/Static.jl:165
  [7] (::HTTP.Handlers.Router{typeof(Pluto.default_404), typeof(HTTP.Handlers.default405), Nothing})(req::HTTP.Messages.Request)
    @ HTTP.Handlers ~/.julia/packages/HTTP/4Xalq/src/Handlers.jl:439
  [8] (::Pluto.var"#392#402"{Pluto.ServerSession, HTTP.Handlers.Router{typeof(Pluto.default_404), typeof(HTTP.Handlers.default405), Nothing}})(http::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Connection})
    @ Pluto ~/.julia/packages/Pluto/rBF1P/src/webserver/WebServer.jl:243
  [9] #invokelatest#2
    @ ./essentials.jl:729 [inlined]
 [10] invokelatest
    @ ./essentials.jl:726 [inlined]
 [11] handle_connection(f::Function, c::HTTP.ConnectionPool.Connection, listener::HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, readtimeout::Int64, access_log::Nothing)
    @ HTTP.Servers ~/.julia/packages/HTTP/4Xalq/src/Servers.jl:446
 [12] (::HTTP.Servers.var"#16#17"{Pluto.var"#392#402"{Pluto.ServerSession, HTTP.Handlers.Router{typeof(Pluto.default_404), typeof(HTTP.Handlers.default405), Nothing}}, HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, Set{HTTP.ConnectionPool.Connection}, Int64, Nothing, Base.Semaphore, HTTP.ConnectionPool.Connection})()
    @ HTTP.Servers ./task.jl:484

when I try to edit/run the notebook. Similar for the other notebooks. The files in ./julia/pluto_botebooks are grafik

I am on latest Pluto.jl version (0.19.11) and

julia> versioninfo()
Julia Version 1.8.0
Commit 5544a0fab76 (2022-08-17 13:38 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 48 × AMD Ryzen Threadripper 3960X 24-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, znver2)
  Threads: 1 on 48 virtual cores

jamblejoe avatar Sep 08 '22 09:09 jamblejoe

Thanks! Could you also make a video recording?

Instructions

Thank you for reporting an issue about Pluto! Let's get it fixed!

To report an issue, you need two things:

  1. 📹 A video recording demonstrating the problem. (You can drag a video file into this box)
  2. 📝 A short Pluto notebook file. (Upload the notebook file to https://gist.github.com/ and include the link.)
  3. 🤕 Try to clearly explain what the problem is, it might not be obvious to others! Instead of saying: "This does not work.", try to say: "I expected ..., but instead I am seeing ..."

🙋 But my issue is really simple, I don't want to make a screen recording / notebook!

Please do it anyways! It is really difficult to know exactly what information we will need to solve the issue, and a video recording can save a lot of follow-up questions. Similarly, a notebook file means that we can start testing the problem immediately, saving Pluto's developers a lot of time.


How do I make a video recording?

On Windows, some options:

  • The built-in "Game bar" recorder: https://www.howtogeek.com/706124/how-to-use-windows-10s-built-in-screen-capture-tool/
  • ScreenToGif (Open source, free) https://www.screentogif.com/
  • More options available online

On MacOS: press Cmd+Shift+5, see https://support.apple.com/guide/mac-help/mh26782/mac

On Linux: see some options in https://web.archive.org/web/20211123192630/https://www.linuxuprising.com/2020/01/4-tools-to-record-your-linux-desktop.html

If your video file is too large to upload to github, upload it to youtube and include the link.

fonsp avatar Sep 08 '22 15:09 fonsp

Animation

jamblejoe avatar Sep 08 '22 16:09 jamblejoe

@jamblejoe Are you still having this issue after restarting Pluto?

If so, could you:

  1. Run ~/.julia/pluto_notebooks> ls and copy-paste the text output.
  2. Open one of the sample notebooks, copy-paste the error message.
  3. Run ~/.julia/pluto_notebooks> ls and copy-paste the text output.

fonsp avatar Nov 04 '22 11:11 fonsp

If so, could you:

1. Run `~/.julia/pluto_notebooks> ls` and copy-paste the text output.

2. Open one of the sample notebooks, copy-paste the error message.

3. Run `~/.julia/pluto_notebooks> ls` and copy-paste the text output.

The file is created in ~/.julia/pluto_notebooks, the issue is that mnt/d (or mnt/c in OPs case) is prepended to it for some reason. E.g. real file path is /home/user/.julia/pluto_notebooks/sample Basic mathematics.jl but Pluto tries to open /mnt/d/home/user/.julia/pluto_notebooks/sample Basic mathematics.jl.

Even if i try to open sample notebook directly I still get en error:

Animation2

File paths are damaged by prepending /mnt/d


Pluto v0.19.17 Julia 1.8.3+0.x64.linux.gnu

kryptan avatar Dec 11 '22 20:12 kryptan

Thanks for the comment! It looks like this function

https://github.com/fonsp/Pluto.jl/blob/490e4b265d01850b82334e303d6790718fb08c32/src/notebook/path%20helpers.jl#L27

is converting /home/user/.... into /mnt/d/home/user/...., which should not be happening. (It is already a unix path, not a windows path.)

@pankgeorg Can you fix this?

fonsp avatar Dec 12 '22 11:12 fonsp

sure! @kryptan can you check if you're using WSL 1 or 2? (running wsl.exe -l -v will tell us)

pankgeorg avatar Dec 12 '22 13:12 pankgeorg

WSL 2

  NAME            STATE           VERSION
* Ubuntu-22.04    Running         2

kryptan avatar Dec 13 '22 12:12 kryptan