tmux-python / tmuxp

🖥️ Session manager for tmux, build on libtmux.
https://tmuxp.git-pull.com/
MIT License
4.05k stars 231 forks source link

['protocol version mismatch (client 7, server 8)'] #794

Open mdeguzis opened 2 years ago

mdeguzis commented 2 years ago

Step 1: Provide a summary of your problem

Step 2: Provide tmuxp details

-------------------------
environment:
        dist: Linux-5.4.204-124.362.amzn2int.x86_64-x86_64-with-glibc2.2.5
        arch: x86_64
        uname: Linux; dev-dsk-deguzim-1a-fa82568b.us-east-1.amazon.com; 5.4.204-124.362.amzn2int.x86_64
        version: #1 SMP Wed Jul 13 03:24:31 UTC 2022
-------------------------

tmux version: 1.8
libtmux version: 0.12.0
tmuxp version: 1.12.1
tmux path: /usr/bin/tmux
tmuxp path: /home/deguzim/.local/lib/python3.7/site-packages/tmuxp
shell: /bin/zsh
-------------------------
tmux sessions:

        protocol version mismatch (client 7, server 8)
tmux windows:

        protocol version mismatch (client 7, server 8)
tmux panes:

        protocol version mismatch (client 7, server 8)
tmux global options:

        protocol version mismatch (client 7, server 8)
tmux window options:

        protocol version mismatch (client 7, server 8)

Step 3: Describe the problem:

Started new server, protocol mismatch. tmuxp seems to be using /usr/bin/tmux instead of what I have aliased.

$ tmux -V
tmux.orig 2.8

$ /usr/bin/tmux -V
tmux 1.8

I'm checking the code now, but the script here should be looking at something like which tmux or allow the user to set this in a configuration file.

mdeguzis commented 2 years ago

So this is the issue from libtmux :(

from libtmux.common import has_minimum_versio

There has to be a way to tell libtmux where my actual tmux is...

tony commented 2 years ago

@mdeguzis

Let's take a closer look at this and #396. I am not fully certain if this is a bug yet

There has to be a way to tell libtmux where my actual tmux is...

libtmux.common.get_version

from CLI: tmuxp shell -c 'from libtmux.common import get_version; print(get_version())'

What does that give you?

protocol version mismatch (client 7, server 8)

P.S. I believe it's possible that error can be caused by an old tmux server running, and a mismatching client connecting to it.

mdeguzis commented 2 years ago

My client and sever are not mismatched.

# client
$ tmux -V
tmux.orig 2.8

# server
$ tmux display-message -p "#{version}"
2.8

ps

$ ps -aux | grep tmux
user   3901  0.0  0.0 123032  3780 ?        Ss   Aug11   0:00 /apollo/env/envImprovement/bin/tmux --library-path /apollo/env/envImprovement/lib: /apollo/env/envImprovement/bin/tmux.orig new -s work
user   6728  0.0  0.0 127360  8084 ?        Ss   Aug11   2:17 /apollo/env/envImprovement/bin/tmux --library-path /apollo/env/envImprovement/lib: /apollo/env/envImprovement/bin/tmux.orig -2 new-session -swork -P -F#{session_name}|#{session_windows}|#{session_width}|#{session_height}|#{session_id}|#{session_created}|#{session_created_string}|#{session_attached}|#{session_grouped}|#{session_group} -d -x 800 -y 600
user   8929  0.0  0.0 119428   940 pts/29   S+   17:10   0:00 grep --color=always tmux
user  83055  0.0  0.0 123376  4124 ?        Ss   Aug11   0:14 /apollo/env/envImprovement/bin/tmux --library-path /apollo/env/envImprovement/lib: /apollo/env/envImprovement/bin/tmux.orig new -s work
user  92408  0.0  0.0 122532  3344 pts/20   S+   17:02   0:00 /apollo/env/envImprovement/bin/tmux --library-path /apollo/env/envImprovement/lib: /apollo/env/envImprovement/bin/tmux.orig attach -d -t work
$ tmuxp shell -c 'from libtmux.common import get_version; print(get_version())'
2.8
Traceback (most recent call last):
  File "/home/deguzim/.local/bin/tmuxp", line 8, in <module>
    sys.exit(cli.cli())
  File "/home/deguzim/.local/lib/python3.7/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/deguzim/.local/lib/python3.7/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/deguzim/.local/lib/python3.7/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/deguzim/.local/lib/python3.7/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/deguzim/.local/lib/python3.7/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/deguzim/.local/lib/python3.7/site-packages/tmuxp/cli/shell.py", line 69, in command_shell
    util.raise_if_tmux_not_running(server=server)
  File "/home/deguzim/.local/lib/python3.7/site-packages/tmuxp/util.py", line 92, in raise_if_tmux_not_running
    raise e
  File "/home/deguzim/.local/lib/python3.7/site-packages/tmuxp/util.py", line 81, in raise_if_tmux_not_running
    server.sessions
  File "/home/deguzim/.local/lib/python3.7/site-packages/libtmux/server.py", line 210, in sessions
    return self.list_sessions()
  File "/home/deguzim/.local/lib/python3.7/site-packages/libtmux/server.py", line 205, in list_sessions
    return [Session(server=self, **s) for s in self._sessions]
  File "/home/deguzim/.local/lib/python3.7/site-packages/libtmux/server.py", line 195, in _sessions
    return self._list_sessions()
  File "/home/deguzim/.local/lib/python3.7/site-packages/libtmux/server.py", line 172, in _list_sessions
    raise exc.LibTmuxException(list_sessions_cmd.stderr)
libtmux.exc.LibTmuxException: ['protocol version mismatch (client 7, server 8)']
zsh: command not found: 2.8