agical / friendsunhosted

FRIENDS#UNHOSTED - Own your network!
http://friendsunhosted.com/
Other
13 stars 2 forks source link

errors on second run of start_servers.sh #13

Open jancborchardt opened 11 years ago

jancborchardt commented 11 years ago

It seems like there should be a check if the logs directory already exists, and also all the servers which have been started via the script (Selenium, Buster, Python, ?) should be ended when you abort it with ^C.

Here’s the error log on second run:

user@Rechenknecht:~/friendsunhosted$ sh start_servers.sh 
mkdir: cannot create directory `logs': File exists
/home/user/friendsunhosted
user@Rechenknecht:~/friendsunhosted$ Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/SimpleHTTPServer.py", line 220, in <module>
    test()
  File "/usr/lib/python2.7/SimpleHTTPServer.py", line 216, in test
    BaseHTTPServer.test(HandlerClass, ServerClass)
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 595, in test
    httpd = ServerClass(server_address, HandlerClass)
  File "/usr/lib/python2.7/SocketServer.py", line 408, in __init__
    self.server_bind()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind
    SocketServer.TCPServer.server_bind(self)
  File "/usr/lib/python2.7/SocketServer.py", line 419, in server_bind
    self.socket.bind(self.server_address)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use
Aug 17, 2012 4:25:04 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
Setting system property webdriver.chrome.bin to /opt/google/chrome/google-chrome
Setting system property webdriver.chrome.driver to /home/daniel/bin/chromedriver
46 [main] INFO org.openqa.selenium.server.SeleniumServer - Writing debug logs to logs/seleniumserver.log
46 [main] INFO org.openqa.selenium.server.SeleniumServer - Java: Sun Microsystems Inc. 20.0-b12
47 [main] INFO org.openqa.selenium.server.SeleniumServer - OS: Linux 2.6.38.3+ i386
83 [main] INFO org.openqa.selenium.server.SeleniumServer - v2.20.0, with Core v2.20.0. Built from revision 16008
650 [main] INFO org.openqa.selenium.server.SeleniumServer - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
654 [main] INFO org.openqa.jetty.http.HttpServer - Version Jetty/5.1.x
658 [main] INFO org.openqa.jetty.util.Container - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
660 [main] INFO org.openqa.jetty.util.Container - Started HttpContext[/selenium-server,/selenium-server]
661 [main] INFO org.openqa.jetty.util.Container - Started HttpContext[/,/]
Address already in use. Pick another port with -p/--port to start buster-server
2548 [main] INFO org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.servlet.ServletHandler@b8c8e6
2548 [main] INFO org.openqa.jetty.util.Container - Started HttpContext[/wd,/wd]
2558 [main] WARN org.openqa.jetty.util.ThreadedServer - Failed to start: SocketListener0@0.0.0.0:4444
Exception in thread "main" java.net.BindException: Selenium is already running on port 4444. Or some other service is.
    at org.openqa.selenium.server.SeleniumServer.start(SeleniumServer.java:470)
    at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:283)
    at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:246)
    at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:54)
brolund commented 11 years ago

The rare problem has so far been that a server crashes, then I can just rerun the script and get it up again, not other problems (that I know of). But I wouldn't mind a fix. :-)