Problem:
I am encountering an issue during the deployment of my ChainLit Python application on Heroku using Bitbucket Pipelines. While the build and deployment processes seem to run successfully, the application fails to start on Heroku. The latest error messages are as follows:
Latest Error Logs on Heroku:
2023-12-14T13:21:26.893940+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/robots.txt" host=orchestra-0c5d9997a21d.herokuapp.com request_id=004c96f8-f7b7-4a05-bb99-b16207adc65f fwd="39.51.161.7" dyno= connect= service= status=503 bytes= protocol=https
2023-12-14T13:21:27.099092+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=orchestra-0c5d9997a21d.herokuapp.com request_id=606b1181-07b1-45e7-9672-5fdd8969edae fwd="39.51.161.7" dyno= connect= service= status=503 bytes= protocol=https
Description:
The application fails to start on Heroku, resulting in an H10 error ("App crashed"). These errors are triggered during attempts to access specific paths, such as /robots.txt and /favicon.ico.
Bitbucket Pipelines Configuration:
image: python:3.12-bullseye
pipelines:
branches:
master:
- step:
name: Build
script:
- echo "Building the app"
- pip install --no-cache-dir --upgrade pip
- pip install --no-cache-dir -r requirements.txt
- export AZURE_OPENAI_KEY=$AZURE_OPENAI_KEY
- export AZURE_OPENAI_ENDPOINT=https://$AZURE_OAI_RESOURCE_NAME.azure.com/
- export AZURE_OPENAI_VERSION=2023-09-15-preview
- export AZURE_OPENAI_DEPLOYMENT=$AZURE_OAI_DEPLOYMENT
- export AZURE_OPENAI_MODEL=gpt-3.5-turbo
- git archive --format=tar.gz master -o my-app.tar.gz
artifacts:
- my-app.tar.gz
- step:
name: Deploy to production
deployment: production
caches:
- pip
script:
- pipe: atlassian/heroku-deploy:2.3.0
variables:
HEROKU_API_KEY: $HEROKU_API_KEY
HEROKU_APP_NAME: $HEROKU_APP_NAME
ZIP_FILE: my-app.tar.gz
Procfile:
web: chainlit run genai.py
requirements.txt:
python-dotenv
langchain
openai
termcolor
chainlit
Error Details:
The recent errors are related to the app crashing upon receiving requests for /robots.txt and /favicon.ico. The H10 error code indicates a generic "App crashed" message.
Troubleshooting Steps:
I have already tried the following steps:
- Verified the
requirements.txtfile includes all necessary dependencies. - Checked the
Procfileto confirm it is correctly configured to run the app.
Despite these efforts, the issue persists, and I'm seeking assistance in resolving this new H10 error during the Heroku deployment.
I appreciate any insights or guidance on troubleshooting and resolving this deployment issue.