MusicGenerator / mumble-ruby-pluginbot

A mumble-ruby bot (plugin-based)
MIT License
33 stars 9 forks source link

Bot connects and disconnects instantly #147

Closed Lazalatin closed 8 years ago

Lazalatin commented 8 years ago

The bot connects perfectly to the server and leaves it after half a second.
debug option gives:

Plugin ./plugins/youtube.rb loaded.
Plugin ./plugins/null.rb loaded.
Plugin ./plugins/control.rb loaded.
Plugin ./plugins/mpd.rb loaded.
Plugin ./plugins/ektoplazm.rb loaded.
Plugin ./plugins/version.rb loaded.
Plugin ./plugins/messages.rb loaded.
Plugin ./plugins/bandcamp.rb loaded.
Plugin ./plugins/radiostream.rb loaded.
Plugin ./plugins/soundcloud.rb loaded.
Config loaded!
parse extra config
Own Config loading and overwriting default settings!
pluginbot is starting...
start
/home/botmaster/.rvm/gems/ruby-2.2.1@bots/gems/ruby-mpd-0.3.3/lib/ruby-mpd.rb:106:in `connect': Unable to connect (possibly too many connections open) (MPD::ConnectionError)
        from /home/botmaster/src/mumble-ruby-pluginbot/plugins/mpd.rb:84:in `init'
        from /home/botmaster/src/mumble-ruby-pluginbot/pluginbot.rb:233:in `block in mumble_start'
        from /home/botmaster/src/mumble-ruby-pluginbot/pluginbot.rb:232:in `each'
        from /home/botmaster/src/mumble-ruby-pluginbot/pluginbot.rb:232:in `mumble_start'
        from /home/botmaster/src/mumble-ruby-pluginbot/pluginbot.rb:565:in `block in <main>'
        from /home/botmaster/src/mumble-ruby-pluginbot/pluginbot.rb:560:in `loop'
        from /home/botmaster/src/mumble-ruby-pluginbot/pluginbot.rb:560:in `<main>'
Connecting to the server is still ongoing.
connected
[killduckthread] can't kill because wrong argument type nil (expected VM/thread)
initplugins

I followed natenoms guide to this bot: https://wiki.natenom.com/w/Installation_of_mumble-ruby-pluginbot

Any suggestions?

dafoxia commented 8 years ago

Is mpd running and listening at the desired port? Per standard for pluginbot port 7701.

Lazalatin commented 8 years ago

netstat -tulpen shows

Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program name
tcp        0      0 127.0.0.1:7701          0.0.0.0:*               LISTEN      1003       38839       9996/mpd

ps aux | grep mpd shows botmast+ 9996 0.0 0.1 408064 8596 ? Ssl Mär03 0:00 mpd /home/botmaster/mpd1/mpd.conf


~/mpd1/mpd.conf:

music_directory         "/data/botmaster/music"
playlist_directory      "/home/botmaster/mpd1/playlists"
db_file                 "/home/botmaster/mpd1/tag_cache"
log_file                "/home/botmaster/mpd1/mpd1.log"
pid_file                "/home/botmaster/mpd1/pid"
state_file              "/home/botmaster/mpd1/state"
sticker_file            "/home/botmaster/mpd1/sticker.sql"
user                    "botmaster"
bind_to_address         "localhost"
port                    "7701"

input {
  plugin                "curl"
}

audio_output {
        type            "fifo"
        name            "FIFO-Bot1"
        path            "/home/botmaster/mpd1/mpd.fifo"
        format          "48000:16:1"
  mixer_type            "software"
}
filesystem_charset      "UTF-8"
id3v1_encoding          "UTF-8"
buffer_before_play      "20%"
audio_buffer_size       "20480"
volume_normalization    "yes"

So the service runs since March 3rd but the bot never showed up again. Only restarting with the start.sh let it show up for half a second, after which it disconnects again.

Natenom commented 8 years ago

I wonder about the error message "Unable to connect (possibly too many connections open)".

Could you please try to connect to your MPD via mpc?

mpc -p 7701 status

And post the output?

Lazalatin commented 8 years ago

Hmm, that's strange. After executing the stated command it says:
error: Connection closed by the server

Natenom commented 8 years ago

Can you please also check the mpd log?

cat /home/botmaster/mpd1/mpd1.log

Lazalatin commented 8 years ago
Mar 06 12:40 : avahi: Service 'Music Player' successfully established.
Mar 06 12:40 : client: libwrap refused connection (libwrap=mpd) from 127.0.0.1:59057
Mar 06 12:46 : client: libwrap refused connection (libwrap=mpd) from 127.0.0.1:59068
Mar 06 12:50 : client: libwrap refused connection (libwrap=mpd) from 127.0.0.1:59070

Seems I am trying to connect via the wrong ports?! I am a bit confused. (Because I gave the parameter -p 7701 when using mpc)

Natenom commented 8 years ago

Can you check for a configuration file of that libwrap service?

Natenom commented 8 years ago

Please take a look at https://bbs.archlinux.org/viewtopic.php?id=109962

Try to add mpd: ALL to /etc/hosts.allow

Natenom commented 8 years ago

Would you please also post the output of lsb_release -a

So we can add a side note to the installation tutorial.

Lazalatin commented 8 years ago

Thank for that link! Adding the line:
mpd: LOCAL
into /etc/hosts.allow did the trick. The bot now stays on the server.


As you requested:

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.4 LTS
Release:    14.04
Codename:   trusty
Natenom commented 8 years ago

Nice, thanks.

Close...

Natenom commented 8 years ago

Added to https://wiki.natenom.com/w/Installation_of_mumble-ruby-pluginbot#Known_problems.

BTW: When you are on the Mumble server you can do a "!helpme sometext ..." if you can't enter a channel.

Lazalatin commented 8 years ago

Thanks you for your time and help! And for that hint of course :)