11 Licensing FAQ

11.1 General questions

11.1.1 How do I know what version/expiry/hostid/port I have in my license file?

The license file is a plain text file. Open it in any text editor and follow Sec. 5.2 (License File).

11.1.2 Can I edit the license file?

You can change the hostname, port number(s), add an OPTIONS section and edit comments. Any other edits (in particular changing the hostid) will invalidate the license file.

11.1.3 Can I reserve some of my floating tokens to a specific IP/username/group?

To reserve a certain number license features for a particular user or IP address, you must create an additional options file and use the RESERVE option. For details see Sec. 9.1 (Options file). For example, to reserve one PTS token for user username make an options file res.opt with content

RESERVE 1 PTS USER username

and add the following to your license file:

VENDOR MOSEKLM OPTIONS=res.opt

11.1.4 Can I check out licenses from more than one location?

You can concatenate multiple license search paths (local or remote) with the operating system’s path separator. MOSEK will then sequentially try to check out a license from all these locations until one is available. For example

MOSEKLM_LICENSE_FILE=/home/user/licenses/mosek.lic:27007@licensehost        (Linux/OSX)
MOSEKLM_LICENSE_FILE=c:\users\mylogin\licenses\mosek.lic;27007@licensehost  (Windows)

11.1.5 Can I use more than one hostid?

Yes, for a server license. In exceptional situations we can generate a server license file with a list of MAC addresses as hostid. At least one of them has to be active at any time for MOSEK to work. For a floating license we can use only a single hostid.

11.1.6 My machine has many network interfaces and I get a long list of hostids. Which one should I use?

Ideally choose the MAC address of some permanent physical device (network card) that is expected to be permanently associated with the machine. Avoid MAC addresses of temporary/virtual devices/interfaces which can easily disappear, rendering the license file invalid.

11.1.7 Is it possible to use MOSEK with a floating license on a machine detached from the LAN(WAN)?

Yes. It is possible to use the lmborrow functionality. See the Sec. 9.2 (Borrowing a license).

11.1.8 Is it possible to host a token server in the cloud?

Yes, but you will have to create a (small) instance with a permanent MAC address to be used as hostid. An example is described in Sec. 10 (License in a Cloud Computing Environment).

11.1.9 Do you have a complete licensing guide that covers all of FLEXlm options?

The ultimate guide is at FLEXnet license administration guide.

11.1.10 I know the hostid of the license server, but what about the clients?

The clients, that is machines on which MOSEK optimizations will actually be performed, can be arbitrary, as long as they can connect to the license server to check out a token. The floating license restricts only the physical machine for the token server.

11.1.11 What does MOSEK use to verify the license?

Only the license file. There is no external communication whatsoever.

11.1.12 When does MOSEK return the floating license token?

By default at the end of the session/process or when the MOSEK environment is deleted. This reduces the checkout overhead if one process runs multiple optimizations. However, this is completely customizable. For example, you can return the token after each optimization or upon calling a dedicated method. Your API’s manual has instructions on how to do it in the section Technical guidelines / The license system.

11.2 Floating license issues

11.2.1 The lmutil and lmgrd will not start on Linux: No such file or directory.

If you run a command from the licensing system and get this error:

user@hostname:~/path_to_mosek$ ./lmutil
./lmutil: No such file or directory

then most likely you are missing the Linux Standard Base (LSB) package. LSB version at least 3 is required. On Ubuntu the latest version of LSB can be installed with the command apt-get install lsb.

11.2.2 I get the error Vendor daemon is too old.

You are running an older license server (for example, from version 7) and tried to connect to it with a much more recent client (for example, from version 9). The lmgrd license server must be at least as new as all the clients who attempt to connect to it. Use the license server distributed with the most recent version of the clients in use. We occasionally update the FLEXlm binaries inside MOSEK and then an incompatibility with older license servers may occur.

11.2.3 The license server will not start.

Always check the server’s log file lmgrd.log. It will explain the source of the problem. Typical issues are:

  • Wrong hostname:

    11:55:03 (lmgrd) "HOSTNAME_REAL": Not a valid server hostname, exiting.
    11:55:03 (lmgrd) Valid license server system hosts are: "HOSTNAME_LICFILE"
    

    The hostname in the license file is not the actual hostname of the computer. Either you are running the license server on the wrong machine, or using a wrong file or something changed on the machine and you should contact us for a new license file.

  • Wrong hostid:

    8:46:36 (MOSEKLM) Wrong hostid on SERVER line for license file:
    8:46:36 (MOSEKLM) C:\Program Files\Mosek\10.1\tools\platform\win64x86\bin\mosek.lic
    8:46:36 (MOSEKLM) SERVER line says a6321bc7ff3f, hostid is af638abf82aa 127c4da8f212
    
    8:46:36 (MOSEKLM) (@MOSEKLM-SLOG@) HostID node-locked in license file: a6321bc7ff3f
    8:46:36 (MOSEKLM) (@MOSEKLM-SLOG@) HostID of the License Server: "af638abf82aa 127c4da8f212"
    8:46:36 (MOSEKLM) No valid hostids, exiting
    8:46:36 (MOSEKLM) EXITING DUE TO SIGNAL 25 Exit reason 2
    8:46:41 (lmgrd) MOSEKLM exited with status 25 (Invalid host)
    

    The hostid in the license file does not correspond to actual hardware. Possible reasons are:

    • you are running the license server on the wrong machine,

    • the network interface used for hostid disappeared because some changes were made to the hardware,

    • the network interface used for hostid disappeared because it was a virtual, temporary interface; you are advised to use hostids of physical hardware devices for best stability, see Sec. 6 (Hostname and Hostid),

    • you are using a wrong (perhaps old) license file.

    If the hostids / network interfaces indeed changed you will have to contact us for a new file.

  • Incorrect or unreadable license file, for example:

    18:54:46 (MOSEKLM) Invalid license key (inconsistent authentication code)
    

    It is possible that you invalidated the file by editing hostname or hostid or that you downloaded/saved it incorrectly. See Sec. 5.2 (License File) for how a floating license file should look. You should revert to the original file (if applicable) or contact us for a new license file, attaching the current one.

  • Could not open port:

    18:52:12 (lmgrd) Failed to open the TCP port number in the license.
    

    The token server or vendor daemon could not open a port. Possibly it is already open by another process, or there are firewall issues. In either case consult Sec. 7.3 (Changing default ports and firewall and antivirus issues) for a solution. Terminate any lmgrd or MOSEKLM processes running.

  • Invalid License File, on Unix:

    18:54:46 (lmgrd) Server's System Date and Time: Mon Jun 21 2021 18:45:01 CET
    18:54:46 (lmgrd) Invalid License File
    

    Can appear if the license file has permissions other than 644. Change the license file’s permissions to 644.

  • Hostname not in network database:

    11:55:03 (lmgrd) Unknown Hostname: HOSTNAME_LICFILE
    specified in the license file is not available in the local network database
    11:55:03 (lmgrd) EXITING DUE TO SIGNAL 33 Exit reason 1
    

    A rare error appearing on MAC where lmgrd exits almost immediately. The solution is to edit the file /etc/hosts in your system and add a line with the IP address and hostname of your machine.

11.2.4 The client cannot connect to the license server or license checkout times out.

The following symptoms can indicate firewall issues:

  • The client cannot connect to the license server. The error is MOSEK cannot connect to the license server or Operation now in progress.

  • The client cannot connect to the license server from a remote machine, but everything works when the client runs on the same machine as the server.

  • License checkout times out after about 60 seconds with message Timeout: operation now in progress.

First make sure that the license server is up and running and that the lmgrd.log file did not indicate any errors (see previous question). Assuming that, follow the instructions in Sec. 7.3 (Changing default ports and firewall and antivirus issues) to test and fix possible issues with open ports and firewalls.

This happens typically in networks with tight security settings. Occasionally antivirus software can trigger this problem.

11.2.5 I cannot check out a token even though there should be more available.

Most likely there are processes/users who checked out a license but never returned it. The lmgrd.log log file on the license server will contain the history of license ckeckouts and checkins which may be used to identify the culprit.

11.2.6 The floating license worked previously and now suddenly stopped.

The most typical reasons for this are:

  • The token server was terminated.

  • The hostid of the license server changed.

  • Something changed in the network configuration, for example there are new firewall or antivirus settings preventing the connection.

  • The server was restarted and now uses a different port or different vendor port.

  • You are trying to check out too many tokens.

Consult the error message reported by the MOSEK client for more information. Make sure that the license server is up and running and that the lmgrd.log file did not indicate any errors (see previous questions).

If the symptoms resemble Sec. 11.2.4 (The client cannot connect to the license server or license checkout times out.), then follow the instructions in Sec. 7.3 (Changing default ports and firewall and antivirus issues) to test and fix possible issues with open ports and firewalls.

If the reason is a change in hostid contact us for a new license file.

11.3 Local file issues

11.3.1 The Optimization Toolbox for Matlab or Rmosek says license has expired although I downloaded a new one.

After you put the license file in the right place restart Matlab or R. It caches the license. If that doesn’t help MOSEK probably uses another license path than you first thought. See next question.

11.3.2 MOSEK says there is no license file or that it expired.

If you are sure that your license file is valid and in the right place, then it is possible that your system is configured to expect the license file elsewhere than you thought. Search for the mosek.lic file on the disk and see if there is one in another location. Remove any old expired licenses found.

Go through the error or diagnostic message you received from MOSEK and look for lines such as:

License path: /home/someplace/mosek/mosek.lic

or:

License cannot be located. The default search path is ':/home/someplace/mosek/mosek.lic:'

This is the actual location where this instance of MOSEK was trying to locate the license. If it does not correspond to your expectations then go through the setup again or check that this location contains the correct file.

11.4 Need more help

11.4.1 I tried all of the above but it doesn’t help.

Send us an email and attach as much as possible of the following data:

  • description of the problem,

  • the license file,

  • the token server log file lmgrd.log or its part relevant to the issue (for floating licenses),

  • the exact error message reported by the MOSEK client, or the output from mosekdiag, mosektestlic, mosek -f or other relevant diagnostic tool.

  • MOSEK version, operating system, which interface you are using.