License check failure when switching between debug mode too many times?

MaXi32

Verified User
Joined
Jul 25, 2016
Messages
658
Location
The Earth
I received this License check failure when I use debug mode frequently. This is a permanent license and I don't have any other servers that use the same license.

^_^

Now I could not enter the back panel, should I wait or open a ticket? I believe the reason might come from switching to debug mode and normal mode because I'm working on API. Never had this issue before.

@smtalk

1667137156935.png
 
Just now, the license page came back to normal. When I run debug mode again and refresh the back panel and now I got this kinda different error:

1667137595547.png




I just feel like I should open a ticket (long time have not open a ticket). This license check is getting aggresive and blocking for no reason:

1667138109210.png
 
Last edited:
hi @MaXi32, if you trigger too many restarts in a short period of time licensing requests will be rate limited. If you have tripped on the rate-limit error just wait for 10 minutes and restart DA it should work fine.

Running debug mode does not increase the amount of licensing requests being send. As long as you are not continuously restarting DA you should not trip on the licensing server rate limit.
 
hi @MaXi32, if you trigger too many restarts in a short period of time licensing requests will be rate limited.

Do you mean triggering the DirectAdmin binary restart ? like systemctl restart directadmin ?

Ok, I think I know why this happen, I got my custom script that ends the debug mode and automatically restarts DirectAdmin. So, the DirectAdmin restart causes the issue? What happens if I need to restart multiple times? I think I need to do this for development purposes.

Well, I should ask this, how can you start DirectAdmin after you end the debug mode? Shouldn't you restart the DA binary ? Might be something new, because I have been using these ways for a long time.
 
Last edited:
Ok, I tested now I can see that I do not actually have to restart DirectAdmin manually. Last time with the old DA I remember that I need to restart it (that is why I included the restart command in my debug script) because it did not run in normal mode without restart. You are right, I did use restart multiple times.
 
Restarting DA is OK as long as you are not doing it too often. If worst comes to worst you might need to wait 10 minutes. But if you have not been restarting DA for a while you will accumulate more restart credits and could do more restarts without triggering the rate-limit. This is probably why even having the restart command in you debug scripts you have not tripped on it immediately but only after heavy debugging session.
 
Restarting DA is OK as long as you are not doing it too often. If worst comes to worst you might need to wait 10 minutes. But if you have not been restarting DA for a while you will accumulate more restart credits and could do more restarts without triggering the rate-limit. This is probably why even having the restart command in you debug scripts you have not tripped on it immediately but only after heavy debugging session.

Thanks, now I have 2 very important questions regarding this restart behavior, what is the amount of rate limit to restart DirectAdmin before I got locked out like this? In case, I want to be careful with this and put this condition in my script.

and my last question does DA automatically restart into normal mode (after I end my debug mode with CTRL+C) using the following command below (as the command also mentioned here but it did not tell if DA went into this mode automatically if I hit CTRL+C: https://docs.directadmin.com/directadmin/general-usage/troubleshooting-da-service.html ?)

./directadmin server --debug=10
Does the above command also trigger a restart rate-limit?

Extra last question:

Should we stop using the old recommended way that can be seen mostly in forum: systemctl restart directadmin? and what is your recommendation to restart directadmin binary into normal mode in case of something is wrong?
 
Thanks, now I have 2 very important questions regarding this restart behavior, what is the amount of rate limit to restart DirectAdmin before I got locked out like this? In case, I want to be careful with this and put this condition in my script.
If you have depleted you restart limit you will get 1 restart per 10 minutes. If you are not restarting DA you earn extra restart credits, +1 credit every 10 minutes. There is max amount of restart credits you can accumulate after which you no longer accumulate but just keep the max amount. If you do restart DA you consume on restart credit. Max amount of credits and credits regeneration rate a subject to change. So I would really advise you against adding any logic to you scripts that tries to compute the restart rates.

The rates were selected to never cause problems for normal usage (even if we need to restart DA a lot for a short period of time) as long as this restarting is not happening all the time. Rate limits are there to prevent licensing abuse.
and my last question does DA automatically restart into normal mode using the following command below (as also mentioned here: https://docs.directadmin.com/directadmin/general-usage/troubleshooting-da-service.html ?)
If you start DA in debug mode in the console it will continue to run in the debug mode until you stop it. Once you stop it if you do nothing systemd will notice that DA is not running and will try and start it. Systemd is actually always checking if DA is running, but when you have started a manual debug instance in the console systemd tries to run DA and fails (because DA listen port is already in use by the DA started in debug mode). Once you debug mode server in console is stopped systemd is able successfully start DA in normal mode.

Should we stop using the old recommended way that can be seen mostly in forum: systemctl restart directadmin? and what is your recommendation to restart directadmin binary into normal mode in case of something is wrong?
It is perfectly fine to use systemctl restart directadmin for restarting DA (or starting if it was deliberately stopped).

Under normal circumstances you should never run into licensing issues as you will have plenty of restart credits. Problems can only happen if you:
  • Add some cron-job that runs more often than once every 10 minutes and does DA restart. Sooner or later you will deplete all you restart credits and and trigger licensing rate-limit.
  • Have some issue where DA is being continuously killed shortly after it was started (within 10 minutes of start time). In that case systemd will try restarting DA every 15 seconds and sooner or later you will deplete all the restart credits and see rate limit error. However once you fix whatever is killing DA it will start up and continue running without problems.
 
Back
Top