Closed ghost closed 3 years ago
I'm looking now
So I apologize for the logs being as bad as they are, and I think there is a lot of room for improvement. I think I may have to add some debug logging too, since this is clearly not helpful.
I tried the latest docker image and it "works for me", ... however I was able to produce the same output by making the actual script that you're running fail with exit 1
, e.g. /etc/replbot/script.d/failme
#!/bin/sh
exit 1
What you could also try a different --entrypoint /bin/sh
, and then run the script manually:
# On the laptop:
pheckel@laptop$ docker run --rm -it --entrypoint /bin/sh \
-v /etc/replbot:/etc/replbot \
-v /var/run/docker.sock:/var/run/docker.sock \
binwiederhier/replbot:v0.5.0
# We're now in the REPLbot image
/ # cd /etc/replbot/script.d/
/etc/replbot/script.d # ./ubuntu run abc
# We're now in the ubuntu image
root@7c57aa73e5b9:/# ls
If that works then it's got to be something with the tmux calls
I think I found the issue, oops on my part. Looks like all of the scripts are in DOS format 🤦🏼♂️
root@localhost:/etc/replbot/script.d# ./ubuntu run abc
-bash: ./ubuntu: /bin/sh^M: bad interpreter: No such file or directory
Converted them to Unix..
dos2unix: converting file docker-kill to Unix format...
root@localhost:/etc/replbot/script.d/helpers# dos2unix docker-run
dos2unix: converting file docker-run to Unix format...
root@localhost:/etc/replbot/script.d# dos2unix ubuntu
dos2unix: converting file ubuntu to Unix format...
And like magic..
> -v /etc/replbot:/etc/replbot \
> -v /var/run/docker.sock:/var/run/docker.sock \
> binwiederhier/replbot
2021/09/22 20:27:00 Discord connected as user REPLbot/880575037789323355
2021/09/22 20:27:06 [702977813409693766_890333410814480486] Starting session, requested by 360597009301897236
2021/09/22 20:27:06 [702977813409693766_890333410814480486] Started REPL session
Sorry for the time waste! I think it was due to me copying the files from my local replbot repo which was last edited in VS code, but I'll have to dig into that more. Thank you for looking into it anyways 😅
So the scripts we ship with are fine?
Also: not a waste, since it just means I need better logging.
Yep! I noticed the bash interpreter issue which was due to all the scripts being in DOS format (pulled from my Windows desktop). It was seeing ^M as an illegal character. I find it weird they got converted automatically but I'll have to dig into that more. After cloning the repo directly to Ubuntu and copying from there, it all works fine.
Using the latest Docker image, replbot seems to be unable to start tmux. Also using the latest config and script.d files. I haven't had much time to look into this yet and have not tested using replbot straight from Go or with a direct install, but figured I'd at least document it here. I am using the latest version of Docker and the host is Ubuntu 20.04.3. Let me know if I can provide any more info!