Symptom
When you run a Cribl CLI command manually on Windows, it might not use the configuration stored in C:\ProgramData\Cribl. As a result, commands such as diag connect can default to localhost instead of the configured Leader or Outpost.
For example, cribl.exe diag connect can return ECONNREFUSED for localhost:4200 even when the remote endpoint is reachable.
PS C:\Program Files\Cribl\bin> .\cribl.exe diag connect Testing leader connectivity: localhost:4200 via TCP (plain) Config source: instance.yml FAILED: could not connect to localhost:4200 via TCP (plain) Error: connect ECONNREFUSED ::1:4200 connect ECONNREFUSED 127.0.0.1:4200
The diag connect command resolves Leader connection settings in this order:
- Environment variables, including
CRIBL_DIST_MASTER_URL instance.ymllocalhost, if neither provides the connection settings
Environment
- Cribl Edge on Windows
- Managed Edge deployment
- Windows MSI installation using the default paths: binaries in
C:\Program Files\Cribland runtime data, includinginstance.yml, inC:\ProgramData\Cribl
Resolution
- Open a PowerShell prompt.
- Define the configuration directory for the current session:
$env:CRIBL_VOLUME_DIR = 'C:\ProgramData\Cribl'- Navigate to the Cribl binary directory:
cd 'C:\Program Files\Cribl\bin'- Run the diagnostic command:
.\cribl.exe diag connect- Verify that the command tests the configured Leader or Outpost instead of
localhost. - Set
CRIBL_VOLUME_DIRin the environment of any automation process before running Cribl CLI commands.
Cause
This can be caused by:
- On Windows, an MSI installation places Cribl binaries in
C:\Program Files\Cribland runtime data, includinginstance.yml, inC:\ProgramData\Criblby default. - When
cribl.exeis run directly, it does not automatically use the same runtime-data directory as the Windows service. - Without
CRIBL_VOLUME_DIR, the CLI may look forinstance.ymlrelative to the installation directory instead ofC:\ProgramData\Cribl. If it cannot find the connection settings, it falls back tolocalhost.
Additional Information
For more information, see the following resources.
- Install Cribl Edge on Windows
- Windows CLI diagnostic guidance: Cribl documents the
CRIBL_VOLUME_DIRrequirement and the defaultC:\ProgramData\Criblpath. - If you use a custom installation or runtime-data directory, substitute those paths for the default paths shown in this article.
