zellij icon indicating copy to clipboard operation
zellij copied to clipboard

zellij session still freezing from time to time

Open fansari opened this issue 3 years ago • 7 comments
trafficstars

zellij session still gets frozen from time to time.

It is not so bad as it was in the beginning but I still have to kill zellij and start again because the session is freezing. Then I typically see two times "zellij attach" when running "ps -ef | grep zellij". I kill them and start again - but of course it always takes time to recreate all stuff as it was before. I use version 0.30.0.

fansari avatar Jul 15 '22 09:07 fansari

Maybe I have a clue. I just had the same issue after an interrupted VPN session.

After this when I relogin to my VM I see a "zellij attach" process.

When I close my session normally with "Ctrl-o d" there is no "zellij attach" process left. Only "zellij --server" is left.

But when I relogin after a network issue I still see this "zellij attach" process left.

When I now do "zellij attach" to get my session back this sometimes works (at least for a while until it gets frozen) and sometimes it is hanging on the console immediately.

Killing the "zellij attach" process is not a solution to get my session back. When I do this also the "zellij --server" process is killed.

But in the end I have to do it in order to get a fresh session.

fansari avatar Jul 15 '22 14:07 fansari

We had some similar issues, but these were fixed as far as I could reproduce them:

  1. connect via ssh
  2. zellij attach
  3. force disconnect ssh by <Enter>~. escape sequence

This works correctly for me in the sense that nothing hangs.

Can you experiment a bit to get a reproducer? Is something in the logfiles when it is hanging?

raphCode avatar Jul 18 '22 19:07 raphCode

Had same issue

kabirz avatar Aug 09 '22 06:08 kabirz

I've had this issue twice today with 0.31.3. In my case, zellij attach also hangs and even starting a new session with zellij hangs.

The following is what I see running:

$ ps ax | grep zellij
  11465 ?        Sl     0:10 /home/<username>/local/bin/zellij --server /run/user/1000/zellij/0.31.3/tense-unit
  13348 pts/1    Sl+    0:00 zellij attach
  35797 ?        Sl     0:00 zellij attach
  54630 pts/4    S+     0:00 grep --color=auto zellij

Eventually it quit by itself.

Where should I got looking for logs to supplement this report in case it happens again?

hds avatar Aug 24 '22 13:08 hds

The problem is very likely a hanging zellij server process which can't answer requests. This blocks new sessions or attaches since on startup they try to communicate with other zellij servers and wait for a reply which does never come.

The interesting parts are what lead these zellij processes to lock up. It would be best if you can give hints what happened prior to a hanging attach.

Where should I got looking for logs to supplement this report in case it happens again?

We log to /tmp/zellij-<uid>/zellij-log/zellij.log, so for example /tmp/zellij-1000/zellij-log/zellij.log.

The logs should be retained until reboot (or the filesize exceeds 100 kb or so)

raphCode avatar Aug 30 '22 15:08 raphCode

