ollama-open-webui icon indicating copy to clipboard operation
ollama-open-webui copied to clipboard

Fix missing git repo and ASGI error

Open spencerchristensen opened this issue 1 year ago • 1 comments

Greetings!

I tried to run the one-liner yesterday (with great excitement and fanfare) and encountered two errors. The launch/deploy was successful but the app would throw the error and cause the fly machine to shut down.

Perhaps these are upstream issues to be handled by OpenWebUI? I'm not familiar enough with that image to say. Therefore I wanted to open this PR in case anybody is likewise blocked and/or these are worth merging.

Thank you!

Git Error

I encountered the following:

2024-10-03T14:12:33.052 app[568339e2b6de08] ord [info] File "/usr/local/lib/python3.11/site-packages/main.py", line 16, in <module>
2024-10-03T14:12:33.052 app[568339e2b6de08] ord [info] gitpython = GitPython()
2024-10-03T14:12:33.052 app[568339e2b6de08] ord [info] ^^^^^^^^^^^
2024-10-03T14:12:33.052 app[568339e2b6de08] ord [info] File "/usr/local/lib/python3.11/site-packages/main.py", line 8, in __init__
2024-10-03T14:12:33.052 app[568339e2b6de08] ord [info] self.repo = Repo(".")
2024-10-03T14:12:33.052 app[568339e2b6de08] ord [info] ^^^^^^^^^
2024-10-03T14:12:33.052 app[568339e2b6de08] ord [info] File "/usr/local/lib/python3.11/site-packages/git/repo/base.py", line 289, in __init__
2024-10-03T14:12:33.052 app[568339e2b6de08] ord [info] raise InvalidGitRepositoryError(epath)
2024-10-03T14:12:33.052 app[568339e2b6de08] ord [info] git.exc.InvalidGitRepositoryError: /app/backend
2024-10-03T14:12:33.764 app[568339e2b6de08] ord [info] INFO Main child exited normally with code: 1
2024-10-03T14:12:33.784 app[568339e2b6de08] ord [info] INFO Starting clean up.
2024-10-03T14:12:33.954 app[568339e2b6de08] ord [info] INFO Umounting /dev/vdc from /app/backend/data
2024-10-03T14:12:34.009 app[568339e2b6de08] ord [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2024-10-03T14:12:34.014 app[568339e2b6de08] ord [info] [ 6.185248] reboot: Power down

It looks like the upstream Open WebUI image expected a git binary and repo?

ASGI Error

After fixing the git error I encountered the following:

2024-10-03T14:24:44.567 app[568339e2b6de08] ord [info] Loading WEBUI_SECRET_KEY from .webui_secret_key
2024-10-03T14:24:44.574 app[568339e2b6de08] ord [info] [GIN] 2024/10/03 - 14:24:44 | 200 | 29.94µs | 127.0.0.1 | HEAD "/"
2024-10-03T14:24:44.576 app[568339e2b6de08] ord [info] Reinitialized existing Git repository in /app/backend/.git/
2024-10-03T14:24:44.588 app[568339e2b6de08] ord [info] [master e0c1e37] Initial commit
2024-10-03T14:24:44.910 app[568339e2b6de08] ord [info] pulling manifest â ‹ pulling manifest â ™ pulling manifest â ¹ ERROR: Error loading ASGI app. Attribute "app" not found in module "main".
2024-10-03T14:24:45.542 app[568339e2b6de08] ord [info] INFO Main child exited normally with code: 1
2024-10-03T14:24:45.557 app[568339e2b6de08] ord [info] INFO Starting clean up.
2024-10-03T14:24:45.841 app[568339e2b6de08] ord [info] INFO Umounting /dev/vdc from /app/backend/data
2024-10-03T14:24:45.847 app[568339e2b6de08] ord [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2024-10-03T14:24:45.851 app[568339e2b6de08] ord [info] [ 6.188454] reboot: Power down

uvicorn couldn't find the main.py as it was nested in the open_webui package.

spencerchristensen avatar Oct 03 '24 17:10 spencerchristensen

I can confirm the above 2 commits worked for me after running into the same issue. The Ollama WebUI name change hit me elsewhere with docker-compose namespace issues, but I can't for the life of me understand why a Git repo is also needed.

jjmata avatar Oct 04 '24 13:10 jjmata

Thanks for this! We just merged in https://github.com/fly-apps/ollama-open-webui/pull/5 which should get this fixed up.

symkat avatar Oct 29 '25 16:10 symkat