Troubleshooting
This page covers the most common issues you may encounter when running dtoolkit and how to resolve them.
Port already in use
Section titled “Port already in use”Symptom: A service fails to start with EADDRINUSE or a “port already in use” error.
Cause: Another instance of the service (or a different process) is already bound to that port.
| Service | REST / MCP port | Dashboard port |
|---|---|---|
| dbrain | 7878 | 7879 |
| dwork | 7881 | 7882 |
| dops | 7883 | 7884 |
| dproxy | 7880 | — |
Fix:
- Check whether the service is already running:
dbrain statusdwork statusdops status- If a stale process is occupying the port, find and stop it:
lsof -i :7878kill <PID>- Alternatively, change the port in the service config file (
~/.dbrain/config.json,~/.dwork/config.json, or~/.dops/config.json).
Unauthorized (401)
Section titled “Unauthorized (401)”Symptom: API requests return 401 Unauthorized.
Cause: The bearer token is missing, incorrect, or not configured.
Fix:
- Check the token stored in the service config:
cat ~/.dbrain/config.json | grep tokencat ~/.dwork/config.json | grep token- Ensure your requests include the
Authorizationheader:
curl -H "Authorization: Bearer <your-token>" http://localhost:7878/health- If you are using
@dtoolkit/sdk, pass the token when constructing the client:
import { DBrainClient } from '@dtoolkit/sdk';
const client = new DBrainClient({ baseUrl: 'http://localhost:7878', token: 'your-token',});MCP tools not showing up
Section titled “MCP tools not showing up”Symptom: Your AI coding CLI (Claude Code, Gemini CLI, etc.) does not list dtoolkit MCP tools like recall, remember, or get_entity.
Cause: The CLI has not been connected to the dtoolkit MCP server.
Fix:
- For dbrain, run the connect command for your CLI:
dbrain connect claudedbrain connect geminidbrain connect codex- For dcontext hooks (which bridge dbrain and dwork into your CLI), install them:
dcontext install-
Restart your AI coding CLI after connecting. Most CLIs do not hot-reload MCP server configurations.
-
Verify the connection is registered:
dbrain statusdcontext statusrecall returns no results
Section titled “recall returns no results”Symptom: Calling the recall MCP tool or the /search REST endpoint returns an empty result set.
Cause: The brain has no stored facts yet, or the search query does not match any indexed content.
Fix:
- Verify the brain has content:
curl -H "Authorization: Bearer <token>" http://localhost:7878/entities- If the brain is empty, store some facts first:
curl -X POST http://localhost:7878/facts \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{"entityId": "<id>", "content": "Prefers TypeScript over JavaScript"}'- If the brain has content but search returns nothing, try broader search terms. FTS5 uses OR-based matching by default — single keywords work better than long phrases.
Federation not working
Section titled “Federation not working”Symptom: recall does not return results from a connected shared brain, or share fails.
Cause: The shared brain is unreachable, the connection is misconfigured, or API keys are not enabled on the shared brain.
Fix:
- Check your connections:
dbrain connections- Verify the shared brain is running and reachable:
curl http://<shared-brain-host>:7878/health- Ensure the shared brain has API keys enabled. Shared brains require explicit key configuration:
dbrain keys list # run on the shared brain- If the connection details have changed, remove and re-add:
dbrain unlink <connection-name>dbrain link <shared-brain-url> --token <key>Dashboard not loading
Section titled “Dashboard not loading”Symptom: Opening the dashboard URL in a browser shows a connection error or blank page.
Cause: The underlying server is not running. The dashboard is served as a static page by the same Fastify instance — if the server is down, the dashboard is down.
Fix:
- Start the service:
dbrain start# ordwork start# ordops start- Confirm the server is healthy:
curl http://localhost:7878/health # dbraincurl http://localhost:7881/health # dworkcurl http://localhost:7883/health # dops- Open the dashboard on port + 1:
| Service | Dashboard URL |
|---|---|
| dbrain | http://localhost:7879 |
| dwork | http://localhost:7882 |
| dops | http://localhost:7884 |
dcontext hooks not firing
Section titled “dcontext hooks not firing”Symptom: Session context is not injected at startup, or transcripts are not saved before compaction.
Cause: The hooks were never installed, or the AI coding CLI version is incompatible.
Fix:
- Check hook installation status:
dcontext status- If hooks are not installed, run:
dcontext install- Verify dcontext can reach dbrain:
dbrain status- If hooks still do not fire, check that your AI coding CLI supports the hook system dcontext targets. Supported CLIs and their hook mechanisms:
| CLI | Hook mechanism |
|---|---|
| Claude Code | settings.json hooks |
| Gemini CLI | settings.json hooks |
| Codex CLI | config.toml hooks |
| OpenCode | npm plugin hooks |
- After reinstalling hooks, restart your CLI.
Build errors with pnpm
Section titled “Build errors with pnpm”Symptom: pnpm install or pnpm build fails with compilation or dependency errors.
Cause: Incorrect Node.js version, outdated pnpm, or stale lockfile.
Fix:
- Verify Node.js version (must be 22 or higher):
node --version- Verify pnpm is up to date:
pnpm --version- Clean and reinstall:
rm -rf node_modules packages/*/node_modulespnpm install- If the lockfile is out of sync (common after switching branches):
pnpm install --no-frozen-lockfile- Run the full build:
pnpm buildSQLite errors
Section titled “SQLite errors”Symptom: A service crashes with SQLite-related errors such as SQLITE_CORRUPT, database disk image is malformed, or SQLITE_BUSY.
Cause: The database file may be corrupted (e.g., from an unclean shutdown) or locked by another process.
Fix:
- Try running the compact command, which rebuilds indexes and deduplicates data:
dbrain compact- If compact fails, back up the current database and re-initialize:
cp ~/.dbrain/dbrain.db ~/.dbrain/dbrain.db.bakdbrain initThe same approach applies to dwork and dops:
# dworkcp ~/.dwork/dwork.db ~/.dwork/dwork.db.bakdwork init
# dopscp ~/.dops/dops.db ~/.dops/dops.db.bakdops init- For
SQLITE_BUSYerrors, ensure only one instance of the service is running:
dbrain statusGetting more help
Section titled “Getting more help”If your issue is not listed here:
- Check the product-specific documentation: dbrain, dwork, dops, dproxy, dcontext.
- Review the CLI reference and MCP tools reference for correct usage.
- Open an issue on the dtoolkit GitHub repository with your error output, service status, and Node.js/pnpm versions.