Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tmuxinator won't run untill another tmux session exists #536

Closed
Kayne opened this issue Jun 6, 2017 · 32 comments
Closed

tmuxinator won't run untill another tmux session exists #536

Kayne opened this issue Jun 6, 2017 · 32 comments

Comments

@Kayne
Copy link

Kayne commented Jun 6, 2017

Tmuxinator can't connect to tmux server (create new sessions) unless at least one session exists already.

When I have no sessions live and try to run tmuxinator project:

~  tmux list-sessions
no server running on /private/tmp/tmux-501/default
~  tmuxinator project_name
no server running on /private/tmp/tmux-501/default
lost server
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no sessions

(the /private/tmp/tmux-501/default exists and is empty)

But when I create new tmux sessions (and at least one still exists):

~  tmux list-sessions
0: 1 windows (created Tue Jun  6 11:22:21 2017) [134x32] (attached)

all works fine, tmuxinator run tmux session and all commands are executed correctly.

I'm using tmux 2.5 (OS X 10.12) installed via homebrew.

@firedev
Copy link

firedev commented Jun 8, 2017

Same here, something changed recently. Thanks @Kayne for a workaround so I can at least launch it.

@vanife
Copy link

vanife commented Jun 8, 2017

This must be the change in the tmux 2.5. Reverting back to tmux 2.4 works fine (brew switch tmux 2.4).

@Kayne
Copy link
Author

Kayne commented Jun 8, 2017

@firedev happy to help :)

@vanife Yes, reverting back to 2.4 fixes the problem. So it is definetely related to tmux version 2.5. I have to remember to not run brew cleanup everytime after updating formulas, because installing obsoleted packages is tricky :)

@Skulli
Copy link

Skulli commented Jun 12, 2017

Just had the same problem on my mac, workaround is working

@adamstrickland
Copy link
Contributor

This has been tracked down to a change in behavior with respect to tmux has-session, which tmuxinator uses to detect if it should set up a new project or attach to an existing one. I have filed an issue; will update when we have a plan. Until then, tmuxinator does not support tmux version 2.5 or greater.

@JBlackCat
Copy link

👍 I should have checked here sooner. 😄

@staycreativedesign
Copy link

staycreativedesign commented Jun 15, 2017

pretty easy question how would I install tmuxi2.4 on a mac?

@Kayne
Copy link
Author

Kayne commented Jun 15, 2017

Install formula from specific revision (I belive it's how it's called in git):

brew install https://raw.githubusercontent.com/Homebrew/brew/2d2034afc6e4dfab0a1c48f5edd2c5478576293b/Formula/tmux.rb

@staycreativedesign
Copy link

staycreativedesign commented Jun 15, 2017 via email

@adamstrickland
Copy link
Contributor

adamstrickland commented Jun 15, 2017

UPDATE: the bug in tmux that was causing this issue has been fixed in master and will become part of that tool's 2.6 release. Unfortunately, the fix won't be back-ported to 2.5. If you really must have tmux 2.5 and use it with tmuxinator, you can pull the 2.5 branch from Github, apply the patch in the linked issue (also here) and be on your merry way. However, I would recommend simply sticking with 2.4 and jumping to 2.6 when it is released.

@staycreativedesign
Copy link

staycreativedesign commented Jun 16, 2017 via email

@danshumaker
Copy link

danshumaker commented Sep 18, 2017

Upgraded to sierra last night and started getting this error. But, just tried compiling 2.6-rc on tmux and checked the contents of cmd-find.c to be sure the patch was included, and it is. Linked my compiled version to the /usr/local/bin dir and re-ran tmuxinator without a previously running tmux and I still get the error.... bummer. I must be doing something wrong. rc3 For now I'll just start dummy tmux session to use tmuxinator so it has something to start with. Anyone else try tmux 2.6? (tried with tmuxinator 0.9.0)

@JBlackCat
Copy link

JBlackCat commented Oct 16, 2017

@danshumaker I was having the same issue.

Take a look at your tmux config. I am using the same config as my co-worker who is a bit more savvy than I with tmux and 2.4 broke a number of things in his config.

Once I updated my config the problem went away. I don't know which specific issues were causing the problem; my co-worker had made numerous changes since I first copied it over.

@jenrzzz
Copy link

