bitbot-irc / bitbot

https://bitbot.dev | Python3 event-driven modular IRCv3 bot 🤖
GNU General Public License v2.0
136 stars 50 forks source link

Bitbotctl fails to find socket? #367

Open poVoq opened 1 year ago

poVoq commented 1 year ago

I am running bitbotd with the --config option to load a config file from a custom location and point the bot to a custom data directory. This works perfectly fine with bitbotd.

However bitbotctl fails with the following error:

May 27 20:37:47 host systemd[1]: Reloading bitbot.service - IRCv3 bot...
░░ Subject: A reload job for unit bitbot.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A reload job for unit bitbot.service has begun execution.
░░ 
░░ The job identifier is 173102.
May 27 20:37:47 host BitBot[709026]: Traceback (most recent call last):
May 27 20:37:47 host BitBot[709026]:   File "/opt/bitbot/bitbotctl", line 46, in <module>
May 27 20:37:47 host BitBot[709026]:     sock.connect(args.socket)
May 27 20:37:47 host BitBot[709026]: FileNotFoundError: [Errno 2] No such file or directory
May 27 20:37:47 host systemd[1]: bitbot.service: Control process exited, code=exited, status=1/FAILURE

I am guessing that bitbotctl also needs to be told about the custom data folder in which the bot.sock etc. can be found?

Or is this caused by something else?

As I apparently can't figure out the master-password without bitbotctl this is kind of a breaking bug, despite the bot working fine otherwise.

Thanks for the help.

examknow commented 1 year ago

I think we discussed this on IRC a few weeks ago. For some reason, bitbot isn't able to find your socket file automatically in your specific environment. To remedy this, you need to specify the full path to your bot.sock file using the -s option (refer back to our IRC discussion for more specific usage details). You'll also need to update your systemd unit files accordingly.

Additionally, if someone else could reproduce this in their environment and report to this issue that would be awesome. I can't imagine how this would be a bug in bitbot but if it is I'd like to figure that out.

poVoq commented 1 year ago

I am running it in a venv if that helps figuring out what the problem might be.

Ah, that sounds promising. So I start it with bitbotctl -s /opt/bitbot/data/bot.sock or so? Edit: seems to work. Thanks!