Troubleshooting
Common issues and solutions when using Gozzi CLI.
Configuration Issues
Config File Not Found
Error:
Error: config file not found: config.tomlSolutions:
Check file exists:
shls -la config.tomlSpecify correct path:
shgozzi build --config path/to/config.tomlUse absolute path:
shgozzi build --config /full/path/to/config.toml
Invalid TOML Syntax
Error:
Error: failed to parse config: invalid TOML syntax at line 5Solutions:
Validate TOML online:
- Use https://www.toml-lint.com/
- Paste your config and check for errors
Common TOML mistakes:
toml# ❌ Wrong: Missing quotes title = My Site # ✅ Correct: Quotes required title = "My Site" # ❌ Wrong: Invalid key my key = "value" # ✅ Correct: No spaces in keys my_key = "value" # ❌ Wrong: Mixed quotes title = "My Site' # ✅ Correct: Matching quotes title = "My Site"Check for special characters:
toml# Escape backslashes path = "C:\\Users\\name" # Windows paths
Missing Required Config Fields
Error:
Error: required field 'base_url' not found in configSolution:
Add required fields to your config:
# Minimum required config
base_url = "https://example.com"
title = "My Site"Content Issues
Content Directory Not Found
Error:
Error: content directory not found: contentSolutions:
Create content directory:
shmkdir -p contentSpecify correct directory:
shgozzi build --content postsCheck current directory:
shpwd # Make sure you're in project root
No Content Files Found
Error:
Warning: no content files found in content directorySolutions:
Add Markdown files:
shecho "# Hello World" > content/index.mdCheck file extensions:
shls content/ # Files must be .md or .markdownCheck subdirectories:
sh# Content can be in subdirectories mkdir -p content/blog echo "# My Post" > content/blog/first-post.md
Invalid Front Matter
Error:
Error: failed to parse front matter in content/blog/post.mdSolutions:
Check YAML syntax:
yaml--- title: "My Post" # ✅ Correct date: 2024-01-15 # ✅ Correct tags: [go, web] # ✅ Correct ---Common mistakes:
yaml--- title: My Post # ❌ Missing quotes (if contains special chars) date: 2024/01/15 # ❌ Wrong date format (use YYYY-MM-DD) tags: go, web # ❌ Wrong array format ---Validate front matter:
sh# Use online YAML validator # https://www.yamllint.com/
Template Issues
Template Not Found
Error:
Error: template not found: post.htmlSolutions:
Check template exists:
shls templates/post.htmlCheck template directory:
sh# Default: templates/ # Verify in config: grep templates_dir config.tomlCreate missing template:
shmkdir -p templates echo '<!DOCTYPE html><html>{{ .Content }}</html>' > templates/post.html
Template Syntax Error
Error:
Error: template parse error: unexpected "}" in commandSolutions:
Check template syntax:
html<!-- ❌ Wrong --> {{ .Title } <!-- ✅ Correct --> {{ .Title }}Check nested blocks:
html<!-- ❌ Wrong: Missing end --> {{ range .Pages }} {{ .Title }} <!-- ✅ Correct: Proper closing --> {{ range .Pages }} {{ .Title }} {{ end }}Validate template:
sh# Test build to see detailed error gozzi build
Server Issues
Port Already in Use
Error:
Error: listen tcp :1313: bind: address already in useSolutions:
Use different port:
shgozzi serve --port 8080Find process using port:
sh# macOS/Linux lsof -ti :1313 # Windows netstat -ano | findstr :1313Kill existing process:
sh# macOS/Linux lsof -ti :1313 | xargs kill -9 # Windows taskkill /PID <PID> /F
Permission Denied
Error:
Error: listen tcp :80: bind: permission deniedSolution:
Use port >= 1024 (non-privileged):
# ❌ Wrong: Port 80 requires root
gozzi serve --port 80
# ✅ Correct: Use port >= 1024
gozzi serve --port 8080Live Reload Not Working
Symptoms:
- Server running but browser doesn't reload
- Changes not reflected in browser
Solutions:
Check browser console:
- Open DevTools (F12)
- Look for errors in Console tab
- Check Network tab for
/livereloadconnection
Verify script injection:
- View page source
- Look for:
new EventSource('/livereload') - Should be injected before
</body>
Clear browser cache:
sh# Hard refresh # Chrome/Firefox: Ctrl+Shift+R (Cmd+Shift+R on Mac) # Safari: Cmd+Option+RCheck file watching:
sh# Server should show "Watching for changes..." # If not, restart server
Build Issues
Build Fails Silently
Symptoms:
- Build completes but files not generated
- Output directory empty or missing files
Solutions:
Check output directory:
sh# Verify output_dir in config grep output_dir config.toml # Check if directory created ls -la public/Use clean build:
shgozzi build --cleanCheck permissions:
sh# Ensure write permissions ls -ld public/ chmod 755 public/
Slow Build Times
Symptoms:
- Builds taking longer than expected
- Development server slow to rebuild
Solutions:
Profile content:
sh# Check content size find content -name "*.md" | wc -l # Check file sizes du -sh content/Optimize templates:
- Remove complex loops
- Cache computed values
- Use partials efficiently
Organize content:
# ✅ Good: Organized structure content/ ├── blog/ │ ├── 2024/ │ └── 2023/ └── docs/ # ❌ Bad: Flat structure content/ ├── post1.md ├── post2.md └── ... (1000 files)
Out of Memory
Error:
fatal error: out of memorySolutions:
Check content size:
sh# Find large files find content -size +10MOptimize images:
- Move large images to static directory
- Don't include in content markdown
- Use external image references
Increase available memory:
sh# If running in container docker run -m 2g ...
File System Issues
File Watch Errors
Error:
Error: too many open filesSolutions:
Increase file limit (macOS/Linux):
shulimit -n 10000Make permanent (macOS):
sh# Add to ~/.zshrc or ~/.bashrc ulimit -n 10000Exclude directories:
- Remove
node_modules/from project - Exclude
.git/directory - Keep project structure clean
- Remove
Permission Errors
Error:
Error: permission denied: public/index.htmlSolutions:
Check file permissions:
shls -la public/Fix permissions:
sh# Make directory writable chmod -R 755 public/Check ownership:
sh# Change owner if needed chown -R $USER:$USER public/
Common Workflow Issues
Changes Not Reflected
Symptoms:
- Edit content but changes don't show
- Template changes not applied
Solutions:
Hard refresh browser:
Ctrl+Shift+R (Cmd+Shift+R on Mac)Clean build:
shgozzi build --cleanRestart server:
sh# Stop server (Ctrl+C) # Start again gozzi serveCheck file paths:
sh# Ensure editing correct files pwd ls content/
Stale Content in Output
Symptoms:
- Deleted content still in output
- Old files not removed
Solution:
Use clean build:
gozzi build --cleanThis removes ALL files before rebuilding.
Getting Help
If you're still having issues:
Check logs:
- Look for error messages in terminal
- Enable verbose logging if available
Minimal reproduction:
sh# Create minimal test case mkdir test-gozzi cd test-gozzi echo 'base_url = "http://localhost"' > config.toml mkdir content templates echo '# Test' > content/index.md echo '{{ .Content }}' > templates/home.html gozzi buildCheck GitHub issues:
- Gozzi Issues
- Search for similar problems
Create issue:
- Provide error message
- Include config and content structure
- Describe steps to reproduce
Related Resources
- Build Command - Build command details
- Serve Command - Server command details
- Usage Patterns - Best practices
- Configuration Guide - Config troubleshooting