> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/sdks/backend-sdk/finger/installation/installation_instructions.md).

# 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:

```bash
docker login facephicorp.jfrog.io
```

You will need the credentials provided by Facephi.

## Installation

{% hint style="danger" %}
**Breaking change notice (2.0.0)** Starting with version 2.0.0, the REST payload contract for the fingerprint operation endpoints has changed and is not compatible with 1.x.x clients. The legacy routes `POST /api/v1/finger/create-template` and `POST /api/v1/finger/verify` are no longer exposed. Plan your client migration before updating the service images.
{% endhint %}

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

```bash
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:

```bash
mkdir -p ~/facephi_finger/{license,config,logs}
```

### Place the license file

Copy your license file to the license directory:

```bash
cp your-license.lic ~/facephi_finger/license/license.lic
chmod 644 ~/facephi_finger/license/license.lic
```

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

## Deploy with Docker Compose

Create `docker-compose.yml`:

```yaml
services:
  finger-service:
    image: facephicorp.jfrog.io/docker-pro-fphi/facephi-finger-service:2.2.1
    container_name: facephi-finger-service
    ports:
      - "6982:6982"
    volumes:
      - ~/facephi_finger/license:/app/license
      - ~/facephi_finger/config:/app/config
      - ~/facephi_finger/logs:/app/logs
    environment:
      - FACEPHI_FINGER_ENGINE_ROLE=master
      - FACEPHI_FINGER_ENGINE_SERVICES=Master,FingerTC,Verifier
      - FACEPHI_FINGER_ENGINE_MASTER=127.0.0.1
      # Optional JWT protection
      # - FACEPHI_FINGER_REST_AUTH_ENABLED=true
      # - FACEPHI_FINGER_REST_AUTH_JWT_SECRET=shared-secret
      # - FACEPHI_FINGER_REST_AUTH_ACCEPT_AUTHORIZATION_HEADER=true
      # - FACEPHI_FINGER_REST_AUTH_ACCEPT_API_KEY_HEADER=true
      # - FACEPHI_FINGER_REST_AUTH_API_KEY_HEADER_NAME=x-api-key
    restart: unless-stopped
```

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

### Start the service

```bash
docker compose up -d
```

### Verify the deployment

```bash
# Check container status
docker ps | grep finger-service

# Check service health
curl http://localhost:6982/api/v1/finger/health

# Check version
curl http://localhost:6982/api/v1/finger/version

# Check operational metrics
curl http://localhost:6982/api/v1/finger/metrics

# View logs
docker logs facephi-finger-service
```

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

* On a `master`, it waits 60 seconds and then checks up to 6 times, every 10 seconds, that all processing components are registered.
* On a `worker`, 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:

```
License initialized successfully from: /app/license/license.lic
Finger service 2.2.1 started (role: master)
```

If the processing components on a `master` node 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` and multiple `worker`:

* The `master` (`FACEPHI_FINGER_ENGINE_ROLE=master`) node receives requests from clients: 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` respond with 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 each other 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` or exposed through `GET|POST /api/v1/finger/config`:

| Variable                         | Default                    | Description                                                                                                                            |
| -------------------------------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `FACEPHI_FINGER_ENGINE_ROLE`     | `master`                   | Node role: `master` or `worker`. 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`          |

### Example with Docker Compose

```yaml
services:
  master:
    image: facephicorp.jfrog.io/docker-pro-fphi/facephi-finger-service:2.2.1
    container_name: finger-master
    ports:
      - "6982:6982"
      - "47500-47509:47500-47509"
    volumes:
      - ~/facephi_finger/license:/app/license
      - ~/facephi_finger/config:/app/config
      - ~/facephi_finger/logs/master:/app/logs
    environment:
      - FACEPHI_FINGER_ENGINE_ROLE=master
      - FACEPHI_FINGER_ENGINE_SERVICES=Master
      - FACEPHI_FINGER_ENGINE_MASTER=master
    networks:
      - finger-cluster

  finger-worker:
    image: facephicorp.jfrog.io/docker-pro-fphi/facephi-finger-service:2.2.1
    volumes:
      - ~/facephi_finger/license:/app/license
      - ~/facephi_finger/config:/app/config
    environment:
      - FACEPHI_FINGER_ENGINE_ROLE=worker
      - FACEPHI_FINGER_ENGINE_SERVICES=FingerTC,Verifier
      - FACEPHI_FINGER_ENGINE_MASTER=master
    networks:
      - finger-cluster
    depends_on:
      - master
    deploy:
      replicas: 2

networks:
  finger-cluster:
    driver: bridge
```

To change the number of `worker`:

```bash
docker compose up -d --scale finger-worker=3
```

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 `worker`nodes, 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

```ini
LICENSE_TYPE=         # MACHINE, SHARED, or LOCAL
LICENSE_BEHAVIOUR=    # ONLINE or OFFLINE
LICENSE_KEY=          # Your license key
```

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

**Optional fields:**

* `LICENSE_URLS=` — Comma-separated URLs of the license servers (required for the `LOCAL`type; see [Offline licensing with a local server](https://docs.facephi.com/docs.facephi-en/sdks/backend-sdk/finger/installation/offline_licensing.md))
* `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 logs a warning. Finger Service product credentials are embedded at build time, so these fields must be omitted from deployment templates.

### License connectivity

