Closed bgschiller closed 3 years ago
I've tried running the commands replbot would invoke by hand, and my best guess is that it's failing when it runs the first tmux set-option
: https://github.com/binwiederhier/replbot/blob/7652e85a4ebf0e64f2e49523af37b8c8721cca37/util/tmux.go#L52
When I run that in the same environment, I get an error saying failed to connect to server
. It looks like if I explicitly start up a session using something like tmux new-session -s my-session -d
the command works afterwards. Maybe that's an acceptable fix?
I'm using Amazon Linux 2 on an ec2 server. tmux version is 1.8.
Thank you for reporting this. I will look at this today.
I have very limited time today, but I'm more than happy to debug this with you. A couple of things:
For you specifically:
demo
script. That doesn't use Docker. If that works it's a docker problem. Make sure that the replbot
user is in the docker
group (see install instructions).Also:
gotty
branch, because I need (sigh) yet another layer of tmuxes to provide a web-based terminal, so this code will change soon anyway.I'm gonna try the current release again on a new box, maybe even an amazon linux box in ec2, so I can replicate.
I'm gonna try the current release again on a new box, maybe even an amazon linux box in ec2, so I can replicate.
Okay I spun up an Amazon Linux image (amzn2-ami-hvm-2.0.20210813.1-x86_64-gp2) and I can't even install REPLbot because there is no asciinema
package that works. I'm sorry, but I don't have a ton of Amazon Linux / rpm experience. If you give me some guidance how you installed asciinema that'd be great ... Alternatively, I will likely just release a version without the asciinema
dependency. That's mostly optional anyway.
I'll look more later today.
Okay with a custom package (without asciinema dependency) I was able to reproduce. I will provide a fix by tonight, I have to do some family things now :-D
Okay looks like it's this. The tmux version is really really old in Amazon Linux. I'll see if it's an easy fix.
Sep 25 17:11:25 ip-172-30-4-148.ec2.internal replbot[6536]: command output: usage: split-window [-dhvP] [-c start-directory] [-F format] [-p percentage|-l size] [-t target-pane] [command]
It appears that the command passed to tmux in 1.8 has to be one shell argument, and can be multiple in 2.6:
# tmux 1.8
[root@ip-172-30-4-148 ec2-user]# tmux new-session sleep 60
usage: new-session [-AdDP] [-F format] [-n window-name] [-s session-name] [-t target-session] [-x width] [-y height] [command]
# tmux 2.6
pheckel@plep ~/Code/replbot(a13d2c3*) » tmux new-session sleep 60
<sleeps>
I've gotten past the new-session thing, but there are other issues with this old tmux version. I will continue later today. So far:
tmux 1.8 vs 2.6 differences:
Okay, cool. I'll give it a try with a newer version soon. That's probably all I need. Thanks!
On Sat, Sep 25, 2021, 10:45 AM Philipp C. Heckel @.***> wrote:
I've gotten past the new-session thing, but there are other issues with this old tmux version. I will continue later today. So far:
tmux 1.8 vs 2.6 differences:
- command argument has to be one argument
- set-hook does not exist yet
- load-buffer tells me "buffer invalid"
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/binwiederhier/replbot/issues/39#issuecomment-927157919, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATAG6IXFVXAY4N6DMOVPIDUDYDE5ANCNFSM5EW6AIAQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
So I think I'm going to have to drop support for tmux 1.8. The load-buffers behavior is odd and not workable. It does not support loading buffers into tmux based on a buffer name, only based on automatic indices. While I could work around that, it's a ton of work and I'm not really willing to do that.
I'll add a version check when launching replbot so it'll fail early.
Sorry.
FYI tmux 1.8 is from 2015, so 6 years old. Not sure why a current image on AWS ships with that.
I released v0.5.1, which includes a tmux version check and hard fails when it's too low. It also shows the command errors in the log now more clearly.
I'm gonna close this. Let me know if you can't get it to run. If you are in AWS anyway, I suggest an Ubuntu AMI.
I'm an idiot. Try v0.5.2. I messed up the version check :grin:
I tried to start up a repl but it immediately failed with the following log output:
But when I switch user to the
replbot
user I'm able to start a tmux session without issue. I don't think this is related to #35, as I'm using the default set of scripts that came installed with the RPM package. I also double-checked thepython
repl that I used to try it out and it had regular unix line endings.Thanks so much for the project! I'm looking forward to playing with it. Right now I'm using it to learn about AWS CDK. I'm hoping to make a reusable stack that anyone can use to stand up a replbot server on an ec2 machine.