Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Service installation and deployment

Prerequisites

Before installing Finger Service, make sure you have:

  • Docker installed and running

  • A valid Facephi License file

  • Access to the Facephi Docker registry

Access to the Docker registry

Log in to the Facephi Docker registry:

docker login facephicorp.jfrog.io

You will need the credentials provided by Facephi.

Installation

The Docker image already includes the internal fingerprint processing components, so you do not need to mount additional files at runtime.

Download the Docker image

docker pull facephicorp.jfrog.io/docker-pro-fphi/facephi-finger-service:2.2.1

Replace 2.2.1 with the desired version.

Prepare the directories

Create the directories for the license, configuration, and logs:

Place the license file

Copy your license file to the license directory:

The service's default license path is /app/license/license.lic.

Deploy with Docker Compose

Create docker-compose.yml:

The values of FACEPHI_FINGER_ENGINE_* from the example are the ones the image uses by default in a single-node deployment: you can omit them.

Start the service

Verify the deployment

On startup, the service obtains the license, starts the internal fingerprint processing components, and waits for them to be ready before it starts accepting requests on the port 6982:

  • On a masternode, it waits 60 seconds and then checks up to 6 times, every 10 seconds, that all processing components are registered.

  • On a workernode, it waits 30 seconds and then checks up to 6 times, every 10 seconds, that the local processing services accept connections.

Meanwhile, requests to the port receive no response even though the container appears as Up. When the service is ready, the log shows these lines:

If a master node's processing components are not ready after the 6 checks, the service logs Engine failed to become healthy after 6 attempts and starts anyway; in that case, GET /api/v1/finger/health returns Unhealthy with engine.healthy equal to false until they become available. If the license cannot be obtained, the service does not start and the container stops (see “Troubleshooting”).

Cluster deployment

To scale processing, Finger Service supports a multi-node topology with one master node and several worker:

  • nodes. The master (FACEPHI_FINGER_ENGINE_ROLE=master) node receives client requests: it exposes the full API and distributes fingerprint processing across the cluster nodes.

  • The worker (FACEPHI_FINGER_ENGINE_ROLE=worker) provide processing capacity and expose only the management endpoints (health, version, metrics, metrics/prometheus and config). On these nodes, POST /api/v1/finger/extract and POST /api/v1/finger/authenticate return HTTP 404.

  • All nodes must point to the master node using FACEPHI_FINGER_ENGINE_MASTER and be able to communicate with each other over TCP ports 47500-47509, which they use to discover one another and form the cluster.

  • All nodes need access to a valid license file.

Topology variables

These variables are configured only through environment variables; they are not part of config.json and are not exposed through GET|POST /api/v1/finger/config:

Variable
Default
Description

FACEPHI_FINGER_ENGINE_ROLE

master

Node role: master or worker. It is case-insensitive; an invalid value is interpreted as master

FACEPHI_FINGER_ENGINE_SERVICES

Master,FingerTC,Verifier

Comma-separated internal processing services started by the node. Supported values: Master, FingerTC and Verifier

FACEPHI_FINGER_ENGINE_MASTER

127.0.0.1

Address of the master node used by nodes to form the cluster. If a comma-separated list is specified, only the first address is used

Common configurations:

Topology

Node

FACEPHI_FINGER_ENGINE_ROLE

FACEPHI_FINGER_ENGINE_SERVICES

FACEPHI_FINGER_ENGINE_MASTER

Single node

Standalone

master

Master,FingerTC,Verifier

127.0.0.1

Cluster

master

master

Master

Node address master

Cluster

worker

worker

FingerTC,Verifier

Node address master

Docker Compose example

To change the number of nodes worker:

On each node, GET /api/v1/finger/health and GET /api/v1/finger/metrics report the role (engine.role, service.role) and the configured processing services (engine.servicesConfigured). On workernodes, the health check verifies that each local processing service accepts connections.

License configuration

The license file must be located at /app/license/license.lic inside the container.

License file format

If LICENSE_TYPEis missing, the service uses SHARED, and if it is missing LICENSE_BEHAVIOUR, use ONLINE. The combination SHARED + OFFLINE is not supported: the service will not start with it.

Optional fields:

  • LICENSE_URLS= — Comma-separated URLs of the license servers (required for the LOCALtype; see Offline licensing with a local server)

  • LICENSE_OFFLINE_CODE= — Contents of the offline activation response file provided by Facephi (required for MACHINE + OFFLINE)

  • LICENSE_ADDRS= — Comma-separated MAC addresses used to calculate the machine fingerprint for MACHINE