* With `ONLINE`licenses, the server must have outbound HTTPS access to the license servers assigned to the deployment. If outbound traffic is restricted, ask Facephi for the exact allowlist for your deployment before installation.
* For installations without Internet access, use a local license server (see [Offline licensing with a local server](https://docs.facephi.com/docs.facephi-en/sdks/backend-sdk/finger/installation/offline_licensing.md)).

## Public API overview

{% hint style="danger" %}
**Compatibility note** The following routes correspond to the public 2.x contract. Clients built for 1.x.x must be migrated before they can call this version correctly.
{% endhint %}

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 require a JWT signed with HS256 using `auth_jwt_secret` and with the `exp`
* claim. Always set `auth_jwt_secret` when enabling authentication: if it is empty, all protected endpoints return HTTP `401` with `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](https://docs.facephi.com/docs.facephi-en/sdks/backend-sdk/finger.md).

Startup configuration example:

```json
{
  "auth_enabled": true,
  "auth_jwt_secret": "replace-with-secret",
  "auth_accept_authorization_header": true,
  "auth_accept_api_key_header": true,
  "auth_api_key_header_name": "x-api-key"
}
```

Environment variable example:

```bash
export FACEPHI_FINGER_REST_AUTH_ENABLED=true
export FACEPHI_FINGER_REST_AUTH_JWT_SECRET=replace-with-secret
export FACEPHI_FINGER_REST_AUTH_ACCEPT_AUTHORIZATION_HEADER=true
export FACEPHI_FINGER_REST_AUTH_ACCEPT_API_KEY_HEADER=true
export FACEPHI_FINGER_REST_AUTH_API_KEY_HEADER_NAME=x-api-key
```

## 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)

```json
{
  "port": 6982,
  "number_of_threads": 1,
  "connection_timeout": 60,
  "keep_alive_request_number": 0,
  "client_max_body_size": 100,
  "logger_level": "info",
  "logger_path": "",
  "logger_file_prefix": "app",
  "logger_rotation": "daily",
  "logger_max_files": 7,
  "metrics_enabled": true,
  "auth_enabled": false,
  "auth_jwt_secret": "",
  "auth_accept_authorization_header": true,
  "auth_accept_api_key_header": true,
  "auth_api_key_header_name": "x-api-key",
  "engine_connection_timeout": 10000,
  "engine_request_timeout": 60000,
  "engine_max_retries": 3,
  "engine_retry_delay": 1000,
  "engine_verify_ssl": false,
  "engine_verbose": false,
  "engine_pool_size": 4,
  "engine_url": "http://localhost:8080",
  "metrics_saturation_queue_p95_ms": 250,
  "metrics_saturation_min_inflight_ratio": 1.0,
  "metrics_error_rate_warning": 0.05,
  "metrics_idle_rps_threshold": 0.01,
  "metrics_quality_alert_window_seconds": 900
}
```

### 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 sent 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 keep (0 = unlimited)                                                                                                                                      |
| `metrics_enabled`                  | boolean | true        | Collects the traffic, saturation, and latency counters published by `GET /api/v1/finger/metrics` and `GET /api/v1/finger/metrics/prometheus`. With `false`, those blocks 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 metric 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_QUALITY`. With `0`, the alert is deactivated |

A value that cannot be interpreted, or is negative, is discarded with a log warning: if it comes from an environment variable, the value from `config.json`is used, and 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 by `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 by these 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:

```bash
# Update configuration
curl -X POST http://localhost:6982/api/v1/finger/config \
  -H "Content-Type: application/json" \
  -d '{"config_json_string":"{\"engine_request_timeout\":45000,\"metrics_error_rate_warning\":0.1}"}'

# Verify current configuration
curl http://localhost:6982/api/v1/finger/config
```

`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 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, and 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` equal 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 `message` equal 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 stored in memory and are not automatically persisted to `config.json`. To retain changes after a restart, update the mounted file 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.
* Values are cumulative for the license, 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:**

```bash
docker exec facephi-finger-service ls -la /app/license/
```

**Check the logs:**

```bash
docker logs facephi-finger-service
```

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

| Log line                                                                        | Cause                                                                             |
| ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `Failed to open license file: /app/license/license.lic`                         | The license file is not in 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` node and 30 seconds on a `worker`. Wait until you see `Finger service 2.2.1 started` in the log before sending requests or considering a startup probe to have failed.

### `GET /api/v1/finger/health` returns `Unhealthy`

Check the response fields:

* `license.valid` equals `false`: the license is invalid; `license.statusMessage` indicates the reason (see “License validation fails”).
* `license.valid` equals `true` and `engine.healthy` equals `false`: the internal processing components are not ready. This usually happens while they are still starting up, with `engine.lastError` equals `Engine nodes not yet fully registered`; check again in 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 confirm that 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>`.

### The 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 set to `master` (or is undefined) on the node that receives 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` in `GET /api/v1/finger/metrics`

## Update

To update to a new version:

{% hint style="warning" %}
**Important** Upgrading from 1.x.x to 2.x is an API migration with breaking changes, not a direct replacement. Validate all client calls against the public 2.x contract before promoting the deployment.
{% endhint %}

```bash
# Pull new version
docker pull facephicorp.jfrog.io/docker-pro-fphi/facephi-finger-service:<new_version>

# Update docker-compose.yml with new version
# Stop current service
docker compose down

# Start new version
docker compose up -d

# Verify upgrade
curl http://localhost:6982/api/v1/finger/version
```

**Always review the release notes before upgrading.**
