Troubleshooting Guide¶
Common issues and how to solve them.
Quick Diagnosis¶
# Validate your configuration
mycel validate --config ./my-service
# Check connector connectivity
mycel check --config ./my-service
# Run with debug logging
mycel start --config ./my-service --log-level=debug
Startup Issues¶
"Port already in use"¶
Error:
Cause: Another process is using the port.
Solution:
# Find what's using the port
lsof -i :3000
# Kill it (replace PID with actual process ID)
kill -9 <PID>
# Or use a different port in service.mycel
service {
port = 3001
}
"Failed to parse configuration"¶
Error:
Cause: Syntax error in your HCL file.
Solution:
- Check the line number mentioned (line 15 in this case)
- Common issues:
- Missing closing brace
} - Missing
=in attribute assignment - Using
"instead of=for attributes - Typo in block name
Example of wrong vs correct:
# WRONG - missing =
connector "db" {
type "database" # Missing =
}
# CORRECT
connector "db" {
type = "database"
}
# WRONG - wrong brace
connector "db" {
type = "database"
# CORRECT - close the brace
connector "db" {
type = "database"
}
"Unknown connector type"¶
Error:
Cause: The connector type is misspelled or not supported.
Solution:
Use the correct type name:
| You wrote | Correct |
|---|---|
postgresql |
database with driver = "postgres" |
mysql |
database with driver = "mysql" |
mongo |
database with driver = "mongodb" |
rabbit |
rabbitmq |
redis |
cache with driver = "redis" |
Example:
# WRONG
connector "db" {
type = "postgresql"
}
# CORRECT
connector "db" {
type = "database"
driver = "postgres"
host = "localhost"
}
Database Issues¶
"Connection refused"¶
Error:
Cause: Database server is not running or wrong host/port.
Solution:
-
Check if the database is running:
-
Verify host and port in your config:
-
If using Docker, ensure containers are on the same network:
"Authentication failed"¶
Error:
Cause: Wrong username or password.
Solution:
-
Verify credentials:
-
Check environment variables are set:
-
For Docker:
"Database does not exist"¶
Error:
Solution:
Create the database first:
# PostgreSQL
createdb myapp
# Or via psql
psql -c "CREATE DATABASE myapp;"
# MySQL
mysql -e "CREATE DATABASE myapp;"
Flow Issues¶
"Flow not being triggered"¶
Symptom: You make a request but nothing happens.
Diagnosis:
- Check if the path matches exactly:
# This works
curl http://localhost:3000/users
# This does NOT work (trailing slash)
curl http://localhost:3000/users/
-
Check method matches:
-
Enable debug logging:
Look for:"Matched flow: get_users"or"No flow matched for: GET /users"
"Transform expression error"¶
Error:
Cause: Accessing a field that doesn't exist in the input.
Solution:
-
Use the null coalescing operator
??for optional fields: -
Check what's actually in
input: -
Common input structures:
- REST body:
input.field_name - URL params:
input.id(from/users/:id) - Query params:
input.query.limit - Headers:
input.headers.authorization
"Type validation failed"¶
Error:
Cause: Input doesn't match your type definition.
Solution:
-
Check your type definition:
-
Ensure client sends correct data:
-
Make fields optional if needed:
Message Queue Issues¶
"RabbitMQ connection failed"¶
Error:
Solution:
-
Check RabbitMQ is running:
-
Verify credentials:
-
Check if management plugin shows the connection: Open http://localhost:15672 (guest/guest)
"Queue not found"¶
Error:
Cause: The queue doesn't exist and auto-creation is disabled.
Solution:
-
Create the queue manually via RabbitMQ management UI
-
Or let Mycel create it by adding
auto_create:
Performance Issues¶
"Requests are slow"¶
Diagnosis:
-
Enable metrics:
-
Check these metrics:
mycel_flow_duration_seconds- Time per flowmycel_connector_duration_seconds- Time per connector callmycel_db_pool_waiting- Database pool exhaustion
Common causes and solutions:
| Symptom | Cause | Solution |
|---|---|---|
High db_duration |
Slow queries | Add indexes, optimize queries |
High pool_waiting |
Not enough connections | Increase pool_size |
High flow_duration |
Complex transforms | Simplify CEL expressions |
| Spiky latency | No caching | Add cache layer |
Add caching:
flow "get_product" {
cache {
storage = "cache"
ttl = "5m"
key = "'product:' + input.id"
}
from { ... }
to { ... }
}
"Memory usage keeps growing"¶
Cause: Usually unbounded caches or connection leaks.
Solution:
-
Set cache limits:
-
Set connection pool limits:
Docker/Kubernetes Issues¶
"Config not found in container"¶
Error:
Solution:
Ensure volume is mounted correctly:
# Wrong - mounting file instead of directory
docker run -v ./service.mycel:/etc/mycel ...
# Correct - mount the directory
docker run -v ./my-config:/etc/mycel ...
For Kubernetes, check your ConfigMap is mounted:
volumeMounts:
- name: config
mountPath: /etc/mycel
volumes:
- name: config
configMap:
name: mycel-config
"Permission denied"¶
Error:
Cause: Container runs as non-root but files have wrong permissions.
Solution:
# Fix permissions on host
chmod -R 755 ./my-config
# Or run container as root (not recommended for production)
docker run --user root ...
Still Stuck?¶
-
Check logs with debug level:
-
Validate configuration:
-
Test connectivity:
-
Search existing issues: https://github.com/matutetandil/mycel/issues
-
Open a new issue with:
- Mycel version (
mycel version) - Your configuration (sanitized)
- Full error message
- Steps to reproduce