This guide helps you diagnose and resolve common issues when using Pocket CLI.
Problem: go install command fails with errors
Solutions:
- Check Go version:
go version
# Should be 1.21 or higher- Update Go modules:
go clean -modcache
go install github.com/agentstation/pocket/cmd/pocket@latest- Use explicit version:
go install github.com/agentstation/pocket/cmd/pocket@v1.0.0Problem: pocket: command not found after installation
Solutions:
- Check if Go bin is in PATH:
echo $PATH | grep -q "$(go env GOPATH)/bin" && echo "Go bin is in PATH" || echo "Go bin is NOT in PATH"- Add Go bin to PATH:
# Add to ~/.bashrc or ~/.zshrc
export PATH="$PATH:$(go env GOPATH)/bin"- Use full path:
$(go env GOPATH)/bin/pocket run workflow.yamlProblem: Error: workflow file not found
Solutions:
- Check file path:
ls -la workflow.yaml
pwd # Verify current directory- Use absolute path:
pocket run /full/path/to/workflow.yaml- Check file extension:
# Pocket supports .yaml, .yml, and .json
pocket run workflow.yml # Try alternative extensionProblem: Error: yaml: line X: found character that cannot start any token
Solutions:
- Validate YAML syntax:
# Use yamllint if available
yamllint workflow.yaml
# Or use Pocket's validate command
pocket validate workflow.yaml- Common YAML issues:
# Wrong - tabs not allowed
nodes:
- name: test # Tab used here
# Correct - use spaces
nodes:
- name: test # 2 spaces
# Wrong - missing space after colon
key:value
# Correct
key: value- Check for special characters:
# Wrong - unquoted special characters
config:
message: Hello: World # Colon needs quotes
# Correct
config:
message: "Hello: World"Problem: Error: unknown node type: custom-node
Solutions:
- List available nodes:
pocket nodes list- Check if plugin is loaded:
pocket plugin list- Load required plugin:
pocket plugin load ./plugins/custom-plugin.so- Use built-in node:
# Check spelling of built-in nodes
nodes:
- name: echo-message
type: echo # Not "print" or "log"Problem: Error: context deadline exceeded
Solutions:
- Increase timeout:
# Global timeout
pocket run workflow.yaml --timeout 5m
# Node-specific timeoutnodes:
- name: slow-operation
type: http
config:
url: "https://slow-api.example.com"
timeout: "30s" # Increase node timeout- Check network connectivity:
# Test endpoint manually
curl -v https://api.example.com/endpoint- Enable debug logging:
POCKET_LOG_LEVEL=debug pocket run workflow.yamlProblem: runtime: out of memory
Solutions:
- Limit store size:
# In pocket.yaml
store:
max_entries: 1000 # Reduce from default
ttl: "5m" # Add TTL for cleanup- Process data in batches:
nodes:
- name: batch-processor
type: batch
config:
size: 100 # Process 100 items at a time- Monitor memory usage:
# Run with memory profiling
pocket run workflow.yaml --profile-memProblem: Error: permission denied
Solutions:
- Check file permissions:
ls -la workflow.yaml
chmod 644 workflow.yaml # Make readable- For exec nodes:
# Make script executable
chmod +x ./scripts/process.sh- For plugin loading:
# Check plugin file permissions
ls -la ./plugins/
chmod 755 ./plugins/my-plugin.soProblem: Error: failed to load plugin: symbol not found
Solutions:
- Check plugin compatibility:
# Verify plugin was built with same Go version
go version
pocket plugin check ./plugin.so- Rebuild plugin:
cd plugin-source/
go build -buildmode=plugin -o plugin.so- Check dependencies:
# List plugin dependencies
ldd ./plugin.so # Linux
otool -L ./plugin.so # macOSProblem: Error in Lua script: attempt to index nil value
Solutions:
- Check input data:
-- Add defensive checks
function process(input)
if not input then
error("Input is nil")
end
if not input.data then
return {error = "Missing data field"}
end
-- Process safely
return {result = input.data * 2}
end- Debug Lua script:
nodes:
- name: debug-lua
type: lua
config:
debug: true # Enable debug output
script: |
print("Input:", json.encode(input))
-- Your logic hereProblem: Configuration in pocket.yaml not being applied
Solutions:
- Check config file location:
# Show where Pocket looks for config
pocket config paths
# Show loaded configuration
pocket config show- Validate config syntax:
pocket config validate- Force config file:
pocket run workflow.yaml --config ./my-config.yamlProblem: ${VARIABLE} not being replaced
Solutions:
- Check variable is set:
echo $MY_VARIABLE
env | grep MY_VARIABLE- Export variable:
export MY_VARIABLE="value"
pocket run workflow.yaml- Use env file:
# .env file
MY_VARIABLE=value
# Run with env file
pocket run workflow.yaml --env-file .env# Maximum verbosity
POCKET_LOG_LEVEL=debug pocket run workflow.yaml
# Or via flag
pocket run workflow.yaml --log-level debug
# Log to file
pocket run workflow.yaml --log-file debug.logTest without execution:
# Validate and show execution plan
pocket run workflow.yaml --dry-run
# Shows:
# - Node execution order
# - Configuration validation
# - Type checking results# Pause after each node
pocket run workflow.yaml --step
# Interactive mode
pocket run workflow.yaml --interactive# Save execution details
pocket run workflow.yaml --trace trace.json
# Analyze trace
pocket trace analyze trace.json# Show all node inputs/outputs
pocket run workflow.yaml --verbose
# Show specific node details
pocket run workflow.yaml --verbose-node process-data- Profile execution:
pocket run workflow.yaml --profile
pocket profile view profile.out- Check bottlenecks:
# Time each node
pocket run workflow.yaml --timing- Optimize parallel execution:
nodes:
- name: parallel-process
type: parallel
config:
max_concurrency: 10 # Increase concurrency- Monitor memory:
pocket run workflow.yaml --metrics- Limit store size:
config:
store:
max_entries: 1000
cleanup_interval: "1m"- Stream large data:
nodes:
- name: stream-process
type: stream
config:
chunk_size: 1024# General help
pocket help
# Command-specific help
pocket run --help
pocket plugin --help
# Show version info
pocket version --verboseCollect for bug reports:
# Generate diagnostic bundle
pocket diagnose --output diagnose.tar.gz
# Includes:
# - Version info
# - Configuration
# - System details
# - Recent logs- GitHub Issues: Report bugs
- Discussions: Ask questions
- Examples: Check
/examplesdirectory
# Validate workflow syntax
pocket validate workflow.yaml
# Check node connections
pocket graph workflow.yaml
# List all available nodes
pocket nodes list --verbose
# Test specific node
pocket test node echo --input '{"message": "test"}'
# Check system compatibility
pocket doctorWhen something goes wrong, try these in order:
- ✓ Check syntax:
pocket validate workflow.yaml - ✓ Enable debug logs:
POCKET_LOG_LEVEL=debug pocket run workflow.yaml - ✓ Verify file paths are correct
- ✓ Ensure plugins are loaded:
pocket plugin list - ✓ Check environment variables are set
- ✓ Try with increased timeout:
--timeout 5m - ✓ Run with
--dry-runto check execution plan - ✓ Simplify workflow to isolate issue
- ✓ Check examples for working patterns
- ✓ Search GitHub issues for similar problems
- Review Configuration Guide
- Learn about Plugin Management
- See Command Reference