Introduction
Troubleshooting
Common Installation Issues
Database Connection Failed
# Check if PostgreSQL is running
sudo systemctl status postgresql
# Check database exists
sudo -u postgres psql -c '\l' | grep haddock
# Reset database if needed
sudo -u postgres dropdb haddock
sudo -u postgres createdb haddock -O haddock
cd /opt/haddock/api && yarn migrate
Redis Connection Issues
# Verify Redis is running
sudo systemctl status redis-server
# Test Redis connection
redis-cli ping
# Restart Redis if needed
sudo systemctl restart redis-server
API Not Starting
# Check API logs
pm2 logs haddock-api
# Verify API process
pm2 status
# Restart API if needed
pm2 restart haddock-api
Frontend Not Loading
# Check if frontend is built
ls /opt/haddock/frontend/dist
# Rebuild frontend if needed
cd /opt/haddock/frontend
yarn build
# Check Caddy status
sudo systemctl status caddy
Vagrant Issues
# Check libvirt status
sudo systemctl status libvirtd
# Verify vagrant installation
vagrant --version
# Reinstall vagrant-libvirt plugin if needed
vagrant plugin uninstall vagrant-libvirt
vagrant plugin install vagrant-libvirt
Log Files
Important log files to check for troubleshooting:
- Installation log:
/var/log/haddock/install.log
- API logs:
pm2 logs haddock-api
- Caddy logs:
sudo journalctl -u caddy
- Redis logs:
sudo journalctl -u redis-server
- PostgreSQL logs:
sudo journalctl -u postgresql
Common Error Messages
"Failed to connect to database"
- Verify PostgreSQL is running
- Check database credentials in
/opt/haddock/api/.env
- Ensure database exists and user has proper permissions
"Redis connection refused"
- Check if Redis is running
- Verify Redis URL in
/opt/haddock/api/.env
- Ensure Redis is listening on correct port
"API health check failed"
- Check API process status with
pm2 status
- Verify environment variables in
/opt/haddock/api/.env
- Check API logs for specific errors
"Frontend build failed"
- Check Node.js version (
node --version
) - Verify yarn dependencies (
yarn install
) - Check for build errors in frontend logs
Quick Reset Commands
If you need to reset specific components:
Reset Database
sudo -u postgres dropdb haddock
sudo -u postgres createdb haddock -O haddock
cd /opt/haddock/api && yarn migrate
Reset API
pm2 delete haddock-api
cd /opt/haddock/api
yarn install
yarn build
pm2 start yarn --name haddock-api -- start:prod
Reset Frontend
cd /opt/haddock/frontend
rm -rf node_modules dist
yarn install
yarn build
Getting Help
If you're still experiencing issues:
- Check the GitHub Issues
- Submit a new issue with:
- Installation logs
- Error messages
- System information
- Steps to reproduce