Troubleshooting
This guide covers common issues and their solutions for LoKO v0.3.0. Start with the diagnostic workflow, then find your issue in the sections below.
Diagnostic Workflow
Section titled “Diagnostic Workflow”When encountering issues, follow this diagnostic sequence:
1. Check Component Health
Section titled “1. Check Component Health”The loko status command is your primary diagnostic tool:
# Check overall environment healthloko status
# Compact table viewloko status --short
# Include workload detailsloko status --workloads
# JSON format for scriptingloko status --format jsonHealth States:
- healthy (✓ green) - Component running normally
- degraded (⚠ yellow) - Running but has issues
- stopped (✗ red) - Component not running
- not_configured (○ dim) - Component not set up
Component Order:
- Cluster - Kubernetes cluster state
- Registry - Local OCI registry (if enabled)
- DNS - DNS service and OS resolver
- Tunnel - HAProxy for database connections
- Workloads - Deployed services
2. Interpret Status Output
Section titled “2. Interpret Status Output”Based on health states, take action:
- All healthy → Environment ready
- Cluster stopped → Run
loko env start - DNS degraded → Check port conflicts (see Issue #1 below)
- Workloads not_configured → Deploy with
loko workloads deploy <name> - Registry stopped → Check if enabled in config, restart if needed
3. Use Targeted Diagnostics
Section titled “3. Use Targeted Diagnostics”# DNS-specific checkloko check dns
# View component logsloko logs dns|loko logs tunnel|loko logs workload <workload-name>
# Kubernetes eventskubectl get events -A --sort-by='.lastTimestamp'
# Docker container statusdocker ps -aTop 10 Common Issues
Section titled “Top 10 Common Issues”Issue 1: DNS Not Resolving
Section titled “Issue 1: DNS Not Resolving”Symptom: Domains like postgres.dev.me don’t resolve after environment creation
Root Cause: dnsmasq may not be running, or the host resolver is not configured correctly
Solution:
# Check DNS container statusloko dns status
# Check DNS container logsloko logs dns
# Run DNS diagnostic checksloko config dns-check
# Recreate DNS configurationloko dns recreateVerification:
loko status# DNS should show "healthy"Related: DNS Issues
Issue 2: Missing Prerequisites
Section titled “Issue 2: Missing Prerequisites”Symptom: Command not found errors, installation failures
Error Message:
Docker not found - install Docker Desktop or Docker Enginekind not found - install Kind (Kubernetes in Docker)cfssl not found - install cfssl for TLS certificate generationgit not found - install git for GitOps repository operationsRoot Cause: Required tools not installed on system (v0.3.0 checks prerequisites on first run)
Solution:
macOS:
# Install via Homebrewbrew install docker kind cfssl git helmfile
# Install Docker Desktop separatelybrew install --cask dockerLinux:
# Dockercurl -fsSL https://get.docker.com | sh
# Kindcurl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64chmod +x ./kindsudo mv ./kind /usr/local/bin/kind
# cfsslbrew install cfssl # or install from distro packages/releases
# gitbrew install git
# helmfilebrew install helmfileVerification:
docker --versionkind --versioncfssl versiongit --versionhelmfile --versionRelated: Prerequisites
Issue 3: Docker Not Running
Section titled “Issue 3: Docker Not Running”Symptom: Cannot connect to Docker daemon
Error Message:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?Root Cause: Docker Desktop not started or Docker daemon not running
Solution:
macOS:
# Start Docker Desktopopen -a Docker
# Wait for Docker to startdocker psLinux:
# Start Docker servicesudo systemctl start docker
# Enable on bootsudo systemctl enable docker
# Add user to docker groupsudo usermod -aG docker $USERnewgrp dockerVerification:
docker ps# Should show running containers or empty listIssue 4: Config File Not Found
Section titled “Issue 4: Config File Not Found”Symptom: LoKO commands fail with config error
Error Message:
Configuration file 'loko.yaml' not foundRoot Cause: No explicit --config was provided, there is no active environment in inventory, and LoKO could not fall back to a local loko.yaml.
Solution:
# Create configuration from templateloko config generate
# Or create and activate an environmentloko env create
# See known environments and the active oneloko inventory list
# Activate an existing environmentloko activate my-env
# Or use an explicit config fileloko status --config /path/to/loko.yamlVerification:
loko statusRelated: Configuration Guide
Issue 5: Cluster Creation Fails
Section titled “Issue 5: Cluster Creation Fails”Symptom: loko env create fails during cluster creation
Error Message:
Failed to create cluster: port conflicts detectedERROR: failed to create cluster: node(s) already existRoot Cause: Port conflicts, insufficient resources, or stale cluster state
Solution:
Port Conflicts:
# Check for port usage (API server usually 6443)sudo lsof -i :6443
# Stop conflicting service or use different portloko init --api-port 6444Stale Cluster:
# Delete existing clusterkind delete cluster --name <cluster-name>
# Clean up Docker networksdocker network prune
# Recreate environmentloko env createInsufficient Resources:
# Check Docker resourcesdocker system dfdocker stats --no-stream
# Increase Docker Desktop memory# Docker Desktop → Settings → Resources → Memory (8GB minimum)
# Or reduce worker nodes in loko.yamlcluster: nodes: workers: 1Verification:
loko statuskind get clustersRelated: Environment Lifecycle
Issue 6: Workload Deployment Fails
Section titled “Issue 6: Workload Deployment Fails”Symptom: Helm release fails, pods not starting
Error Message:
Error: failed to install chartImagePullBackOffCrashLoopBackOffRoot Cause: Image pull errors, resource constraints, configuration issues
Solution:
Image Pull Errors:
# Check pod statuskubectl get pods -A
# Describe failed podkubectl describe pod <pod-name> -n <namespace>
# Check registry statusloko status
# Verify image existsdocker pull <image-name>
# Retry deploymentloko workloads undeploy <name>loko workloads deploy <name>Resource Constraints:
# Check node resourceskubectl describe nodes
# Reduce resource requests in workload config# Edit loko.yaml:workloads: system: - name: postgres config: values: resources: requests: memory: 256Mi cpu: 100mCheck Logs:
# Workload logsloko logs workload <workload-name>
# Kubernetes eventskubectl get events -n <namespace> --sort-by='.lastTimestamp'Verification:
loko status --workloadskubectl get pods -AIssue 7: DNS Not Resolving .test Domains
Section titled “Issue 7: DNS Not Resolving .test Domains”Symptom: Cannot access services via domain names (e.g., postgres.dev.me)
Error Message:
nslookup: can't resolve 'postgres.dev.me'Root Cause: DNS service not running, resolver not configured, or Linux resolver backend not configured correctly
Solution:
macOS:
# Check DNS statusloko check dns
# Verify resolver filecat /etc/resolver/dev.me
# Recreate DNS serviceloko dns recreate
# Test resolutiondig postgres.dev.menslookup postgres.dev.meLinux (systemd-resolved backend):
# Check port 53 usagesudo lsof -i :53
# If systemd-resolved is blocking:sudo systemctl stop systemd-resolved
# Or configure systemd-resolved to use different port# Edit /etc/systemd/resolved.conf:[Resolve]DNSStubListener=no
# Restartsudo systemctl restart systemd-resolved
# Restart LoKO DNSloko dns recreateLinux (NetworkManager backend):
# Check that NetworkManager is activenmcli general status
# LoKO should have configured NetworkManager dnsmasqls /etc/NetworkManager/conf.d/90-loko-dns.confls /etc/NetworkManager/dnsmasq.d/
# Reload resolver statesudo systemctl restart NetworkManager
# Recreate LoKO DNS config if neededloko dns recreateCheck DNS Components:
# Check DNS containerloko dns statusVerification:
loko status# DNS should show "healthy"
dig postgres.dev.me# Should return configured IPRelated: DNS and Networking
Issue 8: Certificate Errors (Browser “Not Secure”)
Section titled “Issue 8: Certificate Errors (Browser “Not Secure”)”Symptom: Browser shows certificate warnings for HTTPS endpoints
Error Message:
NET::ERR_CERT_AUTHORITY_INVALIDYour connection is not privateRoot Cause: LoKO CA not trusted in system trust store
Solution:
Install/Reinstall CA:
# Reinstall global CA trust (macOS Keychain, Linux trust store, NSS, Docker)loko certs ca install
# View global CA infoloko certs ca statusmacOS Keychain:
# Open Keychain Accessopen -a "Keychain Access"
# Search for "LoKO"# Double-click certificate# Expand "Trust" section# Set "When using this certificate" to "Always Trust"Firefox (requires NSS tools):
# macOSbrew install nss
# Debian/Ubuntusudo apt install libnss3-tools
# openSUSEsudo zypper install mozilla-nss-tools
# Re-run LoKO trust setuploko certs ca installRegenerate Certificates (if expired):
# Check expirationloko certs show
# Or directlyopenssl x509 -in ~/.loko/environments/<env>/certs/<domain>.pem -noout -dates
# Renew wildcard cert (keeps existing CA)loko certs renew
# Restart workloadskubectl rollout restart deployment -AVerification:
# Open service in browseropen https://postgres.dev.me# Should show valid certificateIssue 9: Health Status Shows Degraded Components
Section titled “Issue 9: Health Status Shows Degraded Components”Symptom: loko status shows components in degraded state
Error Message:
⚠ DNS degraded - port conflict detected⚠ Workloads degraded - 2/5 pods not readyRoot Cause: Component-specific issues requiring targeted fixes
Solution:
Degraded Cluster:
# Check node statuskubectl get nodes
# Check system podskubectl get pods -n kube-system
# Restart clusterloko env stoploko env startDegraded DNS:
# Check port conflicts (see Issue #1)sudo lsof -i :53
# Recreate DNSloko dns recreateDegraded Workloads:
# Check pod statuskubectl get pods -A
# View detailed statusloko status --workloads
# Check specific workload logsloko logs workload <workload-name>
# Redeploy workloadloko workloads undeploy <name>loko workloads deploy <name>Degraded Registry:
# Check registry podkubectl get pods -n kube-system -l app=zot
# Check registry logsloko logs zot
# Restart registrykubectl rollout restart deployment -n kube-system zotVerification:
loko status# All components should show "healthy"Issue 10: Old CLI Commands Not Working
Section titled “Issue 10: Old CLI Commands Not Working”Symptom: Commands fail after upgrading to v0.3.0
Error Message:
Error: unknown command "create" for "loko"Root Cause: v0.3.0 restructured CLI commands (migration from flat structure to grouped commands)
Solution:
Command Migration:
| Old Command | New Command (v0.3.0) |
|---|---|
loko create | loko env create |
loko start | loko env start |
loko stop | loko env stop |
loko destroy | loko env destroy |
loko deploy <name> | loko workloads deploy <name> |
loko logs workload <name> | loko logs workload <name> (unchanged) |
loko list | loko workloads list |
Check CLI Structure:
# View all commandsloko --help
# View subcommand helploko env --helploko workloads --helploko dns --helpUpdate Aliases:
# Add to ~/.bashrc or ~/.zshrcalias loko-create='loko env create'alias loko-start='loko env start'alias loko-stop='loko env stop'Verification:
loko --version# Should show v0.3.0 or higherRelated: CLI Reference
Platform-Specific Issues
Section titled “Platform-Specific Issues”Firefox Certificate Issues
Section titled “Firefox Certificate Issues”Problem: Firefox doesn’t trust the LoKO CA
Solution:
# Install NSS tools (Firefox certificate database)brew install nss
# Re-run LoKO trust setuploko init
# Restart FirefoxDocker Desktop Not Starting
Section titled “Docker Desktop Not Starting”Problem: Docker Desktop stuck on “Starting”
Solution:
# Reset Docker Desktop# Docker Desktop → Troubleshoot → Reset to factory defaults
# Or clean restartpkill -f Dockerrm -rf ~/Library/Containers/com.docker.dockeropen -a Dockersystemd-resolved Port Conflicts
Section titled “systemd-resolved Port Conflicts”Problem: systemd-resolved always uses port 53
Solution:
# Disable DNS stub listenersudo mkdir -p /etc/systemd/resolved.conf.dcat <<EOF | sudo tee /etc/systemd/resolved.conf.d/loko.conf[Resolve]DNSStubListener=noEOF
# Restart systemd-resolvedsudo systemctl restart systemd-resolved
# Verify port 53 is freesudo lsof -i :53
# Start LoKO DNSloko dns recreateNetworkManager Resolver Backend
Section titled “NetworkManager Resolver Backend”Problem: Linux host does not use systemd-resolved, so LoKO must configure NetworkManager instead
Solution:
# Confirm NetworkManager is the active backendsystemctl is-active NetworkManagersystemctl is-active systemd-resolved
# Recreate LoKO DNS configurationloko dns recreate
# Inspect generated configls /etc/NetworkManager/conf.d/90-loko-dns.confls /etc/NetworkManager/dnsmasq.d/
# Restart NetworkManager if requiredsudo systemctl restart NetworkManagerThis is expected on some distributions, including openSUSE setups that use NetworkManager without systemd-resolved.
SELinux Denials
Section titled “SELinux Denials”Problem: SELinux blocking Docker operations
Solution:
# Check SELinux statusgetenforce
# View denialssudo ausearch -m avc -ts recent
# Temporarily permissive (testing only)sudo setenforce 0
# Permanent fix: add SELinux policy# Or disable SELinux (not recommended)kind Known Issues on Linux Distros
Section titled “kind Known Issues on Linux Distros”Some cluster creation failures come from upstream Kind and Docker interactions rather than LoKO itself.
- openSUSE/AppArmor: see the Kind AppArmor known issue
- Fedora/firewalld: see the Kind Fedora firewalld known issue
- Fedora/SELinux: see the Kind Fedora SELinux known issue
- General Kind troubleshooting: kind known issues
Windows
Section titled “Windows”LoKO v0.3.0 does not support Windows.
Windows Subsystem for Linux (WSL2) support is planned for future releases. For now, use Linux or macOS.
Advanced Troubleshooting
Section titled “Advanced Troubleshooting”Enable Debug Logging
Section titled “Enable Debug Logging”Get detailed diagnostic output:
# Set debug levelexport LOKO_LOG_LEVEL=DEBUG
# Run commandloko env create
# Or inlineLOKO_LOG_LEVEL=DEBUG loko env createInspect Kind Cluster Directly
Section titled “Inspect Kind Cluster Directly”Access cluster internals with kubectl:
# Get cluster contextkubectl config current-context
# View all resourceskubectl get all -A
# Describe nodeskubectl describe nodes
# View cluster infokubectl cluster-info
# Access control plane containerdocker exec -it <cluster-name>-control-plane bashRegistry Troubleshooting
Section titled “Registry Troubleshooting”Diagnose local registry issues:
# Check registry accessibilitycurl -k https://cr.dev.me/v2/
# List repositoriesloko registry list-repos
# Check registry podkubectl get pods -n kube-system -l app=zot
# View registry logskubectl logs -n kube-system -l app=zot
# Test image pushdocker tag hello-world:latest cr.dev.me/test:latestdocker push cr.dev.me/test:latestNetwork Diagnostics
Section titled “Network Diagnostics”Check DNS and connectivity:
# Check DNS resolutionloko check dns
# Test specific domaindig postgres.dev.menslookup postgres.dev.me
# Check DNS containerdocker ps | grep dnsdocker logs loko-<env-name>-dns
# Verify resolver configuration# macOS:cat /etc/resolver/dev.me
# Linux:cat /etc/systemd/resolved.conf.d/dev.me.conf
# Test connectivity to clusterkubectl cluster-infokubectl get nodesCollect Full Diagnostics
Section titled “Collect Full Diagnostics”Gather comprehensive diagnostic data:
# Environment statusloko status --format json > status.json
# Cluster infokubectl cluster-info > cluster-info.txtkubectl describe nodes > nodes.txt
# All resourceskubectl get all -A > resources.txt
# Eventskubectl get events -A --sort-by='.lastTimestamp' > events.txt
# Docker statusdocker ps > docker-ps.txtdocker system df > docker-df.txtdocker info > docker-info.txt
# LoKO versionloko --version > version.txt
# Package manifesttar czf loko-diagnostics.tar.gz *.txt *.jsonGetting Help
Section titled “Getting Help”Check Documentation
Section titled “Check Documentation”- FAQ - Frequently asked questions
- CLI Reference - Command reference
- Configuration Guide - Config options
Report Issues
Section titled “Report Issues”If you can’t resolve the issue:
- Gather diagnostics (see above)
- Check existing issues: GitHub Issues
- Open new issue: New Issue
Include in report:
- LoKO version (
loko --version) - OS and version (
uname -a) - Docker version (
docker --version) - Error messages (exact text)
- Steps to reproduce
- Diagnostic output
Community
Section titled “Community”- GitHub Discussions: Ask questions, share tips
- GitHub Issues: Report bugs, request features
Next Steps
Section titled “Next Steps”- Environment Lifecycle - Managing environments
- CLI Reference - Full command reference
- Configuration Guide - Customize your setup