LICENSE_ID and LICENSE_DATA, if present, are ignored by the service, which reports this in the log. Finger Service product credentials are embedded at build time, so these fields must be omitted from deployment templates.

License connectivity

  • With ONLINE, the server must have outbound HTTPS access to the license servers assigned to the deployment. If outbound traffic is restricted, request the exact allowlist for your deployment from Facephi before installation.

  • For installations without Internet access, use a local license server (see Offline licensing with a local server).

Public API overview

Endpoints exposed by the service:

  • POST /api/v1/finger/extract (only on master)

  • POST /api/v1/finger/authenticate (only on master)

  • GET /api/v1/finger/version

  • GET /api/v1/finger/health

  • GET /api/v1/finger/metrics

  • GET /api/v1/finger/metrics/prometheus

  • GET|POST /api/v1/finger/config

JWT authentication

JWT authentication is optional and disabled by default.

  • Configure it at startup in /app/config/config.json with auth_enabled, auth_jwt_secret, auth_accept_authorization_header, auth_accept_api_key_header and auth_api_key_header_name

  • Override these values with the environment variables FACEPHI_FINGER_REST_AUTH_*

  • With authentication enabled, all endpoints except /health, /version, /metrics, /metrics/prometheus and OPTIONS requests OPTIONS require an HS256-signed JWT with auth_jwt_secret and the exp

  • claim. Always set auth_jwt_secret when enabling authentication: if it is empty, all protected endpoints respond with HTTP 401 401 Authentication secret is not configured

  • GET /api/v1/finger/config never returns the JWT authentication keys

  • POST /api/v1/finger/config rejects JWT authentication keys; manage them only at startup and restart the service to change them

Details on how to send the token and on the responses 401 are in the “JWT Authentication” section of the service overview.

Startup configuration example:

Environment variable example:

Service configuration

Create /app/config/config.json to customize the service behavior. The file is optional: if it does not exist, the service starts with the default values. Parameters you do not include retain their default values.

Configuration file location

  • Default location: /app/config/config.json (inside the container)

  • Mount an external file: Use volume mapping in docker-compose

Complete configuration example (current default values)

Service parameters

Parameter
Type
Default
Description

port

integer

6982

Service listening port

number_of_threads

integer

1

Worker threads for request processing

connection_timeout

integer

60

Maximum time, in seconds, that an idle connection remains open

keep_alive_request_number

integer

0

Maximum number of requests per keep-alive connection (0 = unlimited)

client_max_body_size

integer

100

Maximum request body size in MB. Larger requests receive HTTP 413

logger_path

string

""

Directory where log files are written. Empty disables file logging; logs continue to be written to the container's standard output

logger_file_prefix

string

"app"

Prefix for the daily log folder inside logger_path (<prefix>-<YYYY-MM-DD>, with the date in UTC). Characters other than letters, numbers, - and _ are replaced by _

logger_level

string

"info"

Log level: trace, debug, info, warning, error, critical or off. An unrecognized value is interpreted as off

logger_rotation

string

"daily"

Log file rotation: daily or hourly. Any other value is interpreted as daily

logger_max_files

integer

7

Maximum number of log files to retain (0 = unlimited)

metrics_enabled

boolean

true

Collects traffic, saturation, and latency counters published by GET /api/v1/finger/metrics and GET /api/v1/finger/metrics/prometheus. With false, those sections are set to zero

auth_enabled

boolean

false

Requires JWT authentication for protected endpoints

auth_jwt_secret

string

""

Shared HS256 secret used to validate JWTs

auth_accept_authorization_header

boolean

true

Accepts Authorization: Bearer <jwt>

auth_accept_api_key_header

boolean

true

Accepts JWTs in the configured API key header

auth_api_key_header_name

string

"x-api-key"

Name of the header used when API key token extraction is enabled

Processing parameters

Configure the service's communication with its internal fingerprint processing components. Used only on master.

Parameter
Type
Default
Description

engine_connection_timeout

integer

10000

Connection timeout (ms)

engine_request_timeout

integer

60000

Request timeout (ms)

engine_max_retries

integer

3

Maximum number of retries for a request that receives no response (connection error or timeout) or receives a 5xx, 408 or 429

engine_retry_delay