@raphCode I think I might have done something different this time. The steps were:

  1. Yesterday: SSH into remote machine
  2. Start a new session (there were no previous sessions)
  3. Run a series of commands that took around 10 minutes to complete
  4. Let the connection time-out (overnight)
  5. Today: SSH into remote machine
  6. Attach to the previous session
  7. try to use CTRL + s, e to enter editor mode (because I saw it in the tips) - this didn't seem to do anything
  8. Scroll around the buffer a bit (I was pressing a lot of different keys here and I don't know which, sorry)
  9. Suddenly my key presses started appearing in the terminal
  10. Try to attach from a new SSH session, cannot

Here are the logs from when this started yesterday:

INFO   |zellij_client            | 2022-08-30 18:09:46.567 [main      ] [zellij-client/src/lib.rs:129]: Starting Zellij client! 
INFO   |zellij_server            | 2022-08-30 18:09:46.569 [main      ] [zellij-server/src/lib.rs:195]: Starting Zellij server! 
INFO   |zellij_server::wasm_vm   | 2022-08-30 18:09:46.622 [wasm      ] [zellij-server/src/wasm_vm.rs:87]: Wasm main thread starts 
INFO   |zellij_client            | 2022-08-30 18:10:37.594 [main      ] [zellij-client/src/lib.rs:394]: Session detached 
INFO   |zellij_client            | 2022-08-30 18:10:40.024 [main      ] [zellij-client/src/lib.rs:129]: Starting Zellij client! 
INFO   |zellij_client            | 2022-08-30 20:27:42.920 [main      ] [zellij-client/src/lib.rs:394]: Bye from Zellij! 
INFO   |zellij_client            | 2022-08-31 10:01:01.105 [main      ] [zellij-client/src/lib.rs:129]: Starting Zellij client! 
INFO   |zellij_server            | 2022-08-31 10:01:01.106 [main      ] [zellij-server/src/lib.rs:195]: Starting Zellij server! 
INFO   |zellij_server::wasm_vm   | 2022-08-31 10:01:01.159 [wasm      ] [zellij-server/src/wasm_vm.rs:87]: Wasm main thread starts 
INFO   |zellij_server::wasm_vm   | 2022-08-31 10:01:02.533 [wasm      ] [zellij-server/src/wasm_vm.rs:213]: wasm main thread exits 
INFO   |zellij_client            | 2022-08-31 10:01:02.533 [main      ] [zellij-client/src/lib.rs:394]: Bye from Zellij! 
ERROR  |zellij_utils::errors     | 2022-08-31 10:01:02.533 [screen    ] [zellij-utils/src/errors.rs:94]: Panic occured:
             thread: screen
             location: At zellij-server/src/screen.rs:945:14
             message: failed to receive event on channel: RecvError 
INFO   |zellij_client            | 2022-08-31 10:01:05.362 [main      ] [zellij-client/src/lib.rs:129]: Starting Zellij client! 
INFO   |zellij_client            | 2022-08-31 10:34:15.366 [main      ] [zellij-client/src/lib.rs:129]: Starting Zellij client! 
ERROR  |zellij_server::pty       | 2022-08-31 10:34:32.113 [pty       ] [zellij-server/src/pty.rs:102]: Failed to open editor: No Editor found, consider setting a path to one in $EDITOR or $VISUAL 
ERROR  |zellij_server::pty       | 2022-08-31 10:34:41.766 [pty       ] [zellij-server/src/pty.rs:102]: Failed to open editor: No Editor found, consider setting a path to one in $EDITOR or $VISUAL 
ERROR  |zellij_utils::errors     | 2022-08-31 10:35:02.184 [stdin_handler] [zellij-utils/src/errors.rs:94]: Panic occured:
             thread: stdin_handler
             location: At zellij-client/src/stdin_handler.rs:79:18
             message: called `Result::unwrap()` on an `Err` value: "SendError(..)" 

hds avatar Aug 31 '22 08:08 hds

This might be a combination of two different issues, but at least the second one where the session dissappears should be fixed by #1731 in the next release.

raphCode avatar Sep 14 '22 12:09 raphCode

Some cross-referencing: Zellij hanging reproducer: #1813 Another issue about network problems and freezing / hangs #1781

But when I relogin after a network issue I still see this "zellij attach" process left.

Killing the "zellij attach" process is not a solution to get my session back. When I do this also the "zellij --server" process is killed.

@fansari Now that we fixed+released an issue I suspect caused the server to be killed (#1731), can you please try again to kill the stale zellij attach process next time? If the server disappears too, please make sure to include the log from /tmp/zellij-*/zellij-log/ so we have a guess what is going on!

raphCode avatar Oct 26 '22 22:10 raphCode

This should be fixed by https://github.com/zellij-org/zellij/pull/1955 and is in the next release. Please comment if the issue is still present.

raphCode avatar Nov 23 '22 09:11 raphCode