question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Controller sometimes cannot start because of old controller or connections

See original GitHub issue

We occasionally run into situations where tests fail because the controller hasn’t been shut down cleanly, like the following:

======================================================================  
ERROR: testLinear5 (__main__.testLinearOVSUser)  
Ping test on a 5-switch topology  
----------------------------------------------------------------------  
Traceback (most recent call last):  
  File "mininet/test/test_nets.py", line 70, in testLinear5  
    mn = Mininet( LinearTopo( k=5 ), self.switchClass, Host, Controller, waitConnected=True )  
  File "build/bdist.linux-i686/egg/mininet/net.py", line 170, in __init__  
    self.build()  
  File "build/bdist.linux-i686/egg/mininet/net.py", line 417, in build  
    self.buildFromTopo( self.topo )  
  File "build/bdist.linux-i686/egg/mininet/net.py", line 387, in buildFromTopo  
    self.addController( 'c%d' % i, cls )  
  File "build/bdist.linux-i686/egg/mininet/net.py", line 260, in addController  
    controller_new = controller( name, **params )  
  File "build/bdist.linux-i686/egg/mininet/node.py", line 1262, in __init__  
    self.checkListening()  
  File "build/bdist.linux-i686/egg/mininet/node.py", line 1280, in checkListening  
    '\n'.join( clist ) )  
Exception: Please shut down the controller which is running on port 6633:  
Active Internet connections (servers and established)   
tcp        0      0 127.0.0.1:60297         127.0.0.1:6633          TIME_WAIT   -                  
tcp        0      0 127.0.0.1:60296         127.0.0.1:6633          TIME_WAIT   -                  
tcp        0      0 127.0.0.1:60298         127.0.0.1:6633          TIME_WAIT   -                  
tcp        0      0 127.0.0.1:60299         127.0.0.1:6633          TIME_WAIT   -                  
tcp        0      0 127.0.0.1:60300         127.0.0.1:6633          TIME_WAIT   -                  

----------------------------------------------------------------------  
Ran 12 tests in -25078.580s  

Casting aside the clock problem (we can’t reliably set the time in Ubuntu without it getting messed up), it seems that there is a race condition where our switches and/or controller are supposed to have shut down but starting up a new controller fails because the old controller still seems to be running and/or it hasn’t released its port.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
maikarpeycommented, Apr 6, 2018

Execute the following command to kill it: sudo fuser -k 6633/tcp

0reactions
bidhovbizarcommented, Apr 23, 2021

Run netstat -ltnp | grep ‘6653’ -(1)

which will give you the process id which is using that port. If you find that PID as 1234 then run

kill -9 1234. -(2)

Recheck with (1) to see if the process is actually dead or did somethng else bring it back up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 ways to fix an Xbox One controller that won't connect
If your Xbox controller won't connect, you should first make sure the batteries aren't dead. You can also try updating your Xbox One ......
Read more >
How to Fix an Xbox One Controller That Won't Turn On - Lifewire
If your Xbox One controller won't turn on, check the batteries, connections, and firmware, and try a USB cable if all else fails....
Read more >
SOLVED: Why isn't my controller connecting/staying ... - iFixit
There are many reasons you could be having connection problems. First, try replacing the batteries; the controller might not have enough power ......
Read more >
Xbox One Controller Not Working? Tips on How to Fix It
If your controller doesn't pair using the buttons, try using a USB cable to pair it. Simply plug the cable into a USB...
Read more >
How To Fix an Xbox Controller That Won't Connect to PC - Alphr
1. Download and install Xbox Accessories. 2. Connect the controller to your PC via a USB cable. 3. Open the Xbox Accessories software....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found