๐ 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.