jenrzzz commented Nov 3, 2017

For me the line set-option -g status-utf8 on was causing the issue (the status-utf8 option is obsolete). I really would have expected a more visible error message and it was very strange that starting tmux directly worked, but everything was peachy after I removed that line.

@henvo
Copy link

henvo commented Nov 8, 2017

It seems that tmux changed some of its behavior that has to do with the .tmux.conf. For me it was the line:

bind r source-file ~/.tmux.conf ; display-message "Config reloaded.."

that caused the trouble. It always worked until I upgraded to the latest version of tmux. After removing this line from my .tmux.conf I was able to run mux start [project] again without any problems.

@adamstrickland
Copy link
Contributor

@henvo can you double-check your syntax? pretty sure the ; needs to be preceeded by a \, e.g. (from my ~/.tmux.conf)

bind-key e copy-mode \; send-keys "?Error" C-m

Also, what versions of tmux and tmuxinator are being run?

@adamstrickland
Copy link
Contributor

@danshumaker were you able to get things working? I'm a bit surprised by tmux 2.6 having issues... I personally have noticed that if I have multiple versions of tmux on my system I have to be careful about my $PATH, as tmuxinator will only find the first...

@wanyaoqi
Copy link

wanyaoqi commented Feb 2, 2018

`~ » tmux -V
tmux 2.4

~ » tmux list-sessions
no server running on /private/tmp/tmux-501/default`

same problem in tmux 2.4

@adamstrickland
Copy link
Contributor

@wanyaoqi I'm not sure this is the same problem... The line of code that introduce the problem this issue refers to was introduced after tmux 2.4 was released. As others have noted in the comments above, there are some tmux configuration settings that can cause something similar.

That said, if you think this is still tmuxinator-related, we'd be happy to help. Feel free to start a new issue and include your tmuxinator debug output and we can take it from there.

@dkrieger
Copy link

I still run into this issue in 2.6 . Adding the following to my ~/.zshrc did the trick. Of course, this could be bundled up in a script or alias, but I wanted it to be run any time my shell starts and no tmux sessions are found.

DUMMY='dummy'
PROJECT='monit'
tmux list-sessions || ( tmux new -d -s $DUMMY && tmuxinator start $PROJECT )

@danshumaker
Copy link

@adamstrickland Sorry for the late response, I do not have this issue anymore. Woot woot!

@adamstrickland
Copy link
Contributor

@dkrieger Interesting... Thanks for the snippet; I'd be interested to know if others use something similar (if you do, maybe just +1 the comment?) over time. If so, maybe we incorporate the same into tmuxinator in a future release.

@nickhoffman
Copy link

I have tmux 2.7 and tmuxinator 0.11.1 installed and this problem affected me. The problem disappeared when I removed all of my tmux config files, which enabled me to identify the cause: the option status-utf8 was removed from tmux, but I still had this line in my config:

set -g status-utf8 on

Removing this line, as described in this comment above, fixed the problem. For more info, see tmux/tmux#230.

backpackerhh pushed a commit to backpackerhh/dotfiles-old that referenced this issue Apr 23, 2018
Set UTF-8 in status bar is no longer necessary.

More info:
tmux/tmux#230
tmuxinator/tmuxinator#536
@eric-wieser
Copy link

I'm running into trouble here with tmux/tmux#182 - running tmuxinator debug my-project shows that it's running tmux start-server, but that command no longer does anything

@gnapse
Copy link

gnapse commented Aug 20, 2018

I didn't use to have this problem, but I get it now that I switched to fish as my shell. In zsh it works fine, but in fish it does not. In both cases I have the same tmux configuration.

This is the output that I get when I run tmuxinator my-project:

lost server
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default
no server running on /private/tmp/tmux-501/default

Again, the above only happens under the fish shell, not under zsh.

tmuxinator debug my-project

In case it is helpful to figure out the problem, this is the output of tuxminator debug my-project

#!/usr/local/bin/fish

# Clear rbenv variables before starting tmux
unset RBENV_VERSION
unset RBENV_DIR

tmux start-server;

cd /Users/ernesto/code/gob/getonbrd

