Troubleshooting guide for licensing

When implementing Cryptolens into your software, you may get different of errors depending if you call the API directly or through one of the client libraries. This section covers the most common errors, why they occur and how to troubleshoot them.

Basics

API errors

The majority of errors (99%) are caused by a wrong product id, access token or RSA Public key. In some cases, it can also be because an active subscription is missing.

Our client libraries might not always show the real error message and instead display a generic error. To find out the real error message from the Web API, you can call the method through curl or in the browser. For example, to check the access token, you can call curl as shown below:

curl https://app.cryptolens.io/api/key/Activate? \ 
     -d token=<access token> \
     -d ProductId=<product id> \
     -d Key=<license key string>

You can also check this with the browser. The call above would translate to:

https://app.cryptolens.io/api/key/Activate?token=<access token>&ProductId=<product id>&Key=<license key string>

The most common errors and their cause is summarized below:

Error message Description
Unable to authenticate The access token is wrong. It is also shown if the subscription has expired. API access requires an active subscription.
Something went wrong. Please contact [email protected] and we will try to fix it. A temporary server error. Try again with a new request.
No active subscription found. Please contact support. No active subscription is associated with the account and thus the API call failed. The error can be fixed by updating your billing information and add a valid payment method on the billing page.
Access denied The access token is correct but it does not have sufficient permission. Make sure that if you, for example, want to call GetKey that the access token has “GetKey” permission.
Not enough permission and/or key not found. If you have checked that the product contains the license key and the access token has the right permission to call the method, this error can be fixed by setting Key Lock to -1 when creating the access token (assuming that you are working with data object related methods).

SDK errors

SDKs and the code implementation can also contribute to errors. A common error is when IsOnRightMachine is included in the key verification code but the license is not set up to track machines. If your code relies on this check in such case, the code will fail.

For example, let’s look at the Python code to verify licenses:

if result[0] == None or not Helpers.IsOnRightMachine(result[0], v=2):
    # an error occurred or the key is invalid or it cannot be activated
    # (eg. the limit of activated devices was achieved)
    print("The license does not work: {0}".format(result[1]))
else:
    # everything went fine if we are here!
    print("The license is valid!")
    license_key = result[0]
    print("Feature 1: " + str(license_key.f1))
    print("License expires: " + str(license_key.expires))

If the license uses the default value of the maximum number of machines, the code above will fail with the error message that the license does not work. To fix this, you can either remove Helpers.IsOnRightMachine call or set maximum number of machines to a value greater than 0.