opensourcehacker / sevabot

A Skype bot supporting integration with external services
http://sevabot-skype-bot.readthedocs.org/
565 stars 121 forks source link

Issues after starting sevabot (Ubuntu 12.04) #24

Closed kelvinlouis closed 11 years ago

kelvinlouis commented 11 years ago

Hey guys,

After installing sevabot and trying to run it, I got the following messages:

(venv)root@sx3:~/sevabot# sevabot
Starting sevabot
Discovered module ping: /root/sevabot/modules/ping.sh
Discovered module sad: /root/sevabot/modules/sad.py
Discovered module timeout: /root/sevabot/modules/timeout.sh
Discovered module memoryhog: /root/sevabot/modules/memoryhog.sh
Discovered module soundcloud: /root/sevabot/modules/soundcloud.rb
Discovered module weather: /root/sevabot/modules/weather.py
Skype API connection established
opened
Traceback (most recent call last):
  File "/root/sevabot/venv/bin/sevabot", line 8, in <module>
    load_entry_point('sevabot==1.1.dev0', 'console_scripts', 'sevabot')()
  File "/root/sevabot/sevabot/frontend/main.py", line 139, in entry_point
    exit_code = plac.call(main)
  File "/root/sevabot/venv/local/lib/python2.7/site-packages/plac-0.9.1-py2.7.eg                                    g/plac_core.py", line 309, in call
    cmd, result = parser_from(obj).consume(arglist)
  File "/root/sevabot/venv/local/lib/python2.7/site-packages/plac-0.9.1-py2.7.eg                                    g/plac_core.py", line 195, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "/root/sevabot/sevabot/frontend/main.py", line 89, in main
    sevabot.start()
  File "/root/sevabot/sevabot/bot/bot.py", line 28, in start
    self.skype = Skype4Py.Skype(Transport='x11')
  File "build/bdist.linux-i686/egg/Skype4Py/skype.py", line 250, in __init__
  File "build/bdist.linux-i686/egg/Skype4Py/api/posix.py", line 40, in SkypeAPI
  File "build/bdist.linux-i686/egg/Skype4Py/api/posix_x11.py", line 254, in __in                                    it__
Skype4Py.errors.SkypeAPIError: Could not open XDisplay
Segmentation fault (core dumped)

Any idea why this is happening? Is something wrong with Skype4Py?

Thanks Kelvin

grundic commented 11 years ago

Hello! This could happen if you are trying to run swvabot from terminal, which has not DISPLAY variable:

DISPLAY=:0
export DISPLAY

Or you can connect via VNC, and run shell - issue should be solved.

miohtama commented 11 years ago

Documented https://github.com/opensourcehacker/sevabot/commit/31eb43d9e3cefad29591847cb342cc9cf423b915

kelvinlouis commented 11 years ago

I tried setting the DISPLAY variable to 0 or 1 and I still got the same issue. I read in a couple of other places that there are issues with Skype4Py and latest Ubuntu versions.

grundic commented 11 years ago

Hm.. Strange. Have you tried starting application from VNC, when X daemon is running?

kelvinlouis commented 11 years ago

I just noticed that I wasn't running the commands with the skype user. I set export DISPLAY=:1 and I got the following messages:

(venv)skype@server:~/sevabot$ sevabot
Starting sevabot
Discovered module ping: /home/skype/sevabot/modules/ping.sh
Discovered module sad: /home/skype/sevabot/modules/sad.py
Discovered module timeout: /home/skype/sevabot/modules/timeout.sh
Discovered module memoryhog: /home/skype/sevabot/modules/memoryhog.sh
Discovered module soundcloud: /home/skype/sevabot/modules/soundcloud.rb
Discovered module weather: /home/skype/sevabot/modules/weather.py
Skype API connection established
opened
Attaching to Skype
thread started
sending u'#0 NAME Skype4Py'
received u'#0 CONNSTATUS OFFLINE'
attachment: 2
Traceback (most recent call last):
  File "/home/skype/sevabot/venv/bin/sevabot", line 8, in <module>
    load_entry_point('sevabot==1.1.dev0', 'console_scripts', 'sevabot')()
  File "/home/skype/sevabot/sevabot/frontend/main.py", line 139, in entry_point
    exit_code = plac.call(main)
  File "/home/skype/sevabot/venv/local/lib/python2.7/site-packages/plac-0.9.1-py2.7.egg/plac_core.py", line 309, in call
    cmd, result = parser_from(obj).consume(arglist)
  File "/home/skype/sevabot/venv/local/lib/python2.7/site-packages/plac-0.9.1-py2.7.egg/plac_core.py", line 195, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "/home/skype/sevabot/sevabot/frontend/main.py", line 89, in main
    sevabot.start()
  File "/home/skype/sevabot/sevabot/bot/bot.py", line 34, in start
    self.skype.Attach()
  File "build/bdist.linux-i686/egg/Skype4Py/skype.py", line 408, in Attach
  File "build/bdist.linux-i686/egg/Skype4Py/api/posix_x11.py", line 386, in attach
  File "build/bdist.linux-i686/egg/Skype4Py/api/__init__.py", line 163, in set_attachment_status
  File "build/bdist.linux-i686/egg/Skype4Py/skype.py", line 35, in attachment_changed
Skype4Py.errors.SkypeAPIError: Skype connection refused
thread finished
closed

I tried to login via echo accname pw | skype --pipelogin, before running sevabot, but that didn't work. Any idea why I can't connect to skype?

miohtama commented 11 years ago

Sounds like you are not allowing "External programs to control Skype" in Skype UI preferences

kelvinlouis commented 11 years ago

Do you know if there is a way to set this without using the UI? I'm running on a terminal only server.

miohtama commented 11 years ago

Please read installation instructions for headless server:

https://sevabot-skype-bot.readthedocs.org/en/latest/ubuntu.html#setting-up-skype-and-remote-vnc