MATLAB: Do I get the error “Failed to open the TCP port number in the license” when starting the License Manager on Linux

Why do I get the error "Failed to open the TCP port number in the license" in the debug log file when starting the License Manager on Linux?
"Failed to open the TCP port number in the license"

Best Answer

The most common causes of the issues: 
1) Port Conflict
2) License Manager restarted too soon after shutdown
To resolve the port conflict issue: 
  • Check whether or not the specified port on the "SERVER" line of the server license file (license.dat) is being by another process.
    • For example: SERVER ServerName 0adbdea7de8d 27000
      • The Network License Manager is using port 27000.
    • You can use the following command to verify the port is not in use: 
      • "netstat -anp | grep Port#" or "netstat -tulpn | grep port#"
        • For example to verify the port "27000" is not in use:
          • "netstat -anp | grep 27000" or "netstat -tulpn | grep 27000"
      • Any output indicates the port is being used by a different service.
  • To resolve the issue, you can either change the port number in the server license file or try killing the service running in port 27000.
To resolve the license manager started too soon:
  • This expected behavior on Linux after stopping the service the port is held for a certain amount of time by the OS.
  • This is likely to happen if the license manager was shut down using the 'kill -9 lmgrd' command rather than using the 'lmdown' command. In this case, you might have to wait at least 60 seconds from the time when the License Manager is shutdown until restarting. This will allow the OS to recognize that the license server port is available to use.
  • If you are still unable to restart the license manager, you need to restart the license server.