Troubleshooting Guide
Troubleshooting Guide
This guide covers common issues you might encounter while working with Hazelbean documentation and development environment.
Quarto Documentation Server Issues
Server Won’t Start
Symptom: quarto preview command fails or hangs
Solutions:
Check if Quarto is installed:
quarto --versionIf not installed, follow Quarto installation guide
Port already in use:
# Check if port 4200 is occupied lsof -i :4200 # Kill the process if needed kill <PID> # Or use a different port quarto preview --port 4201Permission issues:
# Ensure you're in the correct directory cd docs-site/quarto-docs # Check file permissions ls -la _quarto.yml
Infinite Loop During Preview
Symptom: quarto preview keeps rebuilding endlessly, never stabilizing
Cause: A pre-render hook in _quarto.yml generates .qmd files, which triggers Quarto’s file watcher, which re-runs the pre-render hook, creating an infinite loop.
Solution:
Check for pre-render hooks that generate files:
grep -n "pre-render" docs-site/quarto-docs/_quarto.ymlRun report generation manually instead:
# From project root python tools/generate_all_reports.py # Then preview cd docs-site/quarto-docs quarto previewOr use the convenience script:
./tools/preview_docs.sh
Note: The pre-render hook works fine with quarto render (one-time build), but causes issues with quarto preview (live file watching).
Rendering Failures
Symptom: quarto render produces errors
Common causes and fixes:
Missing dependencies:
conda activate <your_env> conda install -c conda-forge quartoBroken links in QMD files:
- Check error messages for specific file paths
- Verify all referenced files exist
- Use relative paths consistently
Malformed markdown:
- Check fenced code blocks are properly closed
- Verify YAML front matter is valid
- Ensure callout blocks have proper syntax:
::: {.callout-note}
Environment Issues
Conda Environment Activation
Symptom: conda: command not found or environment won’t activate
Solutions:
Initialize conda:
# For bash conda init bash # For zsh conda init zsh # Restart your shellVerify environment exists:
conda env listRecreate environment if corrupted:
conda env remove -n <your_env> conda env create -f environment.yml
Import Errors
Symptom: ModuleNotFoundError: No module named 'hazelbean'
Solutions:
Ensure environment is activated:
conda activate <your_env> python -c "import sys; print(sys.prefix)"Reinstall hazelbean:
cd /path/to/hazelbean_dev pip install -e . --no-depsCheck Python path:
python -c "import sys; print('\n'.join(sys.path))"
Cython Compilation Issues (Windows)
Missing Compiler
Symptom:
error: Microsoft Visual C++ 14.0 or greater is required
Solutions:
Install conda compiler (recommended):
conda activate <your_env> conda install -c conda-forge m2w64-toolchain libpython pip install -e . --no-deps --force-reinstallInstall Visual Studio Build Tools:
- Download from https://visualstudio.microsoft.com/downloads/
- Select “Build Tools for Visual Studio 2022”
- Check “Desktop development with C++”
- After install:
pip install -e . --no-deps --force-reinstall
Import Error After Installation
Symptom:
ImportError: cannot import name 'cython_functions' from 'hazelbean.calculation_core'
Solution:
python scripts/verify_installation.pyThis script will diagnose the issue and provide specific solutions.
Testing and Coverage Issues
Coverage Report Shows 0%
Symptom: Coverage reports show 0.0% coverage or no data
Solution:
Run tests with coverage:
cd hazelbean_tests conda activate <your_env> pytest --cov=hazelbean --cov-report=json --cov-report=termRegenerate coverage report:
cd tools python generate_coverage_report.pyVerify coverage.json was created:
ls -lh hazelbean_tests/.coverage* ls -lh hazelbean_tests/coverage.json
Tests Failing
Common issues:
- Missing test data:
- Check
data/directories exist - Verify test fixtures are properly set up
- Some tests auto-generate synthetic data if real data is missing
- Check
- Environment issues:
- Always activate
<your_env>before running tests - Verify all dependencies are installed:
conda list
- Always activate
- Path issues:
- Run tests from
hazelbean_tests/directory - Use relative paths in test configurations
- Run tests from
Report Generation Issues
Reports Not Updating
Symptom: Documentation shows old or stale data
Solution:
Regenerate all reports:
cd tools ./generate_reports.shRegenerate specific reports:
python generate_test_results_report.py ../hazelbean_tests/test-results.json python generate_coverage_report.py python generate_baseline_report.py python generate_benchmark_summary.pyRe-render Quarto site:
cd docs-site/quarto-docs quarto render
Missing Test Results
Symptom: test-results.json not found
Solution:
cd hazelbean_tests
conda activate <your_env>
pytest --json-report --json-report-file=test-results.json --quietPort Conflicts
Multiple Servers Running
Symptom: “Address already in use” error
Common ports: - 4200 - Quarto preview - 8000 - MkDocs serve
Solution:
# Check what's using the port
lsof -i :4200
lsof -i :8000
# Kill the process
kill <PID>
# Or use a different port
quarto preview --port 4201
mkdocs serve --dev-addr 127.0.0.1:8001Documentation Not Found Issues
404 Errors on Documentation Pages
Symptom: Links to documentation pages return 404
Solutions:
Ensure site is rendered:
cd docs-site/quarto-docs quarto render ls -la _site/ # Should contain HTML filesCheck link paths:
- Use relative paths (e.g.,
../reports/test-results.html) - Don’t include
.qmdextension in links - Quarto converts
page.qmdtopage.html
- Use relative paths (e.g.,
Verify navigation configuration:
- Check
_quarto.ymlfor proper page structure - Ensure all referenced files exist
- Check
Search Functionality Issues
Search Not Working
Symptom: Search bar doesn’t return results
Solution:
Rebuild search index:
cd docs-site/quarto-docs quarto renderCheck browser console:
- Open browser dev tools (F12)
- Look for JavaScript errors
- Check if
search.jsonwas generated in_site/
Getting Additional Help
If you’re still experiencing issues:
Check logs:
- Review terminal output for error messages
- Check browser console for JavaScript errors
- Look for
.logfiles in the project
Verify installation:
python scripts/verify_installation.pyGitHub Issues:
- Search existing issues: https://github.com/jandrewjohnson/hazelbean_dev/issues
- Create a new issue with:
- OS and Python version
- Complete error message
- Steps to reproduce
- Output of
conda list
Documentation:
Quick Diagnosis Commands
Run these to quickly diagnose your setup:
# Environment check
conda activate <your_env>
python -c "import hazelbean as hb; print('Hazelbean imported successfully')"
# Quarto check
quarto --version
# Location check
pwd # Should be in hazelbean_dev directory
# Dependencies check
conda list | grep -E "hazelbean|quarto|mkdocs|pytest"
# File check
ls -la environment.yml
ls -la docs-site/quarto-docs/_quarto.ymlLast Updated: 2026-02-01 For the most current troubleshooting information, visit the GitHub repository.