imsnif / monocle

A Zellij plugin to fuzzy find file names and contents in style 🧐
MIT License
138 stars 9 forks source link

Monocle plugin crash zellij #10

Open 0inp opened 1 year ago

0inp commented 1 year ago

I just upgrade to monocle version 0.39, and invoking the plugin result in crashing zellij with the message Received empty message from server

I'm using zellij version 0.39.1

imsnif commented 1 year ago

Sorry for the experience! Could you please attach some logs?

There is a known issue about device files as mentioned in the readme - could this be related?

0inp commented 1 year ago

Hey ! Thanks for returning back to me ! I'd like to help ! Here's the part of the log file where I launch zellij and the monocle plugin: zellij.log

More information on my system:

➜ uname -av                                                                                                                                                                                                                       
Darwin MacBook-Air-de-Pascal.local 21.6.0 Darwin Kernel Version 21.6.0: Wed Oct  4 23:55:28 PDT 2023; root:xnu-8020.240.18.704.15~1/RELEASE_X86_64 x86_64
➜ alacritty -V                                                                                                                                                                                                                       
alacritty 0.12.3 (5efb069)
➜ zellij -V
zellij 0.39.1

Please don't hesitate if you want more info from me or if I can open a PR.

imsnif commented 1 year ago

Hum... not a lot of information there unfortunately. Could you share a bit how you loaded the plugin? What are the steps you did? Which folder did you start it in?

0inp commented 1 year ago

Here are the steps: 1 - Open Alacritty in the root ~ directory 2 - Ensure that there are no sessions with zellij kill-all-sessions and zellij delete-all-sessions 3 - Invoke zellij command 4 - Invoke the monocle plugin command (with one of the zellij plugin commands in the README or with the F1 keybind as stated in the README as well

imsnif commented 1 year ago

My suspicion is that this happens because of a certain file type we're not reading properly (the "known issue" in the README). Do you have device files in your home folder? Could you maybe try a few different folders (specifically with the F1 or Alt m keybinding) and see if it happens everywhere?

0inp commented 1 year ago

Yes, this happens in every directories (for example inside my dotfiles directory, in the section related to zellij, with only the config.kdl and other files in layouts, plugins and themes directories cf:

symlinks/config/zellij on  master [!]
➜ ls -T
.
├── config.kdl
├── layouts
│  ├── terminal.kdl
│  └── zjstatus.kdl
├── plugins
│  ├── forgot.wasm
│  ├── monocle.wasm
│  └── zjstatus.wasm
└── themes
   ├── catppuccin.kdl
   └── dracula.kdl
imsnif commented 1 year ago

Would you be comfortable compiling this plugin on your own and loading the resulting wasm file to see if it happens? This really shouldn't be a thing, but you never know...

Otherwise I'll try to provide you with some debug versions next week to help troubleshoot this. We don't get an error in the logs, so we'll have to do some guesswork before finding out what's wrong here.

0inp commented 1 year ago

I'm not an expert in Rust, so I don't really know how this work, I'm sorry 😅. Here's what I did:

Caused by: 0: No such file or directory (os error 2): '/Users/oinp/Library/Application Support/org.Zellij-Contributors.Zellij/plugins/target/wasm32-wasi/debug/monocle.wasm' 1: No such file or directory (os error 2): 'target/wasm32-wasi/debug/monocle.wasm' 2: failed to load plugin from disk ERROR |zellij_server::background| 2023-11-17 08:13:55.637 [async-std/runti] [zellij-server/src/background_jobs.rs:424]: Failed to read created stamp of resurrection file: Os { code: 2, kind: NotFound, message: "No such file or directory" } INFO |zellij_server::plugins::p| 2023-11-17 08:13:55.661 [async-std/runti] [zellij-server/src/plugins/plugin_loader.rs:495]: Loaded plugin 'tab-bar' from cache folder at '/Users/oinp/Library/Caches/org.Zellij-Contributors.Zellij' in 14.852333ms INFO |zellij_server | 2023-11-17 08:13:55.661 [async-std/runti] [zellij-server/src/lib.rs:919]: Compiling plugins using Cranelift INFO |zellij_server::plugins::p| 2023-11-17 08:13:55.680 [async-std/runti] [zellij-server/src/plugins/plugin_loader.rs:495]: Loaded plugin 'status-bar' from cache folder at '/Users/oinp/Library/Caches/org.Zellij-Contributors.Zellij' in 31.997438ms INFO |zellij_server | 2023-11-17 08:13:55.681 [async-std/runti] [zellij-server/src/lib.rs:919]: Compiling plugins using Cranelift ERROR |??? | 2023-11-17 08:14:09.872 [screen ] [zellij-server/src/panes/tiled_panes/mod.rs:806]: a non-fatal error occured

Caused by: 0: failed to resize tab horizontally 1: Ran out of room for spans ERROR |zellij_server::background| 2023-11-17 08:14:55.644 [async-std/runti] [zellij-server/src/background_jobs.rs:424]: Failed to read created stamp of resurrection file: Os { code: 2, kind: NotFound, message: "No such file or directory" } ERROR |zellij_server::plugins | 2023-11-17 08:14:55.646 [wasm ] [zellij-server/src/plugins/mod.rs:432]: Plugin with id: 1 not found ERROR |zellij_server::background| 2023-11-17 08:15:55.664 [async-std/runti] [zellij-server/src/background_jobs.rs:424]: Failed to read created stamp of resurrection file: Os { code: 2, kind: NotFound, message: "No such file or directory" } ERROR |zellij_server::plugins | 2023-11-17 08:15:55.666 [wasm ] [zellij-server/src/plugins/mod.rs:432]: Plugin with id: 1 not found ERROR |zellij_server::background| 2023-11-17 08:16:55.675 [async-std/runti] [zellij-server/src/background_jobs.rs:424]: Failed to read created stamp of resurrection file: Os { code: 2, kind: NotFound, message: "No such file or directory" } ERROR |zellij_server::plugins | 2023-11-17 08:16:55.677 [wasm ] [zellij-server/src/plugins/mod.rs:432]: Plugin with id: 1 not found ERROR |zellij_server::background| 2023-11-17 08:17:55.683 [async-std/runti] [zellij-server/src/background_jobs.rs:424]: Failed to read created stamp of resurrection file: Os { code: 2, kind: NotFound, message: "No such file or directory" } ERROR |zellij_server::plugins | 2023-11-17 08:17:55.684 [wasm ] [zellij-server/src/plugins/mod.rs:432]: Plugin with id: 1 not found ERROR |zellij_server::background| 2023-11-17 08:18:55.690 [async-std/runti] [zellij-server/src/background_jobs.rs:424]: Failed to read created stamp of resurrection file: Os { code: 2, kind: NotFound, message: "No such file or directory" } ERROR |zellij_server::plugins | 2023-11-17 08:18:55.690 [wasm ] [zellij-server/src/plugins/mod.rs:432]: Plugin with id: 1 not found ERROR |zellij_server::background| 2023-11-17 08:19:55.696 [async-std/runti] [zellij-server/src/background_jobs.rs:424]: Failed to read created stamp of resurrection file: Os { code: 2, kind: NotFound, message: "No such file or directory" } ERROR |zellij_server::plugins | 2023-11-17 08:19:55.697 [wasm ] [zellij-server/src/plugins/mod.rs:432]: Plugin with id: 1 not found ERROR |zellij_server::background| 2023-11-17 08:20:55.703 [async-std/runti] [zellij-server/src/background_jobs.rs:424]: Failed to read created stamp of resurrection file: Os { code: 2, kind: NotFound, message: "No such file or directory" } ERROR |zellij_server::plugins | 2023-11-17 08:20:55.704 [wasm ] [zellij-server/src/plugins/mod.rs:432]: Plugin with id: 1 not found INFO |zellij_server::plugins::w| 2023-11-17 08:21:52.596 [wasm ] [zellij-server/src/plugins/wasm_bridge.rs:231]: Bye from plugin 1 WARN |zellij_server::plugins | 2023-11-17 08:21:55.372 [wasm ] [zellij-server/src/plugins/mod.rs:221]: Plugin /Users/oinp/dev/monocle/target/wasm32-wasi/debug/monocle.wasm not found, starting it instead ERROR |zellij_server::background| 2023-11-17 08:21:55.725 [async-std/runti] [zellij-server/src/background_jobs.rs:424]: Failed to read created stamp of resurrection file: Os { code: 2, kind: NotFound, message: "No such file or directory" } ERROR |zellij_server::plugins | 2023-11-17 08:21:55.726 [wasm ] [zellij-server/src/plugins/mod.rs:432]: Plugin with id: 3 not found INFO |zellij_server::plugins::p| 2023-11-17 08:22:08.146 [async-std/runti] [zellij-server/src/plugins/plugin_loader.rs:536]: Compiled plugin '/Users/oinp/dev/monocle/target/wasm32-wasi/debug/monocle.wasm' in 12.481562077s INFO |zellij_server | 2023-11-17 08:22:08.165 [async-std/runti] [zellij-server/src/lib.rs:919]: Compiling plugins using Cranelift INFO |zellij_server | 2023-11-17 08:22:08.328 [async-std/runti] [zellij-server/src/lib.rs:919]: Compiling plugins using Cranelift INFO |zellij_server | 2023-11-17 08:22:08.393 [async-std/runti] [zellij-server/src/lib.rs:919]: Compiling plugins using Cranelift WARN |zellij_utils::ipc | 2023-11-17 08:22:08.484 [router ] [zellij-utils/src/ipc.rs:223]: Error in IpcReceiver.recv(): InvalidMarkerRead(Error { kind: UnexpectedEof, message: "failed to fill whole buffer" }) ERROR |zellij_client | 2023-11-17 08:22:08.484 [router ] [zellij-client/src/lib.rs:356]: Received empty message from server


Well, I really don't know what's wrong with my config...
imsnif commented 1 year ago

Thank you very much for giving this a try even though you don't know the rust tooling!

I'm going on a conference next week, but the week afterwards I'm going to give you some debug builds for you to run without all this trouble so that we can troubleshoot this and find out what's going on. Thanks for your cooperation and patience!

Yzoni commented 11 months ago

For me it's also crashing on startup, also on a mac (m1).

These are the logs when running the dev.kdl:

WARN   |zellij_utils::input::layo| 2023-12-23 12:36:34.495 [main      ] [zellij-utils/src/input/layout.rs:1035]: Failed to read swap layout file: dev.swap.kdl. Error: Os { code: 2, kind: NotFound, message: "No such file or directory" } 
INFO   |zellij_server            | 2023-12-23 12:36:34.496 [async-std/runti] [zellij-server/src/lib.rs:919]: Compiling plugins using Cranelift 
INFO   |zellij_server            | 2023-12-23 12:36:34.496 [async-std/runti] [zellij-server/src/lib.rs:919]: Compiling plugins using Cranelift 
INFO   |zellij_server            | 2023-12-23 12:36:34.502 [async-std/runti] [zellij-server/src/lib.rs:919]: Compiling plugins using Cranelift 
INFO   |zellij_server            | 2023-12-23 12:36:34.505 [async-std/runti] [zellij-server/src/lib.rs:919]: Compiling plugins using Cranelift 
ERROR  |???                      | 2023-12-23 12:36:34.531 [screen    ] [zellij-server/src/panes/grid.rs:2237]: a non-fatal error occured

Caused by:
    Unknown component: z 
INFO   |zellij_server::plugins::p| 2023-12-23 12:36:34.630 [async-std/runti] [zellij-server/src/plugins/plugin_loader.rs:495]: Loaded plugin '/Users/y/Workspace/monocle/target/wasm32-wasi/debug/monocle.wasm' from cache folder at '/Users/y/Library/Caches/org.Zellij-Contributors.Zellij' in 52.335416ms 
INFO   |zellij_server            | 2023-12-23 12:36:34.632 [async-std/runti] [zellij-server/src/lib.rs:919]: Compiling plugins using Cranelift 
INFO   |zellij_server            | 2023-12-23 12:36:34.658 [async-std/runti] [zellij-server/src/lib.rs:919]: Compiling plugins using Cranelift 
INFO   |zellij_server            | 2023-12-23 12:36:34.667 [async-std/runti] [zellij-server/src/lib.rs:919]: Compiling plugins using Cranelift 
ERROR  |zellij_utils::input::perm| 2023-12-23 12:36:34.677 [async-std/runti] [zellij-utils/src/input/permission.rs:51]: Failed to read permission cache file: No such file or directory (os error 2) 
INFO   |zellij_server            | 2023-12-23 12:36:34.678 [async-std/runti] [zellij-server/src/lib.rs:919]: Compiling plugins using Cranelift 
WARN   |zellij_utils::ipc        | 2023-12-23 12:36:34.679 [router    ] [zellij-utils/src/ipc.rs:223]: Error in IpcReceiver.recv(): InvalidMarkerRead(Error { kind: UnexpectedEof, message: "failed to fill whole buffer" }) 
ERROR  |zellij_client            | 2023-12-23 12:36:34.679 [router    ] [zellij-client/src/lib.rs:356]: Received empty message from server 
Yzoni commented 11 months ago

I manually created a permissions.kdl by copying it from a working setup on linux and put it under /Users/y/Library/Caches/org.Zellij-Contributors.Zellij/permissions.kdl. And edited the path to the wasm binary on the mac.

There is no prompt like it shows in the screenshot of https://github.com/zellij-org/zellij/releases of 0.38.0 (yet before it crashes?).

It now doesn't display the Failed to read permission cache file: No such file or directory (os error 2) anymore. But still crashes zellij.

Yzoni commented 11 months ago

Strider also crashes btw, so the issue is not limited to this plugin.

observer17 commented 10 months ago

image encountered the same crash, I build a debug target and capture the stack when it crashed, hope it would be helpful.

metaspace commented 2 weeks ago

Just tried this out and zellij went to 800% cpu and core dumped when exiting :man_shrugging:

zellij plugin -- https://github.com/imsnif/monocle/releases/latest/download/monocle.wasm

Zellij 0.40.1 on NixOS 24.05.

imsnif commented 2 weeks ago

I have neglected updating this plugin for a long time. I promise to get back to it soon!!