Skip to content

Troubleshooting the OneTick Cloud KDB-X Module

This guide helps you diagnose and resolve common OneTick Cloud KDB-X module errors.

Issue index

Category Issue Summary
Installation Module files missing or archive incomplete The archive is absent or incomplete
Installation Module load fails on macOS macOS blocks or cannot load the native module binary
Compression zlib warning Queries use uncompressed responses
Configuration Missing mandatory credentials Required OAuth 2.0 settings are absent
Authentication No token received The token endpoint did not return an access token
HTTP REST API error OneTick returned a non-success HTTP status
SQL Invalid SQL statement OneTick rejected the submitted SQL
Results No data returned The response contains no main data table
Results Response limit reached The query exceeds the account limit

Installation issues

Module files missing or archive incomplete

Symptoms

  • use cannot find kx.onetickcloud.
  • The loader reports ld: neither arrowkdb.q nor arrowkdb.q_ exists.
  • The loader reports .../onetickcloud/<platform>/arrowkdb.so: cannot open shared object file: No such file or directory.
  • The module loads on one platform but fails after copying only selected files to another installation.

Resolution

The following paths use the default KDB-X installation directory, $HOME/.kx. If you installed KDB-X elsewhere, replace $HOME/.kx with your installation directory.

  1. Confirm the archive matches the operating system and architecture.
  2. Extract the complete archive, including all files and subdirectories, into $HOME/.kx/mod/kx.
  3. Confirm that the module contains init.q_, arrowkdb.q_, and <platform>/arrowkdb.so for the operating system and architecture.
  4. Replace the entire module directory if upgrading from an earlier archive.

Module load fails on macOS

Messages

macOS can report either of these errors:

library load disallowed by system policy
.../onetickcloud/<platform>/arrowkdb.so: cannot open shared object file: No such file or directory

Check whether the native module binary exists. A missing binary indicates an incomplete installation; follow Module files missing or archive incomplete. For an existing binary in a module downloaded from the KX downloads portal, remove the macOS quarantine attribute, then retry loading the module:

xattr -rd com.apple.quarantine "$HOME/.kx/mod/kx/onetickcloud"

Compression issues

zlib warning

Message

WARNING: zlib is not installed, requesting uncompressed payload.

The query can still complete. The module requests an uncompressed Arrow response, which uses more network bandwidth.

On supported Ubuntu and macOS installations, zlib is normally already available. This warning is primarily a defensive fallback for minimal environments where KDB-X cannot load it.

If the warning appears, install zlib by following File compression and gzip, then restart q.

Configuration and authentication issues

Missing mandatory credentials

Message

Error: Missing mandatory credentials for query: [ ... ]

This error means that the active configuration does not contain one or more required settings: rest_url, openid_url, client_id, or client_secret.

Set the missing values with environment variables or .otc.set_credentials. Refer to Configure the module for the recognized settings and configuration precedence.

No token received

Message

Error: No token received. Check credentials are correct. Credentials can be updated using [ set_credentials ] function

Likely causes

  • Incorrect client ID or client secret.
  • Incorrect OAuth 2.0 token endpoint.
  • The credentials have expired, or the OneTick administrator has revoked them.
  • A proxy, firewall, or TLS policy blocks the token request.

Resolution

  1. Verify OTP_ACCESS_TOKEN_URL, OTP_CLIENT_ID, and OTP_CLIENT_SECRET.
  2. Reapply the configuration with .otc.set_credentials to clear the cached token.
  3. Confirm the host can reach the token endpoint over HTTPS.
  4. Contact the OneTick administrator if the credentials are no longer active.

Warning

Do not paste the output of .otc.get_credentials[] into tickets or logs. It can contain the client secret and bearer token.

HTTP issues

REST API error

Message format

HTTP error <status>: <response body>

The module automatically refreshes the token and retries once when it receives HTTP status 401. If OneTick returns 401 again, verify the credentials and endpoint. For 403, confirm that the account has access to the requested dataset. For other statuses, inspect the response text and verify OneTick service availability and network connectivity.

The module does not expose general retry or timeout settings. Apply application-level retry logic only where repeating the query is safe.

Query issues

Invalid SQL statement

Example

Invalid SQL statement:
from keyword not expected at position 9 in expression

OneTick validates and executes the SQL. Check spelling, table and field names, timestamp literals, and the SQL features supported by the target OneTick environment.

Review the OneTick SQL querying examples for supported query patterns.

Capture the full OneTick error with protected evaluation:

result:@[.otc.sql_rest;sql;{x}]

Result issues

No data returned

Message

No data returned.

The response did not contain a PROCESS_EVENT table. Check:

  • The symbol and dataset name.
  • The requested time range and time zone.
  • Whether the account can access the dataset.
  • Whether matching records exist.

Response limit reached

The packaged demonstration credentials allow up to 10 MB per query. When a query exceeds the server-side limit, OneTick can return an exception containing:

ERR_00000707AAAAA

Reduce the response by:

  • Selecting only required columns.
  • Narrowing the time range.
  • Filtering symbols more precisely.
  • Adding or reducing a limit clause.

Refer to Response limits for subscriber limits.

Handle errors in application code

Use protected evaluation when a service or query error should not interrupt the surrounding q workflow:

result:@[.otc.sql_rest;arg;{x}];

$[10h=type result;
    -2 "OneTick query failed: ",result;
    show result];

Next steps