Troubleshooting - When Things Go Wrong
🔧 Troubleshooting
Section titled “🔧 Troubleshooting”Don’t panic! Every developer runs into problems. Here are the most common issues you might face while building GameVault (or any Framefox project) and how to fix them.
🚨 Server Won’t Start
Section titled “🚨 Server Won’t Start”Problem: framefox run
shows errors
Section titled “Problem: framefox run shows errors”Most common causes:
- Virtual environment not activated
- Dependencies not installed
- Port already in use
Solutions:
# 1. Make sure your virtual environment is activesource venv/bin/activate # Linux/Mac# orvenv\Scripts\activate # Windows
# 2. Install/update dependencies (see [installation guide](/framefox/installation))pip install -r requirements.txt
# 3. Try a different portframefox run --port=8001
# 4. Clear cache and try againframefox cache clearframefox run
💾 Database Issues
Section titled “💾 Database Issues”Problem: “Table doesn’t exist” errors
Section titled “Problem: “Table doesn’t exist” errors”Solution: You probably forgot to run migrations!
framefox database create-migrationframefox database upgrade
Problem: Migration fails
Section titled “Problem: Migration fails”Solution: Check what changed, rollback if needed
# See migration statusframefox database status
# Rollback if neededframefox database downgrade
# Fix your [entity](/framefox/core/database), then create new migrationframefox database create-migrationframefox database upgrade
Problem: “Database locked” (SQLite)
Section titled “Problem: “Database locked” (SQLite)”Solution: Stop the server, then restart
# Stop framefox run (Ctrl+C)# Then restartframefox run
🔐 Authentication Problems
Section titled “🔐 Authentication Problems”Problem: Can’t login/signup
Section titled “Problem: Can’t login/signup”Check these:
- Did you run
framefox create user
? - Did you create and apply migrations after creating user?
- Are you visiting the right URLs (
/login
,/register
)?
Solution:
# Create [user system](/framefox/core/security) if you haven'tframefox create user
# Apply database changesframefox database create-migrationframefox database upgrade
# Check routes existframefox debug router
Problem: Login redirects to weird page
Section titled “Problem: Login redirects to weird page”Solution: Check your routes and home controller
framefox debug router# Make sure you have a home route or /dashboard route
📄 Page Not Found (404)
Section titled “📄 Page Not Found (404)”Problem: “Page not found” when visiting your pages
Section titled “Problem: “Page not found” when visiting your pages”Solutions:
# 1. Check what routes actually existframefox debug router
# 2. Make sure [controller](/framefox/core/controllers) was created properlyls src/controller/
# 3. Clear cacheframefox cache clear
# 4. Restart serverframefox run
Problem: Templates not found
Section titled “Problem: Templates not found”Check:
- Template files are in the right folder (
templates/controllername/
) - File names match what the controller expects
- No typos in file names
📝 Form Issues
Section titled “📝 Form Issues”Problem: Form doesn’t save data
Section titled “Problem: Form doesn’t save data”Common causes:
- Form method is GET instead of POST
- CSRF token missing
- Validation errors not displayed
Solutions:
<!-- Make sure form uses POST --><form method="POST"> <!-- Add CSRF token (see [templates guide](/framefox/core/templates)) --> {{ csrf_token() }}
<!-- Your form fields --></form>
Problem: Validation errors not showing
Section titled “Problem: Validation errors not showing”Check your template has:
{% if form.errors %} <div class="alert alert-danger"> {% for field, errors in form.errors.items() %} {% for error in errors %} <p>{{ error }}</p> {% endfor %} {% endfor %} </div>{% endif %}
🎨 Styling Problems
Section titled “🎨 Styling Problems”Problem: Bootstrap styles not working
Section titled “Problem: Bootstrap styles not working”Check:
- Bootstrap CSS is properly linked in your template
- You’re using correct Bootstrap class names
- No custom CSS overriding Bootstrap
Problem: Changes not showing
Section titled “Problem: Changes not showing”Try:
- Hard refresh your browser (Ctrl+F5)
- Clear browser cache
- Check browser developer tools for errors
🔍 General Debugging Tips
Section titled “🔍 General Debugging Tips”Use the browser developer tools
Section titled “Use the browser developer tools”- Open developer tools (F12)
- Check Console tab for JavaScript errors
- Check Network tab for failed requests
- Check Elements tab to inspect HTML
Read the terminal output
Section titled “Read the terminal output”- Keep an eye on the terminal where
framefox run
is running - Error messages usually tell you exactly what’s wrong
- Don’t ignore warnings!
Check file paths and names
Section titled “Check file paths and names”- Python is case-sensitive:
Game
≠game
- Check spelling in file names and imports
- Make sure files are in the right folders
🆘 When You’re Really Stuck
Section titled “🆘 When You’re Really Stuck”Step 1: Simplify
Section titled “Step 1: Simplify”- Remove recent changes and test again
- Start with a minimal example
- Add complexity back gradually
Step 2: Check the basics
Section titled “Step 2: Check the basics”# Is everything installed?pip list
# Is the database working?framefox database status
# Are routes registered?framefox debug router
# Clear all cacheframefox cache clear
Step 3: Start fresh
Section titled “Step 3: Start fresh”Sometimes it’s easier to start over with a new project and copy working code:
framefox init test-projectcd test-project# Copy your working files over
Step 4: Ask for help
Section titled “Step 4: Ask for help”- Check Framefox documentation
- Search for the error message online
- Ask on Python/web development forums
- Check GitHub issues for Framefox
💡 Prevention Tips
Section titled “💡 Prevention Tips”Save working versions
Section titled “Save working versions”# Use git to save working versionsgit add .git commit -m "Working game list feature"
Test small changes
Section titled “Test small changes”- Don’t change 10 things at once
- Test each small change before moving on
- If something breaks, you know what caused it
Keep backups
Section titled “Keep backups”- Backup your database file (for SQLite projects)
- Keep notes of what you changed
- Save working configurations
🎯 Common Error Messages
Section titled “🎯 Common Error Messages””ModuleNotFoundError”
Section titled “”ModuleNotFoundError””Meaning: Python can’t find a file/module Fix: Check file paths, imports, and virtual environment
”NameError”
Section titled “”NameError””Meaning: Using a variable that doesn’t exist Fix: Check spelling, make sure variables are defined
”AttributeError”
Section titled “”AttributeError””Meaning: Trying to use something that doesn’t exist on an object Fix: Check object has the property/method you’re using
”TemplateNotFound”
Section titled “”TemplateNotFound””Meaning: Jinja2 can’t find your template file Fix: Check template file path and name
Remember! 🌟
Section titled “Remember! 🌟”- Every developer faces these problems
- Errors are learning opportunities
- Google is your friend
- Take breaks when frustrated
- Start simple, add complexity gradually
You’ve got this! Debugging is a skill that improves with practice. Soon you’ll be fixing problems like a pro! 🚀