Troubleshoot Licensing and ntls

When troubleshooting licensing and ntls (see Licensing), the first step is to retrieve the licensing information and ntls status. You can do so by sending an API request to ntls. Necessary actions are then to be undertaken, subject to the response content.

Tip

Please do not hesitate to contact our experts on troubleshooting by support@ntechlab.com.

Note

The online licensing is done via the NtechLab Global License Manager license.ntechlab.com. Check its availability. A stable internet connection and DNS are required.

In this section:

Get Licenses Information (v1)

Active Licenses

GET /v1/licenses.json

To retrieve the FindFace licensing information and ntls status, execute on the ntls host console:

curl http://localhost:3185/v1/licenses.json -s | jq

The response will be given in JSON. One of the most significant parameters is .licenses[].last_updated. It indicates in seconds how long ago the local license has been checked for the last time.

Interpret the .licenses[].last_updated value as follows:

  • [0, 5] — everything is alright.

  • (5, 30] — there may be some problems with connection, or with the local drive where the license file is stored.

  • (30; 120] — almost certainly something bad happened. You should check the ntls logs for additional information.

  • (120; ∞) — the licensing source response has been timed out. Take action.

  • .licenses[].valid.valid == false: connection with the licensing source was never established.

Another important field is .products. It describes the available features and resources for each product:

  • .products[].features: available features.

  • .products[].resources: available resource limits and usage of these resources.

  • .products[].extra: miscellaneous license information.

The response also contains the following parameters:

  • .time: the current server time, in Unix timestamp format.

  • .licenses[].expire_date: license expiration date. Treat this field with respect to .time

  • .licenses[].type: license type.

  • .licenses[].license_id: license ID.

  • .licenses[].generated: license generation time.

  • .licenses[].source: the path to the license file.

  • .licenses[].products: what features and resources each license provides. Basically it resembles structure of .products, but resources usage isn’t reported here.

  • .licenses[].valid.description: if .licenses[].valid.valid == false, then this field contains the reason why the license is not valid.

  • .services: an array of FindFace Server services connected to ntls.

{
    "name": "NTLS",
    "time": 1709825691,
    "licenses": [
        {
            "expire_date": 1737208526,
            "generated": 1705586179,
            "last_updated": 2,
            "license_id": "018f4c50e6044f0aa618436ad9450ac0",
            "products": {
                "multi": {
                    "extra": {},
                    "features": {
                        "sec-external-vms": {
                            "value": true
                        },
                        "sec-genetec": {
                            "value": true
                        }
                    },
                    "resources": {}
                },
                "server": {
                    "extra": {},
                    "features": {
                        "body_bags": {
                            "value": true
                        },
                        "body_emben": {
                            "value": true
                        },
                        ...
                    },
                    "resources": {
                        "cameras": {
                            "value": 60
                        },
                        "extapi": {
                            "value": 256
                        },
                        "objects_tntapi": {
                            "value": 200000000
                        }
                    }
                }
            },
            "source": "/ntech/license/Test_license_018f4c50e6044f0aa618436ad9450ac0.lic",
            "type": "offline",
            "valid": {
                "description": "",
                "valid": true
            }
        },
        {
            "expire_date": 0,
            "generated": 1581946976,
            "last_updated": 1,
            "license_id": "017c40d9401742ce9eff8b48d93ded9a",
            "products": {},
            "source": "/ntech/license/ntech_license_017c40d9401742ce9eff8b48d93ded9a.lic",
            "type": "online",
            "valid": {
                "description": "License is not valid",
                "valid": false
            }
        }
    ],
    "products": {
        "multi": {
            "features": {
                "sec-external-vms": {
                    "value": true
                },
                "sec-genetec": {
                    "value": true
                }
            },
            "resources": {},
            "extra": {}
        },
        "server": {
            "features": {
                "body_bags": {
                    "value": true
                },
                "body_emben": {
                    "value": true
                },
                ...
            },
            "resources": {
                "cameras": {
                    "current": 11,
                    "value": 60
                },
                "extapi": {
                    "current": 1,
                    "value": 256
                },
                "objects_tntapi": {
                    "current": 12321,
                    "value": 200000000
                }
            },
            "extra": {}
        }
    },
    "services": [
        { "name": "video-worker-gpu", "ip": "10.255.233.12:48844" },
        { "name": "findface-extraction-api", "ip": "10.255.233.11:44182" },
        { "name": "FindFace-tarantool", "ip": "10.255.233.13:46444" }
    ]
}

Report

GET /v1/usage-report.json

Get a report of the interval counters. It updates once an hour, so be patient.

