LexActivator LA_FAIL (1) error code during activation

Hello Support,

Some of our customers and some time we too are facing LA_FAIL error code when activation is request. We are using C# API in our app. I also noticed that sometime first activation does not work and if I try activation again at the same time it works. First attempt get LA_FAIL so can you please help to avoid this error. Also internet is pretty good on all system so that is not a problem. Or is it something that Lex require sometime to get initalized properly before making any operation.

Any quick help will be appreciated as our customers are facing this issue frequently.

Thanks,
MP

Hi,
The issue is not replicable at our end.

Are you facing issue with ActivateProduct() or IsProductGenuine() function?

Can you share or mail us the code snippet where the error is occurring?

Hello,

Yes I am facing this issue with ActivateProduct call.

Below is code :
LicenseInfo liceseInfo = new LicenseInfo();
int status = LexActivator.SetProductKey(activationKey);
if (status != LexActivator.LA_OK)
{
Log("ActivateProductNew: Error setting product key: " + status.ToString());
liceseInfo.errorMessage = “Unbale to use produce key, Make sure it is correct.”;
liceseInfo.isValid = false;
liceseInfo.statusCode = status;
return liceseInfo;
}

                LexActivator.SetExtraActivationData(extraActivationData);
                status = LexActivator.ActivateProduct();
                if (status != LexActivator.LA_OK)
                {
                    ManageSystemAdaptersUtils.Log("ActivateProductNew: Error activating the product: " + status.ToString());
                    String error = "Unable to activate .. ";
                    if (status == LexActivator.LA_E_PKEY)
                    {
                        error = "Invalid Product Key";

                    }
                    else if (status == LexActivator.LA_E_INET)
                    {
                        error = "Failed to connect to the server due to network error";
                    }
                    else if (status == LexActivator.LA_EXPIRED)
                        error = "The product key has expired or system time has been tampered with. Ensure your date and time settings are correct.";
                    else if (status == LexActivator.LA_REVOKED)
                        error = "The product key has been revoked.";
                    else if (status == LexActivator.LA_FAIL)
                        error = "Activation failed at this moment.";

                    Log("ActivateProductNew: LexActivation Error: " + error);
                    liceseInfo.errorMessage = error;
                    liceseInfo.isValid = false;
                    liceseInfo.statusCode = status;
                    return liceseInfo;
                }
                else {
                    Log("ActivateProductNew: product is activated successfully...");
                    liceseInfo.errorMessage = "";
                    liceseInfo.isValid = true;
                    liceseInfo.statusCode = LexActivator.LA_OK;
                    liceseInfo.productKey = activationKey;
                    
                    liceseInfo.ownerName = GetLexNameLicenseData();
                    liceseInfo.email = GetLexEmailLicenseData();
                    return liceseInfo;
                }

LA_FAIL occurs when license key is incorrect, sometimes extra spaces in the license key can also cause issue. Before passing the product key to LexActivator.SetProductKey() try trimming the product key to remove any extra character which may be present at the beginning or at the end.

I don’t think it’s the issue. I have license key form, when I open it and set the license key and submit first time, it fails with LA_FAIL and if I hit the submit button again it works second time. Even just after few seconds without changing anything in text field. So I think space is not the issue. Any other idea?

I couldn’t replicate the issue on the sample c# app provided with the library. Can you try replicating it in the sample app, if it doesn’t then maybe issue can be with it’s usage in the app.

My flow is simple -

  1. UI have a form, user puts license key(i am not trimming it though but I added myself key without whitespace)
  2. User presses submit button
  3. I have created a LexLicensecheck class that is used for all lex opeations
  4. It has a init method that sets product data file and version id etc (all first time stuff) and only once in the app as i think again and again is not needed
  5. The code i mentioned above is then invoked via static method
  6. first time it fails always and second time it works.

I am not sure what is i am doing wrong. As a work around I am thinking to invoke second activation silently if first one is LA_FAIL until i figure out exact problem.

Though not required but can you try setting the version guid in your activation function too before setting the product key, and check if the issue replicates.

If it still I will provide you with a logger version of dll, which can help in finding the issue.

Sure I will try setting version guid before activation and will update you tomorrow.

Doesn’t seems to be working :frowning:

Does the issue replicate in the sample C# app provided with the library on your machine? Did you try with the latest version of the library?

I did not try with sample app and I downloaded C# lib recently from your website (may be a weeks or so).

Can you please check it with the sample app. You just have to copy the product.dat and dll to get it working. That will help in fixing this issue.

Okay tried with sample code and same behaviour. Failed first time and activated on second time.

Alright, can you provide the details about your OS and nature of your internet connection.

I have mailed you a the libs with logging enabled, please use them and send us the log.

Okay, give me a day. I will send you logs.

I have replied over email with log. Please check.

Please, try again the issue has been fixed.

Okay I will try today.