MusicGenerator / mumble-ruby-pluginbot

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

Bot not connecting Cannot assign requested address #146

Closed sync1211 closed 7 years ago

sync1211 commented 8 years ago

As the title says my bot cannot connect to the mumble-server (which is hosted on the same device). After starting the bot it tells me:

Killing running ruby scripts of user root
Killing running mpd instances of user root
Failed to bind to '127.0.0.1:7701': Cannot assign requested address 
Using /usr/local/rvm/gems/ruby-2.1.1 with gemset bots

Your bot(s) should now be connected to the configured Mumble server.

_LOGGING/DEBUGGING_
  If something doesn't work, start this script with the additional parameter debug:
  ~/src/mumble-ruby-pluginbot/scripts/start.sh debug

  Then take a look into the logfile within /root/logs/.

_START AS APPROPRIATE USER_
  Make sure to run this script as user botmaster if you used the official
  installation documentation and DO NOT RUN THIS SCRIPT AS root.
  The official documentation can be found at https://wiki.natenom.com/w/Mumble-Ruby-Pluginbot

_UPDATE THE BOT (AND ITS DEPENDENCIES)_
  If you want to update the Mumble-Ruby-Pluginbot (and its dependencies) please
  run ~/src/mumble-ruby-pluginbot/scripts/updater.sh

_OFFICIAL DOCUMENTATION_
  Also please reread the official documentation at https://wiki.natenom.com/w/Mumble-Ruby-Pluginbot
  if you have further problems :)

_BUGS/WISHES/IDEAS_
  If you think you found a bug, have a wish for the bot or some ideas please don't
  hesitate to create an issue at https://github.com/dafoxia/mumble-ruby-pluginbot/issues

Have fun with the Mumble-Ruby-Pluginbot :)

Additional information: -The server is password-protected, but the bot should have the right password. -I'm using an raspberry pi type B with ~16 GB. -The Pi is running a LAN > Wifi bridge.

Thank you in advance!

dafoxia commented 8 years ago

First a word to your additional information: Maybe your PI will lack of power for all this things. To your problem: It seems that no mpd-instance is running and listening on localhost at port 7701.

Please post your logfile.

LOGGING/DEBUGGING If something doesn't work, start this script with the additional parameter debug: ~/src/mumble-ruby-pluginbot/scripts/start.sh debug

And DO NOT run the script as root!

sync1211 commented 8 years ago

Somehow it can't find the file, when I'am logged in as botmaster: bash: /home/botmaster/src/mumble-ruby/scripts/start.sh: No such file or directory

I have used root (via sudo su) while installing the bot, does that change anything?

the debug command outputs the following lines:

        from /root/src/mumble-ruby-pluginbot/pluginbot.rb:6:in `<main>'
/usr/local/rvm/gems/ruby-2.1.1@bots/gems/ffi-1.9.10/lib/ffi/library.rb:133:in `block in ffi_lib': Could not open library 'libcelt0.so': libcelt0.so: cannot open shared object file: No such file or directory (LoadError)
        from /usr/local/rvm/gems/ruby-2.1.1@bots/gems/ffi-1.9.10/lib/ffi/library.rb:100:in `map'
        from /usr/local/rvm/gems/ruby-2.1.1@bots/gems/ffi-1.9.10/lib/ffi/library.rb:100:in `ffi_lib'
        from /usr/local/rvm/gems/ruby-2.1.1@bots/gems/celt-ruby-0.0.1/lib/celt-ruby.rb:9:in `<module:Celt>'
        from /usr/local/rvm/gems/ruby-2.1.1@bots/gems/celt-ruby-0.0.1/lib/celt-ruby.rb:6:in `<top (required)>'
        from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:128:in `require'
        from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
        from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:39:in `require'
        from /usr/local/rvm/gems/ruby-2.1.1@bots/gems/mumble-ruby-1.1.2/lib/mumble-ruby.rb:2:in `<top (required)>'
        from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:128:in `require'
        from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
        from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:39:in `require'
        from /root/src/mumble-ruby-pluginbot/pluginbot.rb:6:in `<main>'

Do you think reinstalling the bot as botmaster without root would be worth trying?

dafoxia commented 8 years ago

Yes, install it as user new. Please follow Natenoms guide, it is well tested and works. ;)

sync1211 commented 8 years ago

Ok I've reinstalled everything and now it connects to the server, but immediatly disconnects. The debug command outputs the following lines:

