Troubleshooting
This guide summarizes the diagnosis and solutions for common issues with Smart SCADA Data Platform (ss-data), categorized by symptom for quick identification.
1. Backend Fails to Start
1.1 Port Conflict
Symptom: Startup error EADDRINUSE: address already in use :::4000
Diagnosis:
# Check the process occupying port 4000
netstat -ano | findstr ":4000"
Solution:
| Option | Action |
|---|---|
| Release the port | taskkill /PID <process-id> /F |
| Change the port | Modify PORT=4001 in .env.dev, sync frontend VITE_API_BASE_URL |
1.2 Missing Dependencies or Compilation Failure
Symptom: pnpm dev reports module not found, or Cannot find module '@ss-node/ss-core'
Diagnosis:
- Workspace package not compiled, dependents cannot find
dist/artifacts
Solution:
cd ss-services\ss-node
pnpm install # Ensure dependencies are installed
pnpm build # Compile all workspace packages
# Or compile a single package
pnpm --filter @ss-node/ss-core build
pnpm --filter @ss-node/ss-device build
⚠️ After modifying workspace package source code, you must recompile that package for it to take effect in dependents. See section 7 for details.
1.3 Database Locked
Symptom: SQLITE_BUSY: database is locked
Diagnosis:
- Multiple processes accessing the same SQLite file simultaneously
- Previous process did not exit normally, file lock not released
Solution:
- Ensure only one backend process accesses that DB file
- Close residual processes:
# Find node processes
tasklist | findstr node
taskkill /PID <process-id> /F
- If still locked, delete the
-waland-shmfiles and restart:
del ss-services\ss-node\data\ss-node.db-wal
del ss-services\ss-node\data\ss-node.db-shm
1.4 better-sqlite3 Compilation Failure
Symptom: better-sqlite3 reports compilation errors during pnpm install
Solution:
| Platform | Action |
|---|---|
| Windows | npm install --global windows-build-tools or install Visual Studio Build Tools |
| Linux | apt install python3 make g++ |
| macOS | xcode-select --install |
2. Frontend Fails to Load
2.1 API Proxy Failure
Symptom: Browser F12 Network shows API requests returning 404 or connection refused
Diagnosis:
- Confirm backend is running: visit
http://localhost:4000/api/v1/system/health - Check that
VITE_API_BASE_URLin frontend .env.development matches the backend port
Solution:
- When backend port changes to 4001, sync the frontend:
VITE_API_BASE_URL=http://localhost:4001
VITE_WS_URL=http://localhost:4001
- After modifying env, you must restart the frontend dev server
2.2 CORS Error
Symptom: Browser console reports Access-Control-Allow-Origin error
Diagnosis: Backend CORS configuration does not include the frontend domain
Solution:
Configure allowed origins in the backend env (comma-separated):
CORS_ORIGINS=http://localhost:5173,http://localhost:3000
By default, http://localhost:5173 and http://localhost:3000 are allowed. Production deployment needs to add the actual domain. CORS configuration is in main.ts.
2.3 Blank Page
Symptom: Visiting http://localhost:5173 shows a blank page
Diagnosis Steps:
- Check the F12 console for JS errors
- Verify the frontend started successfully (no errors in terminal)
- Clear browser cache and LocalStorage, then retry
3. Device Offline Troubleshooting
3.1 Device Status is Offline
Diagnosis Flow:
Device offline
├─ 1. Check if device enabled is on (database devices.enabled)
├─ 2. Check if collector is running (collector-bootstrap logs)
├─ 3. Check network connectivity (ping / telnet)
├─ 4. Check protocol configuration (host/port/unitId)
└─ 5. Check collection logs data/logs/combined.log
Common Diagnostic Commands:
# Modbus TCP connectivity test
telnet 192.168.1.10 502
# View collection-related logs
findstr "collector" ss-services\ss-node\data\logs\combined.log
3.2 Virtual Device Offline
Symptom: Virtual device (protocol=virtual) also shows offline
Cause: Collector not started or device collection not enabled
Solution:
- Confirm device
enabled=true - Restart the backend service and check the startup logs to see if
DeviceCollectorBootstraploaded the device - Check the
PLUGIN_CONFIG_DIRdirectory permissions
3.3 Data Not Updating
Symptom: Device is online but tag values are not changing
Troubleshooting:
- Check if the tag
Collection Enabledis checked - Check if
scanRateis too large - Check if the real-time data cache directory
REALTIME_DATA_DIRhas writes - When InfluxDB is configured but not connected, writes will fail but real-time push is unaffected
4. WebSocket Connection Issues
4.1 Connection Failure
Symptom: Frontend ws-monitor page shows disconnected, real-time data not refreshing
Diagnosis:
- Confirm
VITE_WS_URLmatches the backend port - Browser F12 → Network → WS tab to view connection status
- Check backend logs for Socket.IO handshake records
Solution:
- Port mismatch: modify frontend
VITE_WS_URL - Reverse proxy: ensure Nginx forwards WebSocket (
proxy_set_header Upgrade $http_upgrade)
4.2 Frequent Disconnects and Reconnects
Causes:
- Heartbeat timeout (default configuration)
- Unstable network
- Backend restart
Solution:
- Stabilize the network environment
- Configure Redis to persist offline messages, avoiding loss of unread data after reconnection
4.3 No Data Push on Subscription
Troubleshooting:
- Confirm the
subscribe:dataevent carries the correctprojectId - Confirm the device is online and collecting data
- Check backend logs to see if
data:updateevents are being emitted
5. Knowledge Base Directory Not Displayed
5.1 Knowledge Base is Empty
Symptom: Visiting the knowledge base page shows no content
Diagnosis:
- Confirm the
KB_ROOTdirectory exists and has content:
dir ss-run\ss\data\faq\zh-CN
- Confirm
KB_SUPPORTED_LANGSincludes the target language - Confirm the document frontmatter
langmatches the directory name
Solution:
- If the directory does not exist, create it and add documents
- After modifying env, restart the backend service
5.2 Documents Not Refreshing
Symptom: Modifying Markdown does not update the page
Cause: I18N_WATCH=false or file watching not effective
Solution:
- Set
I18N_WATCH=truein the development environment - Restart the backend service to force reload
5.3 Frontmatter Format Error
Symptom: A single document does not display or parsing errors occur
Checks:
- YAML format is correct (2-space indentation)
idis unique and includes the module pathlangmatches the directory namestatusispublished
6. Database Migration Issues
6.1 Missing Table Structure After Upgrade
Symptom: After upgrading the version, reports no such table or no such column
Cause: Old database did not execute the new version migration scripts
Solution:
- Check the
INSERT OR IGNOREandALTER TABLEstatements in the new version's../../../../../../../ss-services/ss-node/data/init/init-system-db.sql - On startup,
insertMissingMenus()automatically adds missing menus - Manually execute the missing SQL statements
6.2 Project Database Not Initialized
Symptom: After creating a new project, the device table does not exist
Cause: PROJECT_DB_INIT_DIR path is incorrect or initialization scripts are missing
Solution:
- Confirm
PROJECT_DB_INIT_DIRpoints to the directory containinginit-system-db.sql - Delete the project directory and recreate the project to trigger auto-initialization
6.3 Database File Corruption
Symptom: database disk image is malformed
Solution:
- Stop the backend service
- Back up the corrupted db file
- Restore the latest backup from
BACKUP_DIR - If no backup, delete the db file to reinitialize (⚠️ data loss)
# Recover using sqlite3 command line (if recoverable)
sqlite3 ss-node.db ".recover" > recovered.sql
sqlite3 new.db < recovered.sql
7. Workspace Package Build Issues
7.1 Source Code Changes Not Taking Effect
Symptom: Modified @ss-node/ss-core source code, but dependent behavior did not change
Cause: Workspace packages need recompilation; dependents reference the dist/ artifacts
Solution:
cd ss-services\ss-node
# Compile a single package
pnpm --filter @ss-node/ss-core build
# Compile all packages (in dependency order)
pnpm build
# Restart backend
pnpm dev
7.2 Package Dependency Order Error
Symptom: Compilation reports that a dependency package's dist/ does not exist
Solution:
Compile in dependency order: ss-sdk → ss-core → ss-device / ss-project / other business packages.
Running pnpm build directly handles the dependency order automatically (pnpm -r build executes in topological order).
7.3 Frontend Workspace Package Not Taking Effect
The same applies to the frontend. After modifying packages like @scada-editor/core, compile them:
cd ss-editor
pnpm --filter @scada-editor/core build
8. Log Location Quick Reference
| Log Type | Location | Description |
|---|---|---|
| Backend combined log | {DATA_DIR}/logs/combined.log |
All levels |
| Backend error log | {DATA_DIR}/logs/error.log |
ERROR only |
| Frontend console | Browser F12 Console | Runtime errors |
| Startup log | Terminal stdout | Startup process |
9. General Diagnostic Steps
When encountering unknown issues, follow this order for troubleshooting:
- Check logs: Does
data/logs/error.loghave ERROR entries - Check health: Does
http://localhost:4000/api/v1/system/healthreturn ok - Verify configuration: Are env file paths, ports, and tokens correct
- Recompile: Are workspace packages up to date (
pnpm build) - Restart service: Clear in-memory state
- Check docs: System Overview and the corresponding module documentation
Related Links
- Installation Guide — Reinstall and verify
- Configuration Guide — Configuration item verification
- Real-Time Communication — WebSocket details
- System Management — Health check API