How-to guide

Troubleshoot the XTM stack

Find the logs of each part of the XTM stack, raise their level, and fix the common startup, ingestion and Elasticsearch errors.

All modulesFor platform engineers

This page helps you find why a part of the XTM stack fails: where its logs are, how to make them more detailed, and what the common errors mean, from a stack that does not start to data that OpenCTI rejects. For problems with integrations that XTM Composer runs, see Troubleshoot integrations.

SYMPTOMSWHERE TO LOOKASK FOR HELPStack does not startOr a platform stays unhealthyData rejectedBundles OpenCTI could not writeElasticsearch errorsDisk full, shards not availabledocker compose psServices and their healthdocker compose logsJSON lines of each serviceConnector worksError codes of the bundlesCluster health_cluster/healthSupport packageLogs of every OpenCTI nodeCommunity SlackOr a GitHub issue
  1. Stack does not start → docker compose ps: health
  2. Stack does not start → docker compose logs: why it fails
  3. Data rejected → Connector works: error code
  4. Elasticsearch errors → Cluster health: check
  5. docker compose logs → Support package: still stuck
  6. Support package → Community Slack: attach
Each symptom has its place to look, the health and logs of the services, the works of the connectors or the health of the Elasticsearch cluster, before you ask for help

Find the logs

Every service of xtm-docker writes its logs to the console of its container. From the xtm-docker folder:

docker compose ps
docker compose logs --tail 200 opencti
docker compose logs -f openaev xtm-one

docker compose ps shows the services that run and their health; docker compose logs takes the name of a service, such as opencti, worker, openaev, xtm-one, xtm-one-worker, xtm-composer or connector-mitre. The platforms, workers and connectors write JSON lines.

Raise the log level

In production, keep the platforms at error or warn level. To investigate, raise the level of one service, then lower it again: debug logs are large. Set the variable in docker-compose.override.yml, as Change the stack without editing docker-compose.yml describes, or in .env where the table says so, then run docker compose up -d <service>.

OpenCTI
PartVariableValues
PlatformAPP__APP_LOGS__LOGS_LEVELerror, warn, info, debug. xtm-docker sets error
WorkersWORKER_LOG_LEVELerror, warning, info (default), debug
ConnectorsCONNECTOR_LOG_LEVELerror, warning, info, debug

APP__APP_LOGS__LOGS_CONSOLE=true writes the platform logs to the console, the default. Workers and connectors write JSON while OPENCTI_JSON_LOGGING is true, the default for workers.

services:
  opencti:
    environment:
      - APP__APP_LOGS__LOGS_LEVEL=info
OpenAEV

OpenAEV takes the logging settings of Spring Boot. To log its own code at debug level:

services:
  openaev:
    environment:
      - LOGGING_LEVEL_IO_OPENAEV=debug
XTM One

XTM_ONE_LOG_LEVEL in .env sets the level of xtm-one and xtm-one-worker (default info), and XTM_ONE_LOG_FORMAT their format (default json).

Control what OpenCTI logs

Besides the console, the platform writes two log files: error.log, errors only, and opencti.log, every entry at the configured level. They rotate daily. In a container, they stay inside it and are lost when it is recreated: collect the console output instead, and turn the files off.

KeyDefaultWhat it does
app:app_logs:logs_filestrueWrites the log files
app:app_logs:logs_directory./logsFolder of the files, relative to the folder the platform runs from
app:app_logs:logs_max_files7Daily files kept for each log

Each entry carries metadata, such as the data of an error. OpenCTI cuts it to keep log lines small:

KeyDefaultWhat it does
app:app_logs:control:max_string_size5000Longest string, in characters. A longer one is cut and ends with ...
app:app_logs:control:max_array_size50Elements kept from a list
app:app_logs:control:max_depth_size10Nesting depth. Deeper objects are dropped
app:app_logs:control:max_depth_keys100Keys written for one entry. The next ones are dropped

Two settings help an investigation, and are off by default because of what they write:

  • app:app_logs:extended_error_message adds the input data to error logs, and the GraphQL query and its variables to the logs of failed API calls. The logs then hold sensitive data.
  • app:performance_logger logs every API call at info level, with its duration, size and memory use. It writes a lot of logs.

For example, to investigate a failing import from the console only:

services:
  opencti:
    environment:
      - APP__APP_LOGS__LOGS_LEVEL=info
      - APP__APP_LOGS__LOGS_FILES=false
      - APP__APP_LOGS__EXTENDED_ERROR_MESSAGE=true

