Repository navigation
Error: FastAPI process exited unexpectedly during startup #167
Description
Activity
I have the same , I'm totally a noob and have absolutely no clue what I've done wrong. please help an old fart.
I got this too. Can someone help? Thanks in advance.
same problem,dose anyone have a solution?thanks
same issue for me. tried the installer and repo clone, both end in same result "Error: FastAPI process exited unexpectedly during startup". installed as "current user" and "admin" (all users), no difference. sometimes when I dismiss the error message, I can access the app, open settings. when I try to "test" the ollama connection then, I get a message, that it can not connect to Ollama. accessing same url (localhost:11434) via browser works. tried 0.40 same issue
for the github clone attempt, I had to installed node js manually.
one attempt I tried was removing modly, installing ollama directly and re-installing modly, same issue. modly still says it can not connect to ollama additionally to the error message during startup with fastpi
I'm currently testing on latest win11 25h2 fully patched and started the app with and without admin elevation. I tried to look for additional logs, but couldn't find anything useful to upload
Delete the Modly folder in the default C:\Users<username>\Documents (or whever you might have previously uses as your folder). It caches some junk there and it can get messed up
iammojogo-sudo commented
on Sep 27, 2026 SponsorContributorMore actionsIt is possible that it has something to do with extensions with previous venv built environments and pycache folders? Possibly deletion of those and then a click to repair might fix that issue?
The Problem
Please excuse the obvious AI writing, it helped me get past this issue. I couldn't use Modly for months.
When launching the Modly desktop app on Windows, the bundled FastAPI process crashes instantly (exit code: 1). This happens if you run Ollama inside a Docker container, because Modly's initialization script expects a native Windows binary/service and fails its local handshake. Additionally, if the Docker container wasn't explicitly configured to listen globally, Modly's frontend cannot bridge the network gap.
🛠️ How to Fix It
1. Recreate the Ollama Docker Container with Host Access
Your Docker container must explicitly accept traffic originating from outside its internal network stack (OLLAMA_HOST=0.0.0.0).
Stop your current container and re-run it with the environment variable exposed:Remove the existing container conflict
docker rm -f ollama
Spin up a fresh container allowing external host access
docker run -d -v ollama:/root/.ollama -p 11434:11434 -e OLLAMA_HOST=0.0.0.0 --name ollama ollama/ollama
2. Configure Windows Environment Variables
Tell Modly's underlying Python/FastAPI backend exactly where to find your running container:
- Open your Windows Start Menu, search for "Environment Variables", and select Edit the system environment variables.
- Click Environment Variables... at the bottom.
- Under User variables, click New... and add:
- Variable name: OLLAMA_HOST
- Variable value: http://127.0.0.1:11434
- Click OK to save.
3. Clear Modly's Corrupted Init Cache
Modly caches its broken startup loops locally. If you don't clear this folder, it will continue to crash even after fixing your environment variables.
- Navigate to your documents directory: C:\Users<Your-Username>\Documents
- Completely delete the Modly folder.
- Relaunch the Modly Desktop App.
This obviously needs a clearer error message. I might have time to work on a PR. Hope this helps
Reacted by mojoIf this becomes something that is solved for others, please comment below that it worked.
And a quick follow up. Stop or remap whatever is on 8765 (for Docker: change the host side of the mapping, e.g.
8767:8765), wait ~30 s for the port to release, then relaunch Modly.It's ultimately a port issue, and you should get a more specific error message. I feel like it's a catch-all error.
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsBacklog
This error occurs when I run the program.