[killduckthread] can't kill because wrong argument type nil (expected VM/thread)
Plugin ./plugins/version.rb loaded.
Plugin ./plugins/youtube.rb loaded.
Plugin ./plugins/null.rb loaded.
Plugin ./plugins/mpd.rb loaded.
Plugin ./plugins/control.rb loaded.
Plugin ./plugins/radiostream.rb loaded.
Plugin ./plugins/ektoplazm.rb loaded.
Plugin ./plugins/soundcloud.rb loaded.
Plugin ./plugins/bandcamp.rb loaded.
Plugin ./plugins/messages.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/mumble-ruby-1.1.2/lib/mumble-ruby/audio_player.rb:53:in `initialize': No such file or directory @ rb_sysopen - /home/botmaster/mpd1/mpd.fifo (Errno::ENOENT)
        from /home/botmaster/.rvm/gems/ruby-2.2.1@bots/gems/mumble-ruby-1.1.2/lib/mumble-ruby/audio_player.rb:53:in `open'
        from /home/botmaster/.rvm/gems/ruby-2.2.1@bots/gems/mumble-ruby-1.1.2/lib/mumble-ruby/audio_player.rb:53:in `stream_named_pipe'
        from /home/botmaster/src/mumble-ruby-pluginbot/pluginbot.rb:217: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)
dafoxia commented 8 years ago

Don't miss step 9...

9 Set up MPD (Music Player Daemon) [https://wiki.natenom.com/w/Installation_of_mumble-ruby-pluginbot]

sync1211 commented 8 years ago

I've now redone step 9 (and even reinstalled mpd), but nothing changed. The debug log still outputs the same error.

Could it be a problem that mpd has been installed as root and the user botmaster has no root access (=not being included in the sudoers file)?

Natenom commented 8 years ago

If you follow the installation instructions you install a "local" mpd for user botmaster and you do NOT use the systems mpd.

BTW: For the installation howto to work you must follow all steps and not only choose some of them and hope that it works; it won't.

sync1211 commented 8 years ago

So far I've only skipped the 'On Arch Linux only' steps in the tutorial. As for the mpd: I noticed that when I'm executing rvm use @bots in ~/src/mumble-ruby/ it says that ruby-2.1.1 isn't installed. But as far as I know ruby should be installed (I've executed rvm install ruby --latest). Also there is a mpd installed by botmaster (ruby-mpd) and one installed by apt-get (mpd) on my raspberry PI.

dafoxia commented 8 years ago

please post the output of mpd ~/mpd1/mpd.conf (if there is any)

the output of ps aux | grep mpd

and the content of ~/mpd1/mpd.conf

All commands as user botmaster.

sync1211 commented 8 years ago

Output of mpd ~/mpd1/mpd.conf: Failed to bind to '127.0.0.1:7701': Cannot assign requested address

Output of ps aux | grep mpd: 1008 23569 0.0 0.2 2020 1208 pts/1 S+ 19:06 0:00 grep --color=auto mpd

Output of ~/mpd1.mpd.conf: bash: /home/botmaster/mpd1.mpd.conf: No such file or directory

Stunner1984 commented 8 years ago

location of mpd.conf should be in:

/home/botmaster/mpd1/mpd.conf

sync1211 commented 8 years ago

location of mpd.conf should be in:

/home/botmaster/mpd1/mpd.conf

As far as I know it is located there in my system. The ~ equals /home/botmaster/.

dafoxia commented 8 years ago

I've read your first post more careful. Do you use the https://www.raspberrypi.org/products/model-b/ or https://www.raspberrypi.org/products/raspberry-pi-2-model-b/ ?

The first one has not enough power to drive a bot without maximum overclocking an optimized kernel for the bot and NO OTHER things running on it. In this setting it is still not able to play a song without stuttering. In short: This device has not enough power.

For the second there is a image for download aviable. I recommend to update the bot after first start as well you should update the distro itself. The image is basing on a minimal raspian only extended for the bot functionality, there is no other ballast on it.

To your issue: mpd did not start for a unknown reason to me. Maybe the mpd documentation or google could help. Search for mpd, Cannot assign requested address

sync1211 commented 8 years ago

I'm using the model B with a bit of overclocking (800MHz). So, does that mean, that the bot has no chance of running on my Raspberry PI? (In that case it isn't that bad, since I'm already planning on upgrading to a V2 Type B.)

Thank you very much for all your support and time!