Backend fails to start
Backend fails to start
Checklist
- Python version is 3.10 or higher:
python --version - All Python dependencies are installed:
pip install -r requirements.txt - Port 8001 is not already in use (see Port occupied after Ctrl+C)
.envfile exists and contains valid values forLLM_API_KEY,LLM_HOST,LLM_MODEL,EMBEDDING_API_KEY,EMBEDDING_HOST, andEMBEDDING_MODEL
- Change the port: Add
BACKEND_PORT=9001(or any free port) to your.envfile. - Review the logs: Error messages printed to the terminal during startup usually identify the exact cause.
Port occupied after Ctrl+C
Port occupied after Ctrl+C
ProblemAfter pressing Ctrl+C to stop DeepTutor (especially mid-task such as during deep research), restarting shows an “address already in use” error.CauseCtrl+C sometimes only stops the frontend process. The backend (FastAPI/Uvicorn) may continue running in the background on port 8001.SolutionFind and terminate the process that is holding the port, then restart normally.After the port is free, restart with:
- macOS / Linux
- Windows
npm: command not found
npm: command not found
ProblemRunning Verify the installation
scripts/start_web.py prints npm: command not found or exits with status 127.Checklist- Check whether npm is installed:
npm --version - Check whether Node.js is installed:
node --version - If you are using conda, confirm the environment is activated
- conda (recommended)
- Official installer
- nvm
DeepTutor requires Node.js 18 or higher. Earlier versions are not supported.
Long path names on Windows cause installation errors
Long path names on Windows cause installation errors
ProblemOn Windows, installation fails with messages such as “The filename or extension is too long” or similar path-length errors.CauseWindows enforces a default path length limit of 260 characters. DeepTutor’s nested dependency tree can exceed this limit.SolutionRun the following command in an Administrator Command Prompt to enable long path support system-wide:Restart your terminal after running the command, then retry the installation.
Frontend cannot connect to backend
Frontend cannot connect to backend
ChecklistRestart the frontend after saving the file.
- Confirm the backend is running by visiting http://localhost:8001/docs in your browser.
- Open your browser’s developer console and check for network errors.
scripts/start_web.py), you must tell Next.js where the backend is. Create the file web/.env.local with the following content:Docker: frontend cannot connect in cloud deployment
Docker: frontend cannot connect in cloud deployment
ProblemAfter deploying to a cloud server, the frontend shows “Failed to fetch” or “NEXT_PUBLIC_API_BASE is not configured”.CauseThe default API URL resolves to Alternatively, add the variable to your If you are also using a custom backend port, include it in the URL:
localhost:8001 inside the user’s browser, which points to the user’s local machine rather than your remote server. The frontend JavaScript is served to the browser and therefore cannot use container-internal hostnames.SolutionSet NEXT_PUBLIC_API_BASE_EXTERNAL to your server’s public URL so the browser knows where to reach the backend:.env file:Docker: how to use custom ports
Docker: how to use custom ports
SolutionYou must set both the environment variables and the Docker port mappings. The
-p host:container mapping must match the BACKEND_PORT / FRONTEND_PORT values.WebSocket connection fails
WebSocket connection fails
ChecklistReview the backend logs for any connection-related errors. Real-time features such as the Smart Solver and Deep Research rely on WebSocket; HTTP-only proxies will break them.
- Confirm the backend is running (visit http://localhost:8001/docs).
- Check that no firewall rule is blocking WebSocket traffic on port 8001.
- If you are behind a reverse proxy, ensure it is configured to upgrade WebSocket connections (see the nginx config in the HTTPS reverse proxy section below).
Settings page shows an error with an HTTPS reverse proxy
Settings page shows an error with an HTTPS reverse proxy
ProblemWhen deploying behind an HTTPS reverse proxy (such as nginx), the Settings page shows “Error loading data”. Browser DevTools reveals that HTTPS requests are being redirected to HTTP (307 redirect).CauseThis was a bug in versions prior to v0.5.0. FastAPI’s automatic trailing-slash redirect generated plain HTTP URLs, effectively downgrading the connection from HTTPS.SolutionUpdate to v0.5.0 or later. The fix disables automatic trailing-slash redirects so the original protocol is preserved.If you must stay on an older version, or if you want to harden your nginx configuration regardless, use the following nginx config. The key line is Also set the following in your Reference: GitHub issue #112
proxy_set_header X-Forwarded-Proto $scheme, which forwards the original protocol to FastAPI:.env file so the frontend sends requests to the correct URL: