Skip to main content

Connection Issues

ICE Server Connection Failed

The most common issue is when the Flask web server cannot connect to the ICE server.
The web server depends on the ICE server running on port 10000. Always start the ICE server first.
1

Verify ICE server is running

Check if server.py is running:
lsof -i :10000
Expected output:
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
python3 12345 user    4u  IPv4 0x1234      0t0  TCP *:10000 (LISTEN)
If nothing is returned, the ICE server is not running.
2

Start the ICE server

In a dedicated terminal:
cd backend
python3 server.py
You should see:
Servidor ICE iniciado en puerto 10000
Presiona Ctrl+C para detener
3

Check for port conflicts

If port 10000 is already in use by another process, you’ll need to either:
  • Stop the conflicting process
  • Modify the port in both server.py and web_server.py

Web Server Port Conflict (5000)

Flask’s default port 5000 may be occupied by other services.
lsof -i :5000
To kill the process:
kill -9 <PID>
You can run Flask on a different port using environment variables:
HOST=0.0.0.0 PORT=8080 DEBUG=true python backend/web_server.py
Then access the app at: http://localhost:8080

Dependency Issues

zeroc-ice Installation Failure

The zeroc-ice package can be tricky to install depending on your Python version and system.
Recommended Python versions: 3.10 or 3.11Python 3.12+ may have compatibility issues with zeroc-ice 3.7.x.
1

Upgrade pip

Always ensure pip is up-to-date before installing:
python -m pip install --upgrade pip
2

Use Python 3.10 or 3.11

Check your Python version:
python3 --version
If you’re using an incompatible version, install Python 3.10 or 3.11 and create a new virtual environment with it:
# Install Python 3.11 via Homebrew
brew install [email protected]

# Create venv with specific version
python3.11 -m venv .venv
source .venv/bin/activate
3

Reinstall in clean environment

If issues persist, create a fresh virtual environment:
# Remove old environment
rm -rf .venv

# Create new one
python3 -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\Activate.ps1 on Windows

# Install dependencies
python -m pip install --upgrade pip
pip install -r requirements.txt

Flask Installation Issues

The project requires Flask 3.0+:
pip install "Flask>=3.0,<4.0"
If you encounter issues, verify your installation:
pip list | grep Flask

Frontend Issues

Changes Not Appearing in Browser

Browser caching can prevent you from seeing frontend updates.
Force the browser to fetch fresh assets:
Press Ctrl+F5 or Ctrl+Shift+R
If hard reload doesn’t work:
  1. Open browser DevTools (F12)
  2. Right-click the refresh button
  3. Select “Empty Cache and Hard Reload”
Make sure Flask is running in debug mode:
# In web_server.py, ensure:
app.run(host='localhost', port=5000, debug=True)

API Endpoint Not Found (404)

If API calls return 404 errors:
1

Verify Flask server is running

Check the terminal running web_server.py for error messages.
2

Check the endpoint URL

The available endpoints are:
  • POST /api/convert
  • GET /api/unidades/<categoria>
  • GET /api/status
Ensure you’re using the correct HTTP method and path.
3

Test with curl

Verify endpoints work independently:
# Test status
curl http://localhost:5000/api/status

# Test conversion
curl -X POST http://localhost:5000/api/convert \
  -H "Content-Type: application/json" \
  -d '{"categoria":"temperatura","valor":32,"desde":"fahrenheit","hasta":"celsius"}'

Virtual Environment Issues

PowerShell Script Execution Blocked (Windows)

Windows PowerShell may block the activation script by default.
If you see: cannot be loaded because running scripts is disabled on this system
Solution:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
This temporarily allows script execution for the current PowerShell session.
This setting only affects the current PowerShell window and resets when you close it.

Wrong Python Version in venv

If your virtual environment uses the wrong Python version:
1

Delete the existing venv

rm -rf .venv
2

Create venv with specific version

python3.11 -m venv .venv
source .venv/bin/activate
3

Reinstall dependencies

python -m pip install --upgrade pip
pip install -r requirements.txt

ngrok Issues

ngrok Command Not Found

If ngrok is not installed:
brew install ngrok

ngrok Authentication Required

First time using ngrok? You need to add your auth token:
ngrok config add-authtoken YOUR_TOKEN
Get your token from: ngrok.com/dashboard

Process Management

Orphaned Server Processes

If servers keep running after closing terminals:
# Find processes
lsof -i :10000
lsof -i :5000

# Kill by PID
kill -9 <PID>

# Or kill all Python processes (use with caution)
pkill -f server.py
pkill -f web_server.py
The automated run scripts (run.sh and run.ps1) include cleanup handlers that stop servers when you press Ctrl+C.

Still Having Issues?

If none of these solutions work:
1

Check Python version

python3 --version
Should be 3.10 or 3.11
2

Verify all dependencies

pip list
Should show Flask and zeroc-ice
3

Test ICE client directly

python backend/client.py
This bypasses the web server and tests ICE directly
4

Check system requirements

  • Ensure ports 10000 and 5000 are not blocked by firewall
  • Verify you have network access (even localhost requires it)
  • Check for antivirus software blocking connections

Build docs developers (and LLMs) love