Common issues and their solutions when working with Moose.
moose dev fails to startPossible causes and solutions:
Port conflicts
# Find processes using ports
lsof -i :4000-4002
# Kill process by PID
kill <PID>Configuration Override: You can also change the ports Moose uses via environment variables:
export MOOSE_HTTP_PORT=4040
export MOOSE_MANAGEMENT_PORT=5010
moose devMissing dependencies
npm installDocker not running
# Check Docker status
docker info
# Start Docker on Linux
sudo systemctl start dockerContainer Startup Failures
# View logs
moose logsValidation errors
moose logsStream processing errors
moose logs --filter functionsDatabase connectivity
.moose/config.toml[clickhouse_config]db_name = "local"user = "panda"password = "pandapass"use_ssl = falsehost = "localhost"host_port = 18123native_port = 9000Insufficient parallelism
const stream = new Stream<Data>("high_volume", { parallelism: 8 // Increase from default});Transform function errors
// Add logging to transformstream.addTransform(outputStream, (record) => { console.log('Processing record:', record.id); try { // Your transformation logic return transformedRecord; } catch (error) { console.error('Transform error:', error); return undefined; // Skip record on error }});Missing or improper indexes
const table = new OlapTable<Data>("slow_table", { orderByFields: ["frequently_queried_field", "timestamp"]});Large result sets
// In query APIconst results = await client.query.execute(sql` SELECT * FROM large_table WHERE category = 'example' LIMIT 100`);Configuration errors
# Validate configuration
moose validate --configResource limitations
# In kubernetes manifestresources: requests: memory: "1Gi" cpu: "500m" limits: memory: "2Gi" cpu: "1000m"Permission issues
# Check permissions
moose auth checkCause: A previous migration was interrupted without releasing its lock.
Solution:
Wait 5 minutes - locks expire automatically
Or manually clear the lock:
DELETE FROM _MOOSE_STATE WHERE key = 'migration_lock';Verify it worked:
SELECT * FROM _MOOSE_STATE WHERE key = 'migration_lock';-- Should return no rowsThe _MOOSE_STATE table uses ClickHouse's KeeperMap engine for distributed locking, ensuring only one migration runs at a time across multiple deployments.
If you can't resolve an issue:
moose --version)