Set APP__APP_LOGS__EXTENDED_ERROR_MESSAGE back to false once you have found the cause. The other log keys are in the Errors, Logging and Audit sections of the configuration reference.

The stack does not start

SymptomCause and fix
Elasticsearch stops or restarts in a loopIts logs say why. On Linux, it often needs more virtual memory areas: run sudo sysctl -w vm.max_map_count=262144 on the host, and add vm.max_map_count=262144 to /etc/sysctl.conf to keep it after a reboot
OpenCTI stops at start with You need to configure the environment vars, Email must be a valid email address or Token must be a valid UUIDThe bootstrap admin of .env is incomplete or invalid. OPENCTI_ADMIN_EMAIL must be an email address and OPENCTI_ADMIN_TOKEN a UUID, such as the output of uuidgen. Neither the password nor the token may be empty or ChangeMe. See Sign in the first time and keep an emergency account
A platform stays starting or unhealthyOne of its dependencies is not healthy: check docker compose ps, then the logs of the platform and of the dependency. Check that every variable of .env has a value
OpenAEV stops at start with FATAL: password authentication failed for userThe PostgreSQL credentials do not match. PostgreSQL takes POSTGRES_USER and POSTGRES_PASSWORD only when it creates its data volume, pgsqlshareddata: changing them in .env afterwards does not change the existing user. Set them back to the values the volume was created with, or change the password inside PostgreSQL with ALTER USER. On a manual installation, spring.datasource.username and spring.datasource.password must be those of the PostgreSQL user
xtm-one-db-init failsIts logs say why: XTM_ONE_POSTGRES_USER and XTM_ONE_POSTGRES_PASSWORD must be set, and XTM_ONE_POSTGRES_USER must differ from POSTGRES_USER
The platforms run but do not see each otherCheck the tokens. PLATFORM_REGISTRATION_TOKEN must be the same for XTM One, OpenCTI and OpenAEV, also when they run in separate deployments

OpenCTI ingestion errors

OpenCTI reports the errors of the bundles it could not write in the works of each connector, with an error code.

Technical errors

ErrorMeaning and fix
MISSING_REFERENCE_ERROR, Element(s) not foundAn object refers to another one that does not exist, such as a relationship whose target is missing. It is raised after several retries, in case the missing object arrives in the meantime. It usually comes from a connector that produces inconsistent STIX 2.1 bundles
Cant upsert inferred entity. Too many entities resolvedAn inference rule produced an entity that matches several existing entities, such as two entities that share a name or an alias, and OpenCTI does not choose which one to update. Data from connectors does not raise it: OpenCTI merges the matching entities. Merge the duplicates in the platform
LOCK_ERROR, Execution timeout, too many concurrent call on the same entitiesSeveral workers changed the same entities at the same time and waited too long for each other. It depends on the throughput of Elasticsearch, the number of workers, the dependencies between the data and the merges. Lower the number of workers, then find the balance between workers, connectors and Elasticsearch sizing. See Scale

Data errors

CodeMeaning and fix
INCORRECT_INDICATOR_FORMATThe pattern of an Indicator is not valid, such as a malformed YARA rule. Fix it at the source
INCORRECT_OBSERVABLE_FORMATThe value of an observable is not valid for its type, such as an IPv4 address that is not one
INDICATOR_PATTERN_EXCLUDEDThe pattern of an Indicator contains a value of one of your exclusion lists, so the Indicator is rejected on purpose; the rest of the bundle is imported. The error gives the value and the list. If the value should not be excluded, edit the list in Settings, then Customization, then Exclusion lists

Elasticsearch errors

ErrorMeaning and fix
TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermarkThe disk of Elasticsearch is almost full, and Elasticsearch blocks writes to protect itself. Free or add disk space: Elasticsearch lifts the block once usage falls back under its high watermark
Engine execution fail, some shards are not availableSome shards of an index cannot be read. Check the health of the cluster with docker compose exec elasticsearch curl -s 'http://localhost:9200/_cluster/health?pretty'

To look into the data that OpenCTI stores, connect Kibana or OpenSearch Dashboards to your cluster.

Ask for help

Generate a support package of OpenCTI, then ask on the Filigran community Slack or open an issue for OpenCTI or OpenAEV.

What's next

NextThe XTM stack: modules and shared services
Deploy
Install, configure, secure, scale and upgrade the platform.

Published

Overview
Run the XTM platform locally
OverviewDeploy with an AI agent