tmux-resurrect
tmux-resurrect copied to clipboard
Save failure corrupts resurrect storage
I'm constantly having
'/Users/ain/.tmux/plugins/tmux-resurrect/scripts/save.sh' returned 1
which ends up in 0-length txt file at .tmux/resurrect, every time.
I think the save script should safeguard the behaviour and not dump a file on failure.
Thanks for reporting this. Any idea why the save script fails?
I'm encountering this issue fairly regularly as well. What can I do to find the cause of it? The only behaviours I can think of are long lasting sessions and restoring my laptop from sleep states. No hard metrics though
Yes, it looks like a core problem of those /private… temporary folders getting lost and so the session is corrupt.
+1 I am also getting this issue regularly
Well I get it as well. I have tried to run the script by hand doing
~/.tmux/plugins/tmux-resurrect/scripts/save.sh
and the error is
connecting to /private/var/folders/d0/xbg08_x12lddw3dkht5w462c0000gn/T/tmux-501/default (No such file or directory)
Is there at least a manual workaround for saving sessions when this happens?
Yes.
cd ~/.tmux/resurrectrm <all 0 byte txt files>unlink lastln -s <last txt file> last
thanks for your input. I did that but the session file I get is empty and the error is still the same. Any idea?
You didn't do your process correctly. The last symlink must still link to a 0-byte text file that was created by the save malfunction.
I have followed your step, 1 by one 1, is that what you doubt I did correctly?
Just to make sure, I have removed all zero size files, and unlinked "last", now, what should I do? if I have to link a valid non-zero-size file, then it's what I did ... and it still gives me the error.
I have also tried to stop at step 3 and do the save command, but still I get the same. Hope I made clearer what I did ...
Step 4 is crucial. You need to link the last non 0 byte file (the one that is not corrupt) to last in your resurrect folder.
ok, then is what I am doing.
-rw-r--r-- 1 roberto staff - 3.6K Nov 23 17:27 tmux_resurrect_2015-11-23T17:27:14.txt lrwxr-xr-x 1 roberto staff - 38B Mar 17 14:08 last -> tmux_resurrect_2015-11-23T17:27:14.txt
but still the save script does not work. Would you mind explaining the logic of this fix? it seems the proble is related to connecting to /private/var/folders/d0/xbg08_x12lddw3dkht5w462c0000gn/T/tmux-501/default (No such file or directory)
I do not see how you 4-step solution will fix that.
It's not about the save, it's the environment issue. I'm having the same problem not only on tmux, but also Vim, for an unknown reason so far, but the way to recover in those circumstances is to shut down tmux (:kill-server) and restart it.
interesting. so is this in alternative to the 4-step above or is after that?
and, if I may, what would be the restart command to be given after the :kill-server, I'd like to try, but want to do it right.
Thanks for helping
:kill-server will kill the whole tmux. Once those 4 steps have been successfully completed, you can start tmux up again.
I see, so this is not "a manual workaround for saving sessions when this happens", it's just quit tmux and restart, loosing my current session pane list, or am I mistaken?
Yes, correct. I haven't managed to save it if it's corrupt already. It's a good practice to make sure to save your tmux env as you change it.
This ticket here is chiefly to discuss saving a 0 byte txt file that should not happen. If save fails, rollback to last known stable should happen automatically, to avoid manually going through the aforementioned 4 steps.
Yes, correct. I haven't managed to save it if it's corrupt already.
... which was my original question ...
Any news on this? I get this all the time and it drives me nuts.
Hey peeps, I've never experienced this issue. I see there was a proposal how to deal with the situation after this has happened, but did anyone discover what's causing this in the first place?
Well I get it as well. I have tried to run the script by hand doing
~/.tmux/plugins/tmux-resurrect/scripts/save.shand the error is
connecting to /private/var/folders/d0/xbg08_x12lddw3dkht5w462c0000gn/T/tmux-501/default (No such file or directory)
I run into this today. The save.sh script failed with multiple error connecting to /tmp/tmux-1000/default (No such file or directory). Same output from tmux ls.
The socket file indeed was not there, I don't know how or why it disappeared :)
Is there at least a manual workaround for saving sessions when this happens?
SOLUTION
I solved the problem by running pkill -USR1 tmux. It recreated the socket file and then the save.sh script and other tmux commands worked as expected.
Sending the SIGUSR1 signal to regenerate the socket is documented in man tmux.
Ran into this problem too and unfortunately pkill -USR1 tmux did not create the required socket file and solve the problem.
Error message on my side is:
error connecting to /private/tmp/tmux-501/default (No such file or directory)
repeated a bunch of times probably due to retry.