Skip to content

Error: FastAPI process exited unexpectedly during startup #167

Description

@SDDASHTI

This error occurs when I run the program.

Activity

  1. DavidPFonk commented on Jun 19, 2026

    @DavidPFonk

    I have the same , I'm totally a noob and have absolutely no clue what I've done wrong. please help an old fart.

  2. NguyenVanDo51 commented on Jul 7, 2026

    @NguyenVanDo51

    I got this too. Can someone help? Thanks in advance.

  3. yuanshus commented on Aug 4, 2026

    @yuanshus

    same problem,dose anyone have a solution?thanks

  4. thespawnat commented on Aug 16, 2026

    @thespawnat

    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

  5. dlannan commented on Aug 18, 2026

    @dlannan

    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

  6. iammojogo-sudo commented on Sep 27, 2026

    @iammojogo-sudo
    SponsorContributor

    It 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?

  7. msholly commented on Oct 3, 2026

    @msholly

    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:

    1. Open your Windows Start Menu, search for "Environment Variables", and select Edit the system environment variables.
    2. Click Environment Variables... at the bottom.
    3. Under User variables, click New... and add:
    1. 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.

    1. Navigate to your documents directory: C:\Users<Your-Username>\Documents
    2. Completely delete the Modly folder.
    3. Relaunch the Modly Desktop App.

    This obviously needs a clearer error message. I might have time to work on a PR. Hope this helps

  8. iammojogo-sudo commented on Oct 3, 2026

    @iammojogo-sudo
    SponsorContributor

    If this becomes something that is solved for others, please comment below that it worked.

  9. msholly commented on Oct 3, 2026

    @msholly

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions