Short term lease expired. Please make sure your internet connection is working in order to renew the license

Hello everyone.
I’m a student and I’m new to Linux. I want to use AMPL to solve my formulas for my project. I downloaded the Community Edition and the AMPL C++ API. I extracted the tar file in Home/Downloads and ran ./ampl. In the second step (step 2), the site gave me a unique license to activate my software. I ran ./ampl in this directory and input the unique ID as instructed.

My problem is that every 5 minutes, AMPL shows the following message. When I run AMPL with sudo in its directory, everything is fixed (sudo ./ampl).

What is the problem and how can I fix it?

License file ./ampl.lic:
Short term lease expired. Please make sure your internet connection is working in order to renew the license.
Current directory = "/home/*/Downloads/ampl.linux-intel64".
Today = *; found license file "./ampl.lic":
# Temporary AMPL, BARON, CONOPT, CPLEX, GUROBI, KNITRO, LGO,
# LINDOGLOBAL, LOQO, MINOS, SNOPT, XPRESS, OCTERACT, COPT & MOSEK
# single-machine server license expiring 20240514
# licensed to AMPL Community Edition License for <*@*>:
******** c240f6b0 9a8018ed

HOSTINFO.PLATFORM.linux64

AMPL Version 20240313 (Linux-5.15.0-1059-azure, 64-bit)
1 Like

Hi @ae.naderi,

When the license lease is renewed, the ampl.lic file has to be replaced it is necessary to have write permissions on the AMPL installation directory and on the license file. You mentioned that you used to sudo to activate the license, so it is likely creating ampl.lic with write permissions just for root, and not for the user running the application. Could you please send us the output of:

$ ls -l ~/Downloads/ampl.linux-intel64

First of all, thank you very much for your reply.

-rw-r--r-- 1 root  root        258 Apr 20 15:45 amplkey.cfg
-rw-r--r-- 1 root  root       6659 Apr 20 16:02 amplkey.log
-rw-r--r-- 1 root  root        610 Apr 20 17:47 ampl.lic

And for the other files, it is my own user.

one more thing, I downloaded the license file and place it manually into my AMPL folder. And these problems arose after replacing the license with dynamic cloud license.

Hi @ae.naderi,

Since these files are owned by root, when running AMPL under a regular user account it will not be able to write to them and fail. You can run sudo chown your_username:your_group_name * in that directory in order to fix permissions. After that AMPL should then start working.