Page MenuHomePhabricator

Toolforge web service returns “No healthy upstream” when deploying FastAPI + React application
Closed, InvalidPublic

Description

We are experiencing an issue deploying a full-stack application on Wikimedia Toolforge. The application consists of a Python FastAPI backend and a React frontend using TanStack.

The project structure is approximately:

text
project/
├── server/   # Python FastAPI backend
└── client/   # React + TanStack frontend

Problem

During the initial deployment, the FastAPI backend/API was working correctly, but I was unable to get the React frontend to work as part of the same deployment.

I subsequently modified the Procfile and Toolforge configuration in an attempt to correctly serve both the frontend and backend.

Since making those changes, the Toolforge web service has been returning:

text
No healthy upstream

The deployment/build process does not show any obvious build failures. However, the web service logs contain runtime errors, and the application does not become healthy.

Expected Behaviour

The Toolforge web service should start successfully and serve the application, including:

  • The FastAPI backend/API
  • The React/TanStack frontend
  • Communication between the frontend and backend

Actual Behaviour

The web service fails to become healthy and displays:

text
No healthy upstream

The problem persists even after making several changes to the Procfile and Toolforge configuration.

Troubleshooting Already Attempted

I have:

  • Modified the Procfile several times
  • Modified the Toolforge configuration
  • Checked the deployment/build output
  • Reviewed the web service logs
  • Tried different approaches for serving the frontend and backend
  • Attempted troubleshooting with ChatGPT and GitHub Copilot

The issue still persists.

Assistance Requested

I would appreciate help identifying what is causing the Toolforge web service to become unhealthy.

In particular, I would like to determine whether the issue is related to:

  • The process/start command
  • Port binding or the port expected by Toolforge
  • The Procfile
  • Toolforge configuration
  • The application's directory structure
  • How the FastAPI backend is started
  • How the React frontend is built and served
  • Running the frontend and backend together on Toolforge
  • Another deployment or runtime configuration issue

I can provide the following for further investigation:

  • Current Procfile
  • Toolforge configuration
  • Full project directory structure
  • Deployment/build output
  • Web service logs
  • Backend startup configuration
  • Frontend build configuration

Any guidance on diagnosing the cause of the unhealthy web service would be greatly appreciated.

Repo Link: https://github.com/Sunkanmi1/Pan-African-Legal-Archives

Event Timeline

(i won't be the person able to help answering)

it will be easier for people to actually answer if you point to the tool and/or git repo in github/gitlab.

Thanks @Edgars2007, I've tagged the tool and added the repo link

Thanks @Edgars2007, I've tagged the tool and added the repo link

https://ghanasupremecases.toolforge.org is responding for me. Where are you seeing the issue?

@taavi we are trying to deploy the update version to toolforge but facing the aforementioned constraints

@Sunkanmi12 does the issue still persist?

I don't see No healthy upstream when I visit https://ghanasupremecases.toolforge.org/

let FastAPI serve the built React files

I think this should simplify your setup considerably yes, I recommend doing this.

Closing due to lack of response. For proper support venues please see https://wikitech.wikimedia.org/wiki/Help:Cloud_Services_communication instead of Phabricator.