integer

1000

Initial delay between retries (ms); doubles with each retry

engine_verify_ssl

boolean

false

Verifies SSL certificates for communication with the processing components

engine_verbose

boolean

false

Enables detailed HTTP logging for communication with the processing components

engine_pool_size

integer

4

Connection pool size

engine_url

string

http://localhost:8080

Base URL for the internal processing components

Operational metrics thresholds

These parameters only change how GET /api/v1/finger/metrics classifies the service status (state.classification) and which alerts it publishes; they do not change fingerprint processing.

Parameter
Type
Default
Description

metrics_saturation_queue_p95_ms

integer

250

95th percentile of queue latency (1 minute, ms) above which the queue is considered saturated

metrics_saturation_min_inflight_ratio

number

1.0

Fraction of number_of_threads that in-flight requests must exceed for the service to be considered saturated

metrics_error_rate_warning

number

0.05

5-minute error rate ( 4xx and 5xx) above which the service is classified as degraded and the alert HIGH_ERROR_RATE

metrics_idle_rps_threshold

number

0.01

15-minute requests per second below which the service is classified as idle

metrics_quality_alert_window_seconds

integer

900

Window, in seconds, during which a low-quality extraction keeps the alert LOW_QUALITYactive. With 0, the alert is deactivated

A value that cannot be parsed, or is negative, is discarded with a warning in the log: if it comes from an environment variable, the value from config.jsonis used; if that is also invalid, the default value is used.

Environment variables

Environment variables take precedence over config.json:

  • Service parameters, JWT authentication parameters, and thresholds metrics_* are overridden with FACEPHI_FINGER_REST_<PARÁMETRO EN MAYÚSCULAS>, for example FACEPHI_FINGER_REST_NUMBER_OF_THREADS or FACEPHI_FINGER_REST_METRICS_ERROR_RATE_WARNING.

  • Processing parameters are overridden with these environment variables:

Parameter
Environment variable

engine_url

FACEPHI_FINGER_ENGINE_URL

engine_connection_timeout

FACEPHI_FINGER_ENGINE_CONN_TIMEOUT

engine_request_timeout

FACEPHI_FINGER_ENGINE_REQ_TIMEOUT

engine_max_retries

FACEPHI_FINGER_ENGINE_MAX_RETRIES

engine_retry_delay

FACEPHI_FINGER_ENGINE_RETRY_DELAY

engine_verify_ssl

FACEPHI_FINGER_ENGINE_VERIFY_SSL

engine_verbose

FACEPHI_FINGER_ENGINE_VERBOSE

engine_pool_size

FACEPHI_FINGER_ENGINE_POOL_SIZE

  • The cluster topology is configured with FACEPHI_FINGER_ENGINE_ROLE, FACEPHI_FINGER_ENGINE_SERVICES and FACEPHI_FINGER_ENGINE_MASTER (see “Topology variables”).

Boolean processing variables accept true, TRUE, yes, YES or 1, and false, FALSE, no, NO or 0. An invalid value in a FACEPHI_FINGER_ENGINE_* variable is ignored with a warning in the log, and the value from config.json or the default value is retained.

GET /api/v1/finger/config does not reflect values set through environment variables: it shows the values from config.json and the default values.

Dynamic configuration updates

Some parameters can be updated without restarting the service:

POST /api/v1/finger/config expects a JSON object with the field config_json_string, which contains the parameters to be modified, serialized as a JSON string; parameters that are not included retain their values.

  • Only the following settings are applied at runtime: engine_url, engine_connection_timeout, engine_request_timeout, engine_max_retries, engine_retry_delay, engine_verify_ssl and engine_verbose (only on master) nodes, as well as the metrics_* thresholds used by GET /api/v1/finger/metrics to classify the service status.

  • The remaining parameters, including engine_pool_size, are read-only: the endpoint accepts them, but they do not change the service's behavior until they are updated in config.json or in the environment variables, and the service is restarted. The operation reference for POST /api/v1/finger/config includes the complete parameter table.

  • If the corresponding environment variable is set (FACEPHI_FINGER_ENGINE_* or FACEPHI_FINGER_REST_METRICS_*), its value takes precedence over the value sent to the endpoint.

  • GET /api/v1/finger/config returns all values as strings (for example, "metrics_error_rate_warning": "0.1").

  • If config_json_string does not contain a valid JSON object, the request returns HTTP 500 with exception set to Failed to load configuration from config_json_string and the configuration remains unchanged.

  • JWT authentication settings are startup settings: the endpoint rejects requests that include them with HTTP 400 and a message set to JWT auth settings are not accessible from the config endpoint. Update config.json or the environment variables, and restart the service.

