Can't start controller after port change

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.

Can't start controller after port change

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.
Can't start controller after port change
Can't start controller after port change
2021-10-06 06:16:32 - last edited 2022-09-22 14:47:28
Hardware Version: V4
Firmware Version: 4.4.4

Hi All,

 

I installed the controller in Ubuntu and it was working great.  I had a great idea to change the port to 80 as its easier to remember...I changed the HTTP port to 80 and now the controller wont' start.

 

When I check omada.properties, I can't see port 80 anywhere there and its showing the original pot 8088.  There are two files in the properties folder, both don't have it in there (log4j2.properties & omada.properties) both of which have a last modified date of a long time ago.  

 

Where can I find the port 80 to reset it back to 8088 and properly start the controller? I already migrated and connected all devices so I would prefer to recover then reconnecting every device.

 

Here is what the log says. 

 

running netstat -tulpn | grep 80 returns no results either

 

2021-10-06 05:06:31 [main] [INFO]-[SourceFile:29] - success to load configuration omada.properties
2021-10-06 05:06:32 [main] [INFO]-[SourceFile:91] - going to start local mongod.
2021-10-06 05:06:33 [main] [INFO]-[SourceFile:167] - mongodb process id is 2672
2021-10-06 05:06:33 [main] [INFO]-[SourceFile:148] - Mongo DB server started
2021-10-06 05:06:34 [main] [ERROR]-[SourceFile:46] - Port 80 is already in use.
2021-10-06 05:06:34 [main] [ERROR]-[SourceFile:71] - Port 80 is already in use. Release the port and try again.
2021-10-06 05:06:34 [main] [ERROR]-[SourceFile:270] - Environment is not ok for controller running

  0      
  0      
#1
Options
1 Accepted Solution
Re:Can't start controller after port change-Solution
2022-01-14 23:54:07 - last edited 2022-09-22 14:47:28

@MannyF 
I found a solution to this after I did the same thing (changed to port 80 and 443 for HTTP and HTTPS respectively) on my Linux controller instance v4.4.6. This requires a bit of DB and Linux administration chops. The gist of it is that although there are ports seemingly scattered in omada.properties, the ones set in the UI of the controller are stored in the mongodb instance that runs, so we have to go in there and poke the values. Shame on you tp-link for making this such a frustrating experience and requiring the following to fix instead of just poking some text file somewhere.

 

Not everything here will be necessarily the best way to do it, but this is how I did it. As always, backup before you poke things and don't blame me if this doesn't work for you:

  1. I opened a session as root on the host running the software
  2. Start mongod pointing at the data path that omada uses, and bind it to an interface you can access with a known port (I just used all interfaces since this is a safe home lab)
    1. mongod --port 28000 --dbpath /opt/tplink/EAPController/data/db --bind_ip 0.0.0.0
    2. I found the path to the db in the omada.properties file
    3. You can monitor the mongod instance with the log at /opt/tplink/EAPController/logs/mongod.log
    4. Starting this as the omada user may save you some headache later, but that's just speculation on my part and I used root
  3. Connect to the mongodb instance
    1. I used MongoDB Compass because I have no idea what I'm doing with MongoDB and wanted a nice graphical interface to explore with (I'd put a link here but this forum disallows it...)
    2. Within MongoDB Compass, I clicked Fill in connection fields individually and entered the hostname of my controller, and the port specified above. I also left the Authentication set to None.
  4. Within MongoDB Compass, browse to the omada > globalsetting collection and look for the document named "webPort"
    1. This document contains the ports that you want to correct
    2. I updated the ports back to their defaults and hit Update
  5. Shutdown the mongod instance on the controller
  6. Fix up permissions for the mongod data
    1. Probably because I started mongod as root earlier, the files written by mongod had permissions that weren't usable by the mongod process that tpeap starts up
    2. This showed up as a permission issue opening some file underneath /opt/tplink/EAPController/data/db
    3. chown -R omada:omada /opt/tplink/EAPController/data/db
  7. Start up the controller software again
    1. tpeap start
    2. It should work!
Recommended Solution
  4  
  4  
#2
Options
1 Reply
Re:Can't start controller after port change-Solution
2022-01-14 23:54:07 - last edited 2022-09-22 14:47:28

@MannyF 
I found a solution to this after I did the same thing (changed to port 80 and 443 for HTTP and HTTPS respectively) on my Linux controller instance v4.4.6. This requires a bit of DB and Linux administration chops. The gist of it is that although there are ports seemingly scattered in omada.properties, the ones set in the UI of the controller are stored in the mongodb instance that runs, so we have to go in there and poke the values. Shame on you tp-link for making this such a frustrating experience and requiring the following to fix instead of just poking some text file somewhere.

 

Not everything here will be necessarily the best way to do it, but this is how I did it. As always, backup before you poke things and don't blame me if this doesn't work for you:

  1. I opened a session as root on the host running the software
  2. Start mongod pointing at the data path that omada uses, and bind it to an interface you can access with a known port (I just used all interfaces since this is a safe home lab)
    1. mongod --port 28000 --dbpath /opt/tplink/EAPController/data/db --bind_ip 0.0.0.0
    2. I found the path to the db in the omada.properties file
    3. You can monitor the mongod instance with the log at /opt/tplink/EAPController/logs/mongod.log
    4. Starting this as the omada user may save you some headache later, but that's just speculation on my part and I used root
  3. Connect to the mongodb instance
    1. I used MongoDB Compass because I have no idea what I'm doing with MongoDB and wanted a nice graphical interface to explore with (I'd put a link here but this forum disallows it...)
    2. Within MongoDB Compass, I clicked Fill in connection fields individually and entered the hostname of my controller, and the port specified above. I also left the Authentication set to None.
  4. Within MongoDB Compass, browse to the omada > globalsetting collection and look for the document named "webPort"
    1. This document contains the ports that you want to correct
    2. I updated the ports back to their defaults and hit Update
  5. Shutdown the mongod instance on the controller
  6. Fix up permissions for the mongod data
    1. Probably because I started mongod as root earlier, the files written by mongod had permissions that weren't usable by the mongod process that tpeap starts up
    2. This showed up as a permission issue opening some file underneath /opt/tplink/EAPController/data/db
    3. chown -R omada:omada /opt/tplink/EAPController/data/db
  7. Start up the controller software again
    1. tpeap start
    2. It should work!
Recommended Solution
  4  
  4  
#2
Options