# Run on_project_start command.



  # Run pre command.


  # Run on_project_first_start command.


  # Create the session and the first window. Manually switch to root
  # directory if required to support tmux < 1.9
  TMUX= tmux new-session -d -s getonbrd -n shell
  tmux send-keys -t getonbrd:0 cd\ /Users/ernesto/code/gob/getonbrd C-m


  # Create other windows.
  tmux new-window -c /Users/ernesto/code/gob/getonbrd -t getonbrd:1 -n server


  # Window "shell"
  tmux send-keys -t getonbrd:0.0 git\ status C-m

  tmux splitw -c /Users/ernesto/code/gob/getonbrd -t getonbrd:0
  tmux select-layout -t getonbrd:0 tiled
  tmux send-keys -t getonbrd:0.1 yarn\ test C-m

  tmux select-layout -t getonbrd:0 tiled

  tmux select-layout -t getonbrd:0 even-horizontal
  tmux select-pane -t getonbrd:0.0


  # Window "server"
  tmux send-keys -t getonbrd:1.0 make\ dev C-m

  tmux splitw -c /Users/ernesto/code/gob/getonbrd -t getonbrd:1
  tmux select-layout -t getonbrd:1 tiled
  tmux send-keys -t getonbrd:1.1 yarn\ start C-m

  tmux select-layout -t getonbrd:1 tiled

  tmux select-layout -t getonbrd:1 even-horizontal
  tmux select-pane -t getonbrd:1.0


  tmux select-window -t getonbrd:0
  tmux select-pane -t getonbrd:0.0




# Run on_project_exit command.

fish shell version 2.7.1
tmux version 2.7
tmuxinator version 0.12.0

@episage
Copy link

episage commented Dec 30, 2018

Same happens to me on Mac,

tmux -V
tmux 2.8

Replication:

Result:

$ tmux-cssh -cs sip
* Searching for config setting name 'sip' ...
* Matched config-settings 'sip', analysing parameters, installer@192.168.1.164 installer@192.168.1.240 installer@192.168.1.241 installer@192.168.1.242 installer@192.168.1.243 ...
* Connecting 'ssh installer@192.168.1.164'
* Connecting 'ssh installer@192.168.1.240'
no server running on /private/tmp/tmux-501/default
* Connecting 'ssh installer@192.168.1.241'
no server running on /private/tmp/tmux-501/default
* Connecting 'ssh installer@192.168.1.242'
no server running on /private/tmp/tmux-501/default
* Connecting 'ssh installer@192.168.1.243'
no server running on /private/tmp/tmux-501/default
All connections have failed.

@adamstrickland
Copy link
Contributor

@gnapse if you are still having a problem do you mind starting a new issue for it? If it turns out to be related we’ll link the two so people can find them

@adamstrickland
Copy link
Contributor

adamstrickland commented Dec 31, 2018

@episage I’m not seeing where tmuxinator fits in here. Assuming you are using tmuxinator, we should start a new issue for this as yours involves tmux-cssh, which may or may not affect what’s going on. If you do decide to create an issue, please include the tmuxinator debug output. Just FYI, tho, this is the first time I personally have heard of tmux-cssh, so there’s no guarantee we’ll be able to get it working, but we’ll see what we can figure out.

@drewfish
Copy link

I had the same problem with tmux/bionic-updates,now 2.6-3ubuntu0.1 amd64 installed on Ubuntu. When I switched to 2.8 installed via linuxbrew it seems to work again.

@yam-liu
Copy link

yam-liu commented Jun 2, 2019

It seems there are some wrong configs in my .tmux.conf, use tmux to start tmux session will show the errors/warings. When fixed, mux [project] works again.

@turboladen
Copy link

FWIW, I landed on this issue after running into the same, initially described issue. Turned out my tmux.conf was a few years old and tmux had changed how it wants you to specify style; updating these style-related settings got me up and running. For example:

# I used to have this
set -g status-fg white
set -g status-bg black

# But I changed to this
set -g status-style fg=white,bg=black

You can see more about what I ran into over here: tmux/tmux#1689

@kleinjm
Copy link

kleinjm commented Jan 6, 2020

My issue was that I updated tmux to version 3.0a and that broke on the backslashes in my conf file. I needed to change

bind \ split-window -h -c '#{pane_current_path}'
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"

to

bind \\ split-window -h -c '#{pane_current_path}'
bind -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests