Skip to main content

๐Ÿ›  ZTeraDB Troubleshooting Guide

If you see errors like:

Compiled with problems
Connection failed
Invalid configuration
FilterConditions error
Cannot find module 'zteradb'

This guide will help you fix them quickly.


๐Ÿ”‘ 1. Configuration Errors

โŒ Error:โ€‹

Missing or invalid clientKey / accessKey / secretKey

โœ” Fix:โ€‹

Make sure your .env contains all required fields:

ZTERADB_CONFIG={
"clientKey": "<Your ZTeraDB client key>",
"accessKey": "<Your ZTeraDB access key>",
"secretKey": "<Your ZTeraDB secret key>",
"databaseID": "<Your ZTeraDB database id>",
"env": "<Your working environment one of prod/staging/qa/dev>",
"responseDataType": "json"
}

โŒ Error:โ€‹

JSON.parse error for ZTERADB_CONFIG

โœ” Fix:โ€‹

Your .env must have valid JSON.

Check for:

  • Missing quotes
  • Trailing commas
  • Wrong brackets

๐ŸŒ 2. Connection Errors

โŒ Error:โ€‹

Connection refused

โœ” Fix:โ€‹

  • Check host
    Must be something like:
    db1.zteradb.com
  • Check port
    Usually: 7777
  • Check internet/firewall/VPN

โŒ Error:โ€‹

ECONNRESET
ETIMEDOUT

โœ” Fix:โ€‹

  • Retry connection
  • Ensure no firewall blocks outbound TCP
  • Ensure server is reachable

๐Ÿ“ฆ 3. Import Errors

โŒ Error:โ€‹

Cannot find module 'zteradb'

โœ” Fix:โ€‹

Install it:

npm install zteradb

Or reinstall:

rm -rf node_modules package-lock.json
npm install

๐Ÿงฑ 4. Query Errors

โŒ Error:โ€‹

Missing query type

โœ” Fix:โ€‹

Always call .select(), .insert(), .update(), or .delete().

new ZTeraDBQuery("user").select();

โŒ Error:โ€‹

Fields not provided for INSERT or UPDATE

โœ” Fix:โ€‹

query.insert().fields({ email: "test@test.com" });

๐Ÿ” 5. FilterConditions Errors

โŒ Error:โ€‹

Invalid parameters passed to ZTMUL

โœ” Fix:โ€‹

Pass array values only:

ZTMUL(["price", "quantity"])

โŒ Error:โ€‹

Invalid filter: expected array

โœ” All logical and conditional filters accept arrays:

ZTAND([condition1, condition2]);

๐Ÿงช 7. Debugging Tips

โœ” Tip 1 โ€” Log Your Queryโ€‹

console.log(query.generate());

โœ” Tip 2 โ€” Try Simple Query Firstโ€‹

If nothing works:

new ZTeraDBQuery("user").select();

โœ” Tip 3 โ€” Check Keys Againโ€‹

99% issues occur due to incorrect credentials.


๐Ÿ†˜ If Still Not Working

Share the error message, and Weโ€™ll fix it immediately.