{
    "b2c4658412f44184a6e34a2a369ce58c": { // license ID
        "by_interval": [ // array of statistical accounting intervals
            {
                "since": "2023-08-25T00:00:00+00:00", // start date of the interval, inclusive
                "till": "2023-09-25T00:00:00+00:00", // date of the end of the interval, not inclusive
                "counters": {
                    "ffserver": { // product
                        "face_emben": { // the code of the counter
                            "used": 123 // how many extracts are counted in the interval
                        }
                    }
                }
            },
            {
                "since": "2024-01-25T00:00:00+00:00", // start date of the interval, inclusive
                "till": null, // the end of the interval is missing - until the end of the license period
                "counters": {
                    "ffserver": {
                        "face_emben": {
                            "used": 0
                        }
                    }
                }
            }
        ],
        "active_limits": { // limits are active at the moment. It is not necessarily match one of the intervals from by_interval
            "since": "2023-08-25T00:00:00+00:00", // the start date of the current limit
            "till": "2023-09-25T00:00:00+00:00", // the expiration date of the current limits or NULL if the expiration date is until the end of the license
            "counters": {
                "ffserver": {
                    "face_emben": {
                        "used": 123,
                        "available": 1000
                    }
                }
            }
        }
    },
    "6b5392f68fa84861bb39ce86fa5e42f9": {
        "by_interval": [
            {
                "since": "2021-09-18T00:00:00+00:00",
                "till": "2021-10-18T00:00:00+00:00",
                "counters": {
                    "ffserver": {
                        "face_emben": {
                            "used": 1103
                        }
                    }
                }
            },
            {
                "since": "2021-10-18T00:00:00+00:00",
                "till": null,
                "counters": {
                    "ffserver": {
                        "face_emben": {
                            "used": 338
                        }
                    }
                }
            }
        ],
        "active_limits": {
            "since": "2021-10-18T00:00:00+00:00",
            "till": null,
            "counters": {
                "ffserver": {
                    "face_emben": {
                        "used": 338,
                        "available": 1000
                    }
                }
            }
        }
    }
}

Get License Information (v0)

Active License

GET /license.json

This route is deprecated, and you should always use GET /v1/licenses.json instead. It can only show information about one license, and if there are multiple licenses — the one that expires last is selected. However, it still combines information about the features and resources provided by each license.

curl http://localhost:3185/license.json -s | jq

{
    "name": "NTLS",
    "time": 1706794854,
    "type": "online",
    "license_id": "110d47188a62497888184e58cb5b08de",
    "generated": 1588854459,
    "last_updated": 5,
    "valid": {
        "value": true,
        "description": ""
     },
    "source": "/ntech/license/import_5d679839ce7993aaa0a0e0cb797c2eb2bd7c0a3e66f0c2a319032c4d99c97322.lic",
    "limits": [
        {
            "type": "time", "name": "end",
            "value": 1746422763
        },
        {
            "type": "number", "name": "faces",
            "value": 250000,
            "current": 172585
        },
        {
            "type": "number", "name": "cameras",
            "value": 25,
            "current": 4
        },
        {
            "type": "number", "name": "extraction_api",
            "value": 64,
            "current": 1
        },
        {
            "type": "boolean", "name": "gender",
            "value": true
        },
        ...
    ],

    "products": {
        "multi": {
            "extra": {"line-crossing": true},
            "features": {
                "sec-external-vms": {
                    "value": true
                },
                "sec-genetec": {
                    "value": true
                }
            },
            "resources": {}
        },
        "server": {
            "extra": {},
               "features": {
                "body_bags": {
                    "value": true
                },
                "body_emben": {
                    "value": true
                },
                ...
            },
            "resources": {
                "cameras": {
                    "current": 0,
                    "value": 60
                },
                "extapi": {
                    "current": 0,
                    "value": 256
                },
                "objects_tntapi": {
                    "current": 0,
                    "value": 200000000
                }
            }
        }
        "foo": {
            "extra": {
                "bar": 123,
                "baz": "qux",
            }
        }
    },

    "services": [
        { "name": "video-worker-gpu", "ip": "10.255.233.12:48844" },
        { "name": "findface-extraction-api", "ip": "10.255.233.11:44182" },
        { "name": "FindFace-tarantool", "ip": "10.255.233.13:46444" }
    ]
}

Report

GET /usage-report.json

Getting a report of interval counters. If there are multiple active licenses, it returns information on the one that expires last.

{
    "by_interval": [
        {
            "since": "2023-08-25T00:00:00+00:00",
            "till": "2023-09-25T00:00:00+00:00",
            "counters": {
                "ffserver": {
                    "nrq_facen": {
                        "used": 123
                    }
                }
            }
        },
        {
            "since": "2024-01-25T00:00:00+00:00",
            "till": null,
            "counters": {
                "ffserver": {
                    "nrq_facen": {
                        "used": 0
                    }
                }
            }
        }
    ],
    "active_limits": {
        "since": "2023-08-25T00:00:00+00:00",
        "till": "2023-09-25T00:00:00+00:00",
        "counters": {
            "ffserver": {
                "nrq_facen": {
                    "used": 123,
                    "available": 1000
                  }
            }
        }
    }
}

License Management

GET /c2v

Take a hardware fingerprint (C2V file) for subsequent activation of the offline Sentinel license.

GET /c2v/guardant

Take a hardware fingerprint (C2V file) for subsequent activation of the offline Guardant license.

POST /import

Importing a license (an alternative to copying a file to a directory with licenses).

Auxiliary

GET /metrics

Prometheus Metrics.