Note: Runtime updates are in memory and are not automatically persisted to config.json. To preserve changes after a restart, update the file mounted at /app/config/config.json.

Usage counters

GET /api/v1/finger/metrics reports, in the usage block (and in the fields usageCountersEnabled, extractCount, authenticateCount and totalCount), the license usage counters for successfully completed POST /api/v1/finger/extract and POST /api/v1/finger/authenticate operations.

  • The counters depend on the license. If your license does not have them enabled, usage.enabled is false and the counters are 0: contact Facephi if you need them enabled.

  • Only successfully completed operations are counted (HTTP 200). Invalid requests and processing errors are not counted.

  • The values are license-wide totals, including increments from this instance that have not yet been synchronized with the license server, so they are not reset when the service restarts.

  • usage.total (and totalCount) is always the sum of the two operations.

Troubleshooting

The service does not start

Check the license file:

Check the logs:

If the license cannot be obtained at startup, the service exits and the container stops. The log indicates the reason with lines like these:

Log line
Cause

Failed to open license file: /app/license/license.lic

The license file is missing from the mounted folder or cannot be read

SHARED licenses with OFFLINE behaviour are not supported

license.lic combines LICENSE_TYPE=SHARED with LICENSE_BEHAVIOUR=OFFLINE

License validation failed [License initialization]: <motivo> (code: <código>)

The license is invalid or could not be validated (see “License validation fails”)

The service does not respond immediately after startup

The service waits for the internal processing components to be ready before opening the port 6982: at least 60 seconds on a master and 30 seconds on a worker. Wait until you see Finger service 2.2.1 started in the log before sending requests or declaring a startup probe failure.

GET /api/v1/finger/health returns Unhealthy

Check the response fields:

  • license.valid equal to false: the license is invalid; license.statusMessage indicates the reason (see “License validation fails”).

  • license.valid equal to true and engine.healthy equal to false: the internal processing components are not ready. This usually happens while they are still starting up, with engine.lastError equal to Engine nodes not yet fully registered; check again after a few seconds. If the issue persists:

    • Check the log for Engine failed to become healthy after 6 attempts.

    • Check the container's available resources with docker stats facephi-finger-service.

    • In a cluster, check the values of FACEPHI_FINGER_ENGINE_ROLE, FACEPHI_FINGER_ENGINE_SERVICES and FACEPHI_FINGER_ENGINE_MASTER on each node, and make sure the nodes are reachable on the ports 47500-47509.

    • While the processing components are not responding, POST /api/v1/finger/extract and POST /api/v1/finger/authenticate return HTTP 400 with message equal to Fingerprint processing communication error: <detalle>.

Fingerprint endpoints respond 404

POST /api/v1/finger/extract and POST /api/v1/finger/authenticate only exist on the master. Check that FACEPHI_FINGER_ENGINE_ROLE is master (or is not set) on the node receiving requests, and that the client does not use the legacy 1.x.x routes (/create-template, /verify).

License validation fails

  • Check the license file permissions: chmod 644 license.lic

  • Make sure the firewall allows outbound HTTPS traffic to the license servers

  • Check the license expiration date

  • Confirm that the license is for the Finger Service product

If the license becomes invalid while the service is running, GET /api/v1/finger/health returns Unhealthy with license.valid equal to false, GET /api/v1/finger/version adds Invalid license: <motivo> (code: <código>) to the message, and GET /api/v1/finger/metrics classifies the service as unhealthy with the alert LICENSE_EXPIRED.

Usage counters do not change

  • Confirm that GET /api/v1/finger/metrics returns usage.enabled: true. If it returns false, your license does not have usage counters enabled; check with Facephi.

  • Remember that only successfully completed operations are counted.

Performance issues

  • Increase engine_pool_size to handle more concurrent requests

  • Adjust number_of_threads based on the available CPU cores

  • Add worker nodes to the cluster to distribute processing

  • Monitor resource usage: docker stats facephi-finger-service

  • Check state.classification, saturation and latency at GET /api/v1/finger/metrics

Upgrade

To upgrade to a new version:

Always review the release notes before upgrading.

Last updated