tmuxp: ValueError: Session requires a `session_id`

I am getting the following error in all configurations. (I tried the config from the readme as well)

Traceback (most recent call last):
  File "/home/vn-ki/.local/bin/tmuxp", line 11, in <module>
    load_entry_point('tmuxp==1.4.0', 'console_scripts', 'tmuxp')()
  File "/usr/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/vn-ki/.local/lib/python3.6/site-packages/tmuxp/cli.py", line 602, in command_load
    load_workspace(config[-1], **tmux_options)
  File "/home/vn-ki/.local/lib/python3.6/site-packages/tmuxp/cli.py", line 328, in load_workspace
    builder.build()
  File "/home/vn-ki/.local/lib/python3.6/site-packages/tmuxp/workspacebuilder.py", line 141, in build
    session_name=self.sconf['session_name']
  File "/home/vn-ki/.local/lib/python3.6/site-packages/libtmux/server.py", line 511, in new_session
    session = Session(server=self, **session)
  File "/home/vn-ki/.local/lib/python3.6/site-packages/libtmux/session.py", line 42, in __init__
    raise ValueError('Session requires a `session_id`')
ValueError: Session requires a `session_id`

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 11
  • Comments: 25 (7 by maintainers)

Most upvoted comments

I ran into the same issue as the original bug report while using tmux 3.0a and tmuxp 1.5.4. Setting the following in ~/.bash_locale and then sourcing it at the end of my .bashrc file resolved the issue.

I have tmux installed as a compiled binary from the release page source, and tmuxp was installed via pip3, using Python 3.5.2.

## Use UTF-8 everywhere                                        
export LANG=en_US.utf8                                         
export LANGUAGE=en_US.utf8                                     
export LC_CTYPE="en_US.utf8"                                   
export LC_NUMERIC="en_US.utf8"                                 
export LC_TIME="en_US.utf8"                                    
export LC_COLLATE="en_US.utf8"                                 
export LC_MONETARY="en_US.utf8"
export LC_MESSAGES="en_US.utf8"
export LC_PAPER="en_US.utf8"                                   
export LC_NAME="en_US.utf8"                                    
export LC_ADDRESS="en_US.utf8"                                 
export LC_TELEPHONE="en_US.utf8"
export LC_MEASUREMENT="en_US.utf8"
export LC_IDENTIFICATION="en_US.utf8"
export LC_ALL=en_US.utf8

I also encountered this problem, and after debugging, I found that the method libtmux.server.Server._list_sessions uses \t to slice different columns, but in some environments the data returned by proc.stderr is not slice by \t.

The fix is to change the sliced character to something else, e.g. ||||

I too had this issue and I took the time to dig a bit deeper into it as I had one environment where I saw the expected (non-broken) behavior and another with the ValueError: Session requires a 'session_id' problem.

There is command that is ran via subprocess (I believe) which invokes tmux to provide some information in a tab delimited format for parsing. Here’s a screenshot showing the command/syntax that is issued to tmux outlined in red:

image

This screenshot shows the output that is returned from that command (outlined in red) and as you can see it is not tab delimited.

image

The environment that was broken was a docker container, and as it turns out, I had been a bit lazy in its creation and skipped the locale generation part. After properly setting up all the locale and my shell’s LANG environment variable to en_US.utf8, everything started working as expected.

Analyzing the output again in the debugger shows the properly formatted string. image

TL;DR - Check your locale settings and shell LANG variable as the string libtmux is expecting to see when invoking tmux is improperly formatted.