Repository navigation
Conversation
/api/wiki/projects read PYTHON_BACKEND_HOST, which nothing sets or documents, while every other route and the rewrites use SERVER_BASE_URL. With the API on another host or with PORT changed in docker-compose, the home page project list and project deletion failed with 503 while the rest of the app worked. Prefer SERVER_BASE_URL and keep PYTHON_BACKEND_HOST as a fallback. Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
src/app/api/wiki/projects/route.tsbuilds its backend URL fromPYTHON_BACKEND_HOST. Nothing sets that variable and no README mentions it. Every other API route (/api/wiki/tasks,/api/chat/stream,/api/models/config, ...) and the rewrites innext.config.tsuseSERVER_BASE_URL, whichdocker-compose.ymland the Dockerfile set tohttp://localhost:${PORT}.So when the API is not on
localhost:8001, for example withPORT=8002in.env(the README tells you to keepSERVER_BASE_URLin sync with it) or with the API on another host, the rest of the app works but the project list on the home page and "delete project" go tolocalhost:8001and fail with503 Failed to connect to the Python backend.The route now uses
SERVER_BASE_URLfirst.PYTHON_BACKEND_HOSTis kept as a fallback, so anyone who did set it is not affected.Check: I ran
GETfrom the route with Node (next/serverstubbed with a module hook) against a stub backend on127.0.0.1:8002andSERVER_BASE_URL=http://127.0.0.1:8002:DELETEuses the same base URL (CACHE_API_ENDPOINT), so it is fixed as well.