zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
22.03k stars 673 forks source link

Thread 'async-std/runtime' panicked. #2390

Open sebastiancarlos opened 1 year ago

sebastiancarlos commented 1 year ago

Error on running zellij. (It got fixed after system reboot, so feel free to close)

Error occurred in server:

  × Thread 'async-std/runtime' panicked.
  ├─▶ At zellij-server/src/plugins/wasm_bridge.rs:693:5
  ╰─▶
A panic occured in a plugin
PanicInfo {
    payload: Any { .. },
    message: Some(
        called `Result::unwrap()` on an `Err` value: Serde(Error("trailing characters", line: 1, column: 244)),
    ),
    location: Location {
        file: "default-plugins/status-bar/src/tip/utils.rs",
        line: 40,
        col: 83,
    },
    can_unwind: true,
}

  help: If you are seeing this message, it means that something went wrong.

        -> To get additional information, check the log at: /var/folders/9t/xbj1w_d91lq29fg7v0fqhkp00000gn/T/zellij-501/zellij-log/zellij.log
        -> To see a backtrace next time, reproduce the error with: RUST_BACKTRACE=1 zellij [...]
        -> To help us fix this, please open an issue: https://github.com/zellij-org/zellij/issues

Logs:

INFO   |zellij_client            | 2023-04-22 09:24:56.054 [main      ] [zellij-client/src/lib.rs:143]: Starting Zellij client! 
INFO   |zellij_server            | 2023-04-22 09:24:56.071 [main      ] [zellij-server/src/lib.rs:237]: Starting Zellij server! 
INFO   |zellij_server            | 2023-04-22 09:24:56.131 [main      ] [zellij-server/src/lib.rs:843]: Compiling plugins using Cranelift 
INFO   |zellij_server::plugins   | 2023-04-22 09:24:56.131 [wasm      ] [zellij-server/src/plugins/mod.rs:72]: Wasm main thread starts 
INFO   |zellij_utils::input::plug| 2023-04-22 09:24:56.137 [async-std/runti] [zellij-utils/src/input/plugins.rs:139]: Plugin 'tab-bar.wasm' exists in the 'PLUGIN DIR' at '/Users/XXXX/Library/Application Support/org.Zellij-Contributors.Zellij/plugins/' but is being ignored 
INFO   |zellij_utils::input::plug| 2023-04-22 09:24:56.137 [async-std/runti] [zellij-utils/src/input/plugins.rs:139]: Plugin 'status-bar.wasm' exists in the 'PLUGIN DIR' at '/Users/XXXX/Library/Application Support/org.Zellij-Contributors.Zellij/plugins/' but is being ignored 
INFO   |zellij_server::plugins::s| 2023-04-22 09:24:56.145 [async-std/runti] [zellij-server/src/plugins/start_plugin.rs:357]: Loaded plugin 'tab-bar' from cache folder at '/Users/XXXX/Library/Caches/org.Zellij-Contributors.Zellij' in 6.793868ms 
INFO   |zellij_server::plugins::s| 2023-04-22 09:24:56.147 [async-std/runti] [zellij-server/src/plugins/start_plugin.rs:357]: Loaded plugin 'status-bar' from cache folder at '/Users/XXXX/Library/Caches/org.Zellij-Contributors.Zellij' in 8.985895ms 
ERROR  |zellij_utils::errors::not| 2023-04-22 09:24:56.152 [async-std/runti] [zellij-utils/src/errors.rs:585]: Panic occured:
             thread: async-std/runtime
             location: At zellij-server/src/plugins/wasm_bridge.rs:693:5
             message: 

A panic occured in a plugin

PanicInfo {

    payload: Any { .. },

    message: Some(

        called `Result::unwrap()` on an `Err` value: Serde(Error("trailing characters", line: 1, column: 244)),

    ),

    location: Location {

        file: "default-plugins/status-bar/src/tip/utils.rs",

        line: 40,

        col: 83,

    },

    can_unwind: true,

}

INFO   |zellij_server::plugins   | 2023-04-22 09:24:56.153 [wasm      ] [zellij-server/src/plugins/mod.rs:162]: wasm main thread exits 

Basic information

zellij --version: zellij 0.36.0 stty size: 45 178 uname -av or ver(Windows): Darwin XXX 21.6.0 Darwin Kernel Version 21.6.0: Thu Mar 9 20:08:59 PST 2023; root:xnu-8020.240.18.700.8~1/RELEASE_X86_64 x86_64

Further information no custom layout, no custom config. it happened randomly after trying to change som keybindings, but problem persists after restoring original.

gbataille commented 1 year ago

I have the same issue (although my Serde message warns about a "trailing characters" in a different column number :/)

gbataille commented 1 year ago

@sebastiancarlos downgrading, then rebooting did the trick for me.

The code that is in the stack trace points to loading of a status-bar-tips.cache file. from the code, I seem to find that it should be in /tmp https://github.com/zellij-org/zellij/blob/204c41e63f5a134e2f371ee56e0fb29acea64672/default-plugins/status-bar/src/tip/consts.rs#L1

however I have no such file in /tmp nor does the error change if I create one and put garbage inside.

ok, so it's because /tmp goes to $TMPDIR/zellij-xxx. I found the file. I'm going to do a few tests

gbataille commented 1 year ago

well, I'm not reproducing the issue.

@sebastiancarlos I suspect that this cache file got some inconsistent data at some point the last time you executed zellij and it prevents it from restarting.

find the file inside $TMPDIR in the zellij folder that is called status-bar-tips.cache and delete it. that should do the trick

wimstefan commented 1 year ago

You could also try to empty ~/.cache/zellij/ ...

arecvlohe commented 1 year ago

Removing the status-bar-tips.cache fixed the issue for me.

echo $TMPDIR
rm /<tmpdir>/zellij-<number>/status-bar-tips.cache
loarca commented 1 year ago

I just had this issue right now, and yup, aparrently the status-bar-tips.cache file got corrupted at some point yesterday in my machine but idk why or how.

My status-bar-tips.cache file for reference:

{"zellij_version":"0.36.0","cached_data":{"floating_panes_mouse":1,"edit_scrollbuffer":1,"zellij_setup_check":1,"sync_tab":1,"move_focus_hjkl_tab_switch":1,"compact_layout":1,"use_mouse":1,"quicknav":2}}inal":1,"floating_panes_mouse":1}}

For me it was as easy as removing the last corrupted portion of the file:

inal":1,"floating_panes_mouse":1}}