Closed sNor4pro closed 1 month ago
Hey there, @sNor4pro! I'm here to help with any bugs, questions, or contributions you have regarding the Quivr project. Let's get that issue sorted out for you.
To address the issue where Docker cannot find the backend-base:latest
image, you can modify the docker-compose.yml
file to build the image locally instead of pulling it from a remote repository. Here is an alternative way to install Quivr by ensuring the backend image is built locally:
version: "3.8"
services:
frontend:
image: quivr-frontend-prebuilt
pull_policy: never
build:
context: frontend
dockerfile: Dockerfile
args:
- NEXT_PUBLIC_ENV=local
- NEXT_PUBLIC_BACKEND_URL=${NEXT_PUBLIC_BACKEND_URL}
- NEXT_PUBLIC_SUPABASE_URL=${NEXT_PUBLIC_SUPABASE_URL}
- NEXT_PUBLIC_SUPABASE_ANON_KEY=${NEXT_PUBLIC_SUPABASE_ANON_KEY}
- NEXT_PUBLIC_CMS_URL=${NEXT_PUBLIC_CMS_URL}
- NEXT_PUBLIC_FRONTEND_URL=${NEXT_PUBLIC_FRONTEND_URL}
- NEXT_PUBLIC_AUTH_MODES=${NEXT_PUBLIC_AUTH_MODES}
container_name: web
depends_on:
- backend-core
restart: always
ports:
- 3000:3000
backend-core:
build:
context: backend
dockerfile: Dockerfile
container_name: backend-core
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: [ "CMD", "curl", "http://localhost:5050/healthz" ]
command:
- "uvicorn"
- "main:app"
- "--host"
- "0.0.0.0"
- "--port"
- "5050"
- "--workers"
- "6"
restart: always
volumes:
- ./backend/:/code/
ports:
- 5050:5050
redis:
image: redis:latest@sha256:a7cee7c8178ff9b5297cb109e6240f5072cdaaafd775ce6b586c3c704b06458e
container_name: redis
restart: always
ports:
- 6379:6379
worker:
build:
context: backend
dockerfile: Dockerfile
container_name: worker
extra_hosts:
- "host.docker.internal:host-gateway"
command: celery -A celery_worker worker -l info
restart: always
depends_on:
- redis
beat:
build:
context: backend
dockerfile: Dockerfile
container_name: beat
extra_hosts:
- "host.docker.internal:host-gateway"
command: celery -A celery_worker beat -l info
restart: always
depends_on:
- redis
flower:
build:
context: backend
dockerfile: Dockerfile
container_name: flower
extra_hosts:
- "host.docker.internal:host-gateway"
command: celery -A celery_worker flower -l info --port=5555
restart: always
depends_on:
- redis
- worker
- beat
ports:
- 5555:5555
networks:
quivr-network:
driver: bridge
In this configuration, the backend-core
, worker
, beat
, and flower
services are set to build the Docker image locally using the Dockerfile
in the backend
directory. This should resolve the issue of Docker not finding the backend-base:latest
image [1].
To continue talking to Dosu, mention @dosu.
it now spams the whole time, is this correct?: @dosu Webinterface from Quivr works, create brain doesn't.
Attaching to backend-core, beat, flower, redis, web, worker
redis | 1:C 06 Aug 2024 19:42:47.576 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis | 1:C 06 Aug 2024 19:42:47.577 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis | 1:C 06 Aug 2024 19:42:47.577 * Redis version=7.2.3, bits=64, commit=00000000, modified=0, pid=1, just started
redis | 1:C 06 Aug 2024 19:42:47.577 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis | 1:M 06 Aug 2024 19:42:47.577 * monotonic clock: POSIX clock_gettime
redis | 1:M 06 Aug 2024 19:42:47.577 * Running mode=standalone, port=6379.
redis | 1:M 06 Aug 2024 19:42:47.577 * Server initialized
redis | 1:M 06 Aug 2024 19:42:47.577 * Loading RDB produced by version 7.2.3
redis | 1:M 06 Aug 2024 19:42:47.577 * RDB age 4 seconds
redis | 1:M 06 Aug 2024 19:42:47.577 * RDB memory usage when created 0.83 Mb
redis | 1:M 06 Aug 2024 19:42:47.577 * Done loading RDB, keys loaded: 0, keys expired: 0.
redis | 1:M 06 Aug 2024 19:42:47.577 * DB loaded from disk: 0.000 seconds
redis | 1:M 06 Aug 2024 19:42:47.577 * Ready to accept connections tcp
backend-core | INFO: Uvicorn running on http://0.0.0.0:5050/ (Press CTRL+C to quit)
backend-core | INFO: Started parent process [1]
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
web | ▲ Next.js 14.1.0
web | - Local: http://localhost:3000/
web | - Network: http://0.0.0.0:3000/
web |
web | ✓ Ready in 43ms
backend-core | INFO: Waiting for child process [8]
backend-core | INFO: Child process [8] died
backend-core | INFO: Waiting for child process [9]
backend-core | INFO: Child process [9] died
backend-core | INFO: Waiting for child process [10]
backend-core | INFO: Child process [10] died
backend-core | INFO: Waiting for child process [11]
backend-core | INFO: Child process [11] died
backend-core | INFO: Waiting for child process [12]
backend-core | INFO: Child process [12] died
backend-core | INFO: Waiting for child process [13]
backend-core | INFO: Child process [13] died
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
beat | Usage: celery [OPTIONS] COMMAND [ARGS]...
beat | Try 'celery --help' for help.
beat |
beat | Error: Invalid value for '-A' / '--app':
beat | Unable to load celery application.
beat | The module celery_worker was not found.
worker | Usage: celery [OPTIONS] COMMAND [ARGS]...
worker | Try 'celery --help' for help.
worker |
worker | Error: Invalid value for '-A' / '--app':
worker | Unable to load celery application.
worker | The module celery_worker was not found.
backend-core | INFO: Waiting for child process [9]
backend-core | INFO: Child process [9] died
backend-core | INFO: Waiting for child process [11]
backend-core | INFO: Child process [11] died
backend-core | INFO: Waiting for child process [13]
backend-core | INFO: Child process [13] died
backend-core | INFO: Waiting for child process [21]
backend-core | INFO: Child process [21] died
backend-core | INFO: Waiting for child process [23]
backend-core | INFO: Child process [23] died
backend-core | INFO: Waiting for child process [25]
backend-core | INFO: Child process [25] died
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
flower | Usage: celery [OPTIONS] COMMAND [ARGS]...
flower | Try 'celery --help' for help.
flower |
flower | Error: Invalid value for '-A' / '--app':
flower | Unable to load celery application.
flower | The module celery_worker was not found.
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
beat exited with code 0
worker exited with code 0
backend-core | INFO: Waiting for child process [11]
The errors you're encountering indicate that the backend-core
service is unable to import the "main" module, and the worker
, beat
, and flower
services are unable to load the celery_worker
module. Here are steps to resolve these issues:
Check Directory Structure:
Ensure that the backend
directory contains the main.py
and celery_worker.py
files. The structure should look like this:
backend/
├── main.py
└── celery_worker.py
Verify Module Paths:
Ensure that the main.py
file contains the app
object, and the celery_worker.py
file is correctly set up for Celery.
Check Volume Mounts:
Ensure that the code is correctly mounted and accessible within the container. The volumes
directive in the docker-compose.yml
file should mount the ./backend/
directory to /code/
in the container.
Inspect Docker Logs: Check the logs of the failing services to get more details about the import errors. You can use the following commands:
docker-compose logs backend-core
docker-compose logs worker
docker-compose logs beat
docker-compose logs flower
Example main.py
:
Here is an example of what the main.py
file might look like:
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
Example celery_worker.py
:
Here is an example of what the celery_worker.py
file might look like:
from celery import Celery
celery = Celery('celery_worker', broker='pyamqp://guest@localhost//')
@celery.task
def add(x, y):
return x + y
By ensuring the directory structure is correct, the module paths are properly set up, and using the manage_services.sh
script to manage your services, you should be able to resolve the import issues for the backend-core
, worker
, beat
, and flower
services [1].
To continue talking to Dosu, mention @dosu.
I don't see these files in the folder.
See below:
mike@pc:~/quivr/backend$ ls
api core Dockerfile.dev poetry.toml supabase
ci-migration.sh Dockerfile poetry.lock pyproject.toml
snipped from docker-compose logs backend-core
backend-core | INFO: Child process [796] died
backend-core | INFO: Waiting for child process [808]
backend-core | INFO: Child process [808] died
backend-core | INFO: Waiting for child process [812]
backend-core | INFO: Child process [812] died
backend-core | INFO: Waiting for child process [820]
backend-core | INFO: Child process [820] died
backend-core | INFO: Waiting for child process [822]
backend-core | INFO: Child process [822] died
backend-core | INFO: Waiting for child process [824]
backend-core | INFO: Child process [824] died
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | ERROR: Error loading ASGI app. Could not import module "main".
backend-core | INFO: Received SIGTERM, exiting.
backend-core | INFO: Waiting for child process [808]
backend-core | INFO: Waiting for child process [820]
backend-core | INFO: Waiting for child process [824]
backend-core | INFO: Waiting for child process [832]
backend-core | INFO: Waiting for child process [834]
backend-core | INFO: Waiting for child process [836]
backend-core | INFO: Stopping parent process [1]
mike@pc:~/quivr/backend$
snipped from worker log:
worker | Error: Invalid value for '-A' / '--app':
worker | Unable to load celery application.
worker | The module celery_worker was not found.
worker | Usage: celery [OPTIONS] COMMAND [ARGS]...
worker | Try 'celery --help' for help.
worker |
worker | Error: Invalid value for '-A' / '--app':
worker | Unable to load celery application.
worker | The module celery_worker was not found.
worker | Usage: celery [OPTIONS] COMMAND [ARGS]...
worker | Try 'celery --help' for help.
worker |
worker | Error: Invalid value for '-A' / '--app':
worker | Unable to load celery application.
worker | The module celery_worker was not found.
snipped from beat log:
beat | Unable to load celery application.
beat | The module celery_worker was not found.
beat | Usage: celery [OPTIONS] COMMAND [ARGS]...
beat | Try 'celery --help' for help.
beat |
beat | Error: Invalid value for '-A' / '--app':
beat | Unable to load celery application.
beat | The module celery_worker was not found.
beat | Usage: celery [OPTIONS] COMMAND [ARGS]...
beat | Try 'celery --help' for help.
beat |
beat | Error: Invalid value for '-A' / '--app':
beat | Unable to load celery application.
beat | The module celery_worker was not found.
beat | Usage: celery [OPTIONS] COMMAND [ARGS]...
beat | Try 'celery --help' for help.
beat |
beat | Error: Invalid value for '-A' / '--app':
beat | Unable to load celery application.
beat | The module celery_worker was not found.
snipped from flower log:
flower | Unable to load celery application.
flower | The module celery_worker was not found.
flower | Usage: celery [OPTIONS] COMMAND [ARGS]...
flower | Try 'celery --help' for help.
flower |
flower | Error: Invalid value for '-A' / '--app':
flower | Unable to load celery application.
flower | The module celery_worker was not found.
flower | Usage: celery [OPTIONS] COMMAND [ARGS]...
flower | Try 'celery --help' for help.
flower |
flower | Error: Invalid value for '-A' / '--app':
flower | Unable to load celery application.
flower | The module celery_worker was not found.
Can I simply create them? I used your docker-compose. @dosu
The errors indicate that the main.py
and celery_worker.py
files are missing from the backend
directory. You can create these files with the following content:
main.py
This file sets up a basic FastAPI application.
from fastapi import FastAPI
app = FastAPI()
@app.get("/healthz")
def read_healthz():
return {"status": "ok"}
celery_worker.py
This file sets up a basic Celery worker.
from celery import Celery
celery = Celery('celery_worker', broker='redis://redis:6379/0')
@celery.task
def add(x, y):
return x + y
Ensure your backend
directory looks like this:
backend/
├── api
├── core
├── Dockerfile
├── Dockerfile.dev
├── poetry.lock
├── poetry.toml
├── pyproject.toml
├── supabase
├── main.py
└── celery_worker.py
Ensure your Dockerfile
in the backend
directory copies these files correctly:
FROM python:3.9-slim
WORKDIR /code
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5050", "--workers", "6"]
Ensure your docker-compose.yml
is correctly configured. Here is an example configuration:
version: "3.8"
services:
backend-core:
build:
context: backend
dockerfile: Dockerfile
container_name: backend-core
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: [ "CMD", "curl", "http://localhost:5050/healthz" ]
command:
- "uvicorn"
- "main:app"
- "--host"
- "0.0.0.0"
- "--port"
- "5050"
- "--workers"
- "6"
restart: always
volumes:
- ./backend/:/code/
ports:
- 5050:5050
redis:
image: redis:latest
container_name: redis
restart: always
ports:
- 6379:6379
worker:
build:
context: backend
dockerfile: Dockerfile
container_name: worker
extra_hosts:
- "host.docker.internal:host-gateway"
command: celery -A celery_worker worker -l info
restart: always
depends_on:
- redis
beat:
build:
context: backend
dockerfile: Dockerfile
container_name: beat
extra_hosts:
- "host.docker.internal:host-gateway"
command: celery -A celery_worker beat -l info
restart: always
depends_on:
- redis
flower:
build:
context: backend
dockerfile: Dockerfile
container_name: flower
extra_hosts:
- "host.docker.internal:host-gateway"
command: celery -A celery_worker flower -l info --port=5555
restart: always
depends_on:
- redis
- worker
- beat
ports:
- 5555:5555
By creating these files and ensuring the correct configuration, the backend-core
, worker
, beat
, and flower
services should function correctly [1][2][3].
To continue talking to Dosu, mention @dosu.
this is my docker, looks like something is missing: @dosu
# Using a slim version for a smaller base image
FROM python:3.11.6-slim-bullseye
ARG DEV_MODE
ENV DEV_MODE=$DEV_MODE
# Install GEOS library, Rust, and other dependencies, then clean up
RUN apt-get clean && apt-get update && apt-get install -y \
libgeos-dev \
libcurl4-openssl-dev \
libssl-dev \
binutils \
pandoc \
curl \
git \
poppler-utils \
tesseract-ocr \
autoconf \
automake \
build-essential \
libtool \
python-dev \
wget \
# Additional dependencies for document handling
libmagic-dev \
poppler-utils \
tesseract-ocr \
libreoffice \
libpq-dev \
gcc \
pandoc && \
rm -rf /var/lib/apt/lists/*
RUN ARCHITECTURE=$(uname -m) && \
if [ "$ARCHITECTURE" = "x86_64" ]; then \
wget https://github.com/supabase/cli/releases/download/v1.163.6/supabase_1.163.6_linux_amd64.deb && \
dpkg -i supabase_1.163.6_linux_amd64.deb && \
rm supabase_1.163.6_linux_amd64.deb; \
elif [ "$ARCHITECTURE" = "aarch64" ]; then \
wget https://github.com/supabase/cli/releases/download/v1.163.6/supabase_1.163.6_linux_arm64.deb && \
dpkg -i supabase_1.163.6_linux_arm64.deb && \
rm supabase_1.163.6_linux_arm64.deb; \
fi && \
rm -rf /var/lib/apt/lists/*
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
# Add Rust binaries to the PATH
ENV PATH="/root/.cargo/bin:${PATH}" \
POETRY_CACHE_DIR=/tmp/poetry_cache \
PYTHONDONTWRITEBYTECODE=1
WORKDIR /code
# Copy monorepo dependencies
# CORE
COPY core/pyproject.toml core/README.md core/poetry.lock /code/core/
COPY core/quivr_core /code/core/quivr_core
# API
COPY api/pyproject.toml api/poetry.lock api/README.md /code/api/
COPY api/quivr_api /code/api/quivr_api
COPY ./pyproject.toml ./poetry.lock* /code/
COPY ./ci-migration.sh /code/
COPY supabase /code/supabase/
# Run install
RUN poetry install --no-root --with dev,test && \
playwright install --with-deps && \
rm -rf $POETRY_CACHE_DIR
ENV PYTHONPATH=/code
EXPOSE 5050
It looks like your Dockerfile
is missing the steps to copy and set up the main.py
and celery_worker.py
files. Here are the steps to update your Dockerfile
and ensure these files are included:
Dockerfile
Add the following lines to copy the main.py
and celery_worker.py
files and set the entry point for the application:
# Using a slim version for a smaller base image
FROM python:3.11.6-slim-bullseye
ARG DEV_MODE
ENV DEV_MODE=$DEV_MODE
# Install GEOS library, Rust, and other dependencies, then clean up
RUN apt-get clean && apt-get update && apt-get install -y \
libgeos-dev \
libcurl4-openssl-dev \
libssl-dev \
binutils \
pandoc \
curl \
git \
poppler-utils \
tesseract-ocr \
autoconf \
automake \
build-essential \
libtool \
python-dev \
wget \
# Additional dependencies for document handling
libmagic-dev \
poppler-utils \
tesseract-ocr \
libreoffice \
libpq-dev \
gcc \
pandoc && \
rm -rf /var/lib/apt/lists/*
RUN ARCHITECTURE=$(uname -m) && \
if [ "$ARCHITECTURE" = "x86_64" ]; then \
wget https://github.com/supabase/cli/releases/download/v1.163.6/supabase_1.163.6_linux_amd64.deb && \
dpkg -i supabase_1.163.6_linux_amd64.deb && \
rm supabase_1.163.6_linux_amd64.deb; \
elif [ "$ARCHITECTURE" = "aarch64" ]; then \
wget https://github.com/supabase/cli/releases/download/v1.163.6/supabase_1.163.6_linux_arm64.deb && \
dpkg -i supabase_1.163.6_linux_arm64.deb && \
rm supabase_1.163.6_linux_arm64.deb; \
fi && \
rm -rf /var/lib/apt/lists/*
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
# Add Rust binaries to the PATH
ENV PATH="/root/.cargo/bin:${PATH}" \
POETRY_CACHE_DIR=/tmp/poetry_cache \
PYTHONDONTWRITEBYTECODE=1
WORKDIR /code
# Copy monorepo dependencies
# CORE
COPY core/pyproject.toml core/README.md core/poetry.lock /code/core/
COPY core/quivr_core /code/core/quivr_core
# API
COPY api/pyproject.toml api/poetry.lock api/README.md /code/api/
COPY api/quivr_api /code/api/quivr_api
COPY ./pyproject.toml ./poetry.lock* /code/
COPY ./ci-migration.sh /code/
COPY supabase /code/supabase/
# Copy main.py and celery_worker.py
COPY main.py /code/
COPY celery_worker.py /code/
# Run install
RUN poetry install --no-root --with dev,test && \
playwright install --with-deps && \
rm -rf $POETRY_CACHE_DIR
ENV PYTHONPATH=/code
EXPOSE 5050
# Set the entry point for the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5050"]
main.py
Create a main.py
file with the following content:
from fastapi import FastAPI
app = FastAPI()
@app.get("/healthz")
def read_healthz():
return {"status": "ok"}
celery_worker.py
Create a celery_worker.py
file with the following content:
from celery import Celery
celery = Celery('celery_worker', broker='redis://redis:6379/0')
@celery.task
def add(x, y):
return x + y
Ensure your backend
directory looks like this:
backend/
├── api
├── core
├── Dockerfile
├── Dockerfile.dev
├── poetry.lock
├── poetry.toml
├── pyproject.toml
├── supabase
├── main.py
└── celery_worker.py
By updating your Dockerfile
to include the main.py
and celery_worker.py
files and ensuring the correct directory structure, the backend-core
, worker
, beat
, and flower
services should function correctly [1][2].
To continue talking to Dosu, mention @dosu.
No error spams anymore, this is good, but now i can't create a brain or make go into my profile see: @dosu
backend-core | INFO: 172.19.0.1:38630 - "OPTIONS /user/identity HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:38632 - "OPTIONS /user/credits HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:33406 - "OPTIONS /user HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:38630 - "OPTIONS /user/identity HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:38632 - "OPTIONS /onboarding HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:33406 - "OPTIONS /user HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:38630 - "OPTIONS /user/identity HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:38632 - "OPTIONS /user/credits HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:33406 - "OPTIONS /onboarding HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:38630 - "OPTIONS /onboarding HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:38632 - "OPTIONS /onboarding HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:33406 - "OPTIONS /user HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:38630 - "OPTIONS /user/identity HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:38632 - "OPTIONS /onboarding HTTP/1.1" 404 Not Found
backend-core | INFO: 127.0.0.1:56878 - "GET /healthz HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:59802 - "OPTIONS /user HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:59802 - "OPTIONS /user/identity HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:59802 - "OPTIONS /user/credits HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:59802 - "OPTIONS /onboarding HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:59802 - "OPTIONS /user/credits HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:59802 - "OPTIONS /user HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:59802 - "OPTIONS /user/identity HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:59802 - "OPTIONS /onboarding HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:59802 - "OPTIONS /user/credits HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:59802 - "OPTIONS /user/credits HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:59802 - "OPTIONS /user/credits HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:59802 - "OPTIONS /user HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:59802 - "OPTIONS /user/identity HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:59806 - "OPTIONS /onboarding HTTP/1.1" 404 Not Found
The 404 errors indicate that the endpoints for /user
, /user/identity
, /user/credits
, and /onboarding
are not defined in your FastAPI application. You need to ensure that these endpoints are correctly implemented in your main.py
or other relevant files.
Here is an example of how you can define these endpoints in your main.py
:
main.py
from fastapi import FastAPI, HTTPException
app = FastAPI()
@app.get("/healthz")
def read_healthz():
return {"status": "ok"}
@app.options("/user")
def options_user():
return {"status": "ok"}
@app.options("/user/identity")
def options_user_identity():
return {"status": "ok"}
@app.options("/user/credits")
def options_user_credits():
return {"status": "ok"}
@app.options("/onboarding")
def options_onboarding():
return {"status": "ok"}
@app.get("/user/identity")
def get_user_identity():
# Implement your logic here
return {"identity": "user_identity"}
@app.get("/user/credits")
def get_user_credits():
# Implement your logic here
return {"credits": "user_credits"}
@app.get("/onboarding")
def get_onboarding():
# Implement your logic here
return {"onboarding": "onboarding_info"}
Ensure your backend
directory looks like this:
backend/
├── api
├── core
├── Dockerfile
├── Dockerfile.dev
├── poetry.lock
├── poetry.toml
├── pyproject.toml
├── supabase
├── main.py
└── celery_worker.py
Ensure your Dockerfile
in the backend
directory copies these files correctly:
# Using a slim version for a smaller base image
FROM python:3.11.6-slim-bullseye
ARG DEV_MODE
ENV DEV_MODE=$DEV_MODE
# Install GEOS library, Rust, and other dependencies, then clean up
RUN apt-get clean && apt-get update && apt-get install -y \
libgeos-dev \
libcurl4-openssl-dev \
libssl-dev \
binutils \
pandoc \
curl \
git \
poppler-utils \
tesseract-ocr \
autoconf \
automake \
build-essential \
libtool \
python-dev \
wget \
# Additional dependencies for document handling
libmagic-dev \
poppler-utils \
tesseract-ocr \
libreoffice \
libpq-dev \
gcc \
pandoc && \
rm -rf /var/lib/apt/lists/*
RUN ARCHITECTURE=$(uname -m) && \
if [ "$ARCHITECTURE" = "x86_64" ]; then \
wget https://github.com/supabase/cli/releases/download/v1.163.6/supabase_1.163.6_linux_amd64.deb && \
dpkg -i supabase_1.163.6_linux_amd64.deb && \
rm supabase_1.163.6_linux_amd64.deb; \
elif [ "$ARCHITECTURE" = "aarch64" ]; then \
wget https://github.com/supabase/cli/releases/download/v1.163.6/supabase_1.163.6_linux_arm64.deb && \
dpkg -i supabase_1.163.6_linux_arm64.deb && \
rm supabase_1.163.6_linux_arm64.deb; \
fi && \
rm -rf /var/lib/apt/lists/*
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
# Add Rust binaries to the PATH
ENV PATH="/root/.cargo/bin:${PATH}" \
POETRY_CACHE_DIR=/tmp/poetry_cache \
PYTHONDONTWRITEBYTECODE=1
WORKDIR /code
# Copy monorepo dependencies
# CORE
COPY core/pyproject.toml core/README.md core/poetry.lock /code/core/
COPY core/quivr_core /code/core/quivr_core
# API
COPY api/pyproject.toml api/poetry.lock api/README.md /code/api/
COPY api/quivr_api /code/api/quivr_api
COPY ./pyproject.toml ./poetry.lock* /code/
COPY ./ci-migration.sh /code/
COPY supabase /code/supabase/
# Copy main.py and celery_worker.py
COPY main.py /code/
COPY celery_worker.py /code/
# Run install
RUN poetry install --no-root --with dev,test && \
playwright install --with-deps && \
rm -rf $POETRY_CACHE_DIR
ENV PYTHONPATH=/code
EXPOSE 5050
# Set the entry point for the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5050"]
By defining these endpoints and ensuring the correct directory structure and Dockerfile configuration, the backend service should be able to handle the requests to /user
, /user/identity
, /user/credits
, and /onboarding
without returning 404 errors [1][2].
To continue talking to Dosu, mention @dosu.
I edited the main.py and dockerfile with your data, stil the same issue: @dosu
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /chat HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:49054 - "OPTIONS /user HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49080 - "OPTIONS /onboarding HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49062 - "OPTIONS /user/identity HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /brains/ HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:49054 - "OPTIONS /onboarding HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49080 - "OPTIONS /user/identity HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /user HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /onboarding HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49062 - "OPTIONS /user/identity HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /user HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /user/credits HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /user/credits HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /onboarding HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49062 - "OPTIONS /user/identity HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /user HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /onboarding HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /user/identity HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49062 - "OPTIONS /user HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /onboarding HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /user/identity HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /user HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /chat HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /onboarding HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49062 - "OPTIONS /user HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:45650 - "OPTIONS /user/identity HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /brains/ HTTP/1.1" 404 Not Found
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /onboarding HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:45650 - "OPTIONS /user/identity HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:49066 - "OPTIONS /user HTTP/1.1" 200 OK
backend-core | INFO: 127.0.0.1:45450 - "GET /healthz HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:45840 - "OPTIONS /user/identity HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:45840 - "OPTIONS /user/identity HTTP/1.1" 200 OK
backend-core | INFO: 172.19.0.1:45840 - "OPTIONS /user/identity HTTP/1.1" 200 OK
It looks like the 404 errors for the /chat
and /brains/
endpoints indicate that these endpoints are not defined in your FastAPI application. You need to ensure that these endpoints are correctly implemented and registered in your FastAPI router.
Create chat_routes.py
and brain_routes.py
:
Ensure you have the following files in your backend/api/quivr_api/modules
directory:
chat_routes.py
brain_routes.py
Implement Endpoints in chat_routes.py
:
Here is an example of how you can define the /chat
endpoints:
from fastapi import APIRouter, Depends
from some_auth_module import AuthBearer # Replace with your actual auth module
from some_user_module import get_current_user, UserIdentity # Replace with your actual user module
from some_chat_service import chat_service # Replace with your actual chat service
chat_router = APIRouter()
@chat_router.post("/chat", dependencies=[Depends(AuthBearer())], tags=["Chat"])
async def create_chat(name: str, current_user: UserIdentity = Depends(get_current_user)):
"""Create a new chat."""
created_chat = chat_service.create_chat(name, current_user.id)
return {"chat": created_chat}
@chat_router.get("/chat", dependencies=[Depends(AuthBearer())], tags=["Chat"])
async def get_chats(current_user: UserIdentity = Depends(get_current_user)):
"""Retrieve all chats for the current user."""
chats = chat_service.get_chats(current_user.id)
return {"chats": chats}
@chat_router.delete("/chat/{chat_id}", dependencies=[Depends(AuthBearer())], tags=["Chat"])
async def delete_chat(chat_id: str, current_user: UserIdentity = Depends(get_current_user)):
"""Delete a specific chat."""
chat_service.delete_chat(chat_id, current_user.id)
return {"message": "Chat deleted"}
@chat_router.post("/chat/{chat_id}/question", dependencies=[Depends(AuthBearer())], tags=["Chat"])
async def add_question(chat_id: str, brain_id: str, chat_question: ChatQuestion, current_user: UserIdentity = Depends(get_current_user)):
"""Add a question to a specific chat."""
response = chat_service.add_question(chat_id, brain_id, chat_question, current_user.id)
return {"response": response}
@chat_router.get("/chat/{chat_id}/history", dependencies=[Depends(AuthBearer())], tags=["Chat"])
async def get_chat_items(chat_id: str, current_user: UserIdentity = Depends(get_current_user)):
"""Retrieve chat history for a specific chat."""
chat_items = chat_service.get_chat_items(chat_id, current_user.id)
return {"chat_items": chat_items}
@chat_router.put("/chat/{chat_id}/metadata", dependencies=[Depends(AuthBearer())], tags=["Chat"])
async def update_chat(chat_id: str, chat: ChatUpdatableProperties, current_user: UserIdentity = Depends(get_current_user)):
"""Update chat metadata."""
updated_chat = chat_service.update_chat(chat_id, chat, current_user.id)
return {"chat": updated_chat}
@chat_router.put("/chat/{chat_id}/{message_id}", dependencies=[Depends(AuthBearer())], tags=["Chat"])
async def update_chat_message(chat_id: str, message_id: str, chat_message_updatable_properties: ChatMessageUpdatableProperties, current_user: UserIdentity = Depends(get_current_user)):
"""Update a specific chat message."""
updated_message = chat_service.update_chat_message(chat_id, message_id, chat_message_updatable_properties, current_user.id)
return {"message": updated_message}
Implement Endpoints in brain_routes.py
:
Here is an example of how you can define the /brains/
endpoints:
from fastapi import APIRouter, Depends
from some_auth_module import AuthBearer # Replace with your actual auth module
from some_user_module import get_current_user, UserIdentity # Replace with your actual user module
from some_brain_service import brain_user_service # Replace with your actual brain service
brain_router = APIRouter()
@brain_router.get("/brains/", dependencies=[Depends(AuthBearer())], tags=["Brain"])
async def retrieve_all_brains_for_user(current_user: UserIdentity = Depends(get_current_user)):
"""Retrieve all brains for the current user."""
brains = brain_user_service.get_user_brains(current_user.id)
return {"brains": brains}
Register Routers in main.py
:
Ensure you register these routers in your main.py
:
from fastapi import FastAPI
from backend.api.quivr_api.modules.chat_routes import chat_router
from backend.api.quivr_api.modules.brain_routes import brain_router
app = FastAPI()
app.include_router(chat_router)
app.include_router(brain_router)
@app.get("/healthz")
def read_healthz():
return {"status": "ok"}
Update Dockerfile:
Ensure your Dockerfile
is correctly set up to copy all necessary files:
# Using a slim version for a smaller base image
FROM python:3.11.6-slim-bullseye
ARG DEV_MODE
ENV DEV_MODE=$DEV_MODE
# Install dependencies
RUN apt-get clean && apt-get update && apt-get install -y \
libgeos-dev \
libcurl4-openssl-dev \
libssl-dev \
binutils \
pandoc \
curl \
git \
poppler-utils \
tesseract-ocr \
autoconf \
automake \
build-essential \
libtool \
python-dev \
wget \
libmagic-dev \
poppler-utils \
tesseract-ocr \
libreoffice \
libpq-dev \
gcc \
pandoc && \
rm -rf /var/lib/apt/lists/*
RUN ARCHITECTURE=$(uname -m) && \
if [ "$ARCHITECTURE" = "x86_64" ]; then \
wget https://github.com/supabase/cli/releases/download/v1.163.6/supabase_1.163.6_linux_amd64.deb && \
dpkg -i supabase_1.163.6_linux_amd64.deb && \
rm supabase_1.163.6_linux_amd64.deb; \
elif [ "$ARCHITECTURE" = "aarch64" ]; then \
wget https://github.com/supabase/cli/releases/download/v1.163.6/supabase_1.163.6_linux_arm64.deb && \
dpkg -i supabase_1.163.6_linux_arm64.deb && \
rm supabase_1.163.6_linux_arm64.deb; \
fi && \
rm -rf /var/lib/apt/lists/*
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
# Add Rust binaries to the PATH
ENV PATH="/root/.cargo/bin:${PATH}" \
POETRY_CACHE_DIR=/tmp/poetry_cache \
PYTHONDONTWRITEBYTECODE=1
WORKDIR /code
# Copy monorepo dependencies
# CORE
COPY core/pyproject.toml core/README.md core/poetry.lock /code/core/
COPY core/quivr_core /code/core/quivr_core
# API
COPY api/pyproject.toml api/poetry.lock api/README.md /code/api/
COPY api/quivr_api /code/api/quivr_api
COPY ./pyproject.toml ./poetry.lock* /code/
COPY ./ci-migration.sh /code/
COPY supabase /code/supabase/
# Copy main.py and celery_worker.py
COPY main.py /code/
COPY celery_worker.py /code/
# Run install
RUN poetry install --no-root --with dev,test && \
playwright install --with-deps && \
rm -rf $POETRY_CACHE_DIR
ENV PYTHONPATH=/code
EXPOSE 5050
# Set the entry point for the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5050"]
By defining and registering these endpoints, the backend service should be able to handle the requests to /chat
and /brains/
without returning 404 errors [1][2].
If you still encounter issues, it might be helpful to loop in a maintainer for further assistance. This is a tough nut to crack, could really use your help on this, @StanGirard.
To continue talking to Dosu, mention @dosu.
Other errors now: @dosu
backend-core | return _bootstrap._gcd_import(name[level:], package, level)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
backend-core | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
backend-core | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
backend-core | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
backend-core | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
backend-core | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
backend-core | File "/code/main.py", line 2, in <module>
backend-core | from backend.api.quivr_api.modules.chat_routes import chat_router
backend-core | ModuleNotFoundError: No module named 'backend'
backend-core | Process SpawnProcess-38:
backend-core | Traceback (most recent call last):
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
backend-core | self.run()
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
backend-core | self._target(*self._args, **self._kwargs)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
backend-core | target(sockets=sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/supervisors/multiprocess.py", line 63, in target
backend-core | return self.real_target(sockets)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
backend-core | return asyncio.run(self.serve(sockets=sockets))
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
backend-core | return runner.run(main)
backend-core | ^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
backend-core | return self._loop.run_until_complete(task)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
backend-core | await self._serve(sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
backend-core | config.load()
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
backend-core | self.loaded_app = import_from_string(self.app)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 22, in import_from_string
backend-core | raise exc from None
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
backend-core | module = importlib.import_module(module_str)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
backend-core | return _bootstrap._gcd_import(name[level:], package, level)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
backend-core | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
backend-core | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
backend-core | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
backend-core | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
backend-core | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
backend-core | File "/code/main.py", line 2, in <module>
backend-core | from backend.api.quivr_api.modules.chat_routes import chat_router
backend-core | ModuleNotFoundError: No module named 'backend'
backend-core | Process SpawnProcess-37:
backend-core | Traceback (most recent call last):
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
backend-core | self.run()
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
backend-core | self._target(*self._args, **self._kwargs)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
backend-core | target(sockets=sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/supervisors/multiprocess.py", line 63, in target
backend-core | return self.real_target(sockets)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
backend-core | return asyncio.run(self.serve(sockets=sockets))
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
backend-core | return runner.run(main)
backend-core | ^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
backend-core | return self._loop.run_until_complete(task)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
backend-core | await self._serve(sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
backend-core | config.load()
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
backend-core | self.loaded_app = import_from_string(self.app)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 22, in import_from_string
backend-core | raise exc from None
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
backend-core | module = importlib.import_module(module_str)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
backend-core | return _bootstrap._gcd_import(name[level:], package, level)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
backend-core | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
backend-core | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
backend-core | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
backend-core | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
backend-core | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
backend-core | File "/code/main.py", line 2, in <module>
backend-core | from backend.api.quivr_api.modules.chat_routes import chat_router
backend-core | ModuleNotFoundError: No module named 'backend'
backend-core | INFO: Waiting for child process [51]
backend-core | INFO: Child process [51] died
backend-core | INFO: Waiting for child process [63]
backend-core | INFO: Child process [63] died
backend-core | INFO: Waiting for child process [72]
backend-core | INFO: Child process [72] died
backend-core | Process SpawnProcess-39:
backend-core | Traceback (most recent call last):
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
backend-core | self.run()
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
backend-core | self._target(*self._args, **self._kwargs)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
backend-core | target(sockets=sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/supervisors/multiprocess.py", line 63, in target
backend-core | return self.real_target(sockets)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
backend-core | return asyncio.run(self.serve(sockets=sockets))
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
backend-core | return runner.run(main)
backend-core | ^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
backend-core | return self._loop.run_until_complete(task)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
backend-core | await self._serve(sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
backend-core | config.load()
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
backend-core | self.loaded_app = import_from_string(self.app)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 22, in import_from_string
backend-core | raise exc from None
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
backend-core | module = importlib.import_module(module_str)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
backend-core | return _bootstrap._gcd_import(name[level:], package, level)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
backend-core | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
backend-core | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
backend-core | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
backend-core | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
backend-core | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
backend-core | File "/code/main.py", line 2, in <module>
backend-core | from backend.api.quivr_api.modules.chat_routes import chat_router
backend-core | ModuleNotFoundError: No module named 'backend'
backend-core | Process SpawnProcess-41:
backend-core | Traceback (most recent call last):
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
backend-core | self.run()
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
backend-core | self._target(*self._args, **self._kwargs)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
backend-core | target(sockets=sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/supervisors/multiprocess.py", line 63, in target
backend-core | return self.real_target(sockets)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
backend-core | return asyncio.run(self.serve(sockets=sockets))
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
backend-core | return runner.run(main)
backend-core | ^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
backend-core | return self._loop.run_until_complete(task)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
backend-core | await self._serve(sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
backend-core | config.load()
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
backend-core | self.loaded_app = import_from_string(self.app)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 22, in import_from_string
backend-core | raise exc from None
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
backend-core | module = importlib.import_module(module_str)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
backend-core | return _bootstrap._gcd_import(name[level:], package, level)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
backend-core | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
backend-core | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
backend-core | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
backend-core | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
backend-core | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
backend-core | File "/code/main.py", line 2, in <module>
backend-core | from backend.api.quivr_api.modules.chat_routes import chat_router
backend-core | ModuleNotFoundError: No module named 'backend'
backend-core | Process SpawnProcess-40:
backend-core | Traceback (most recent call last):
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
backend-core | self.run()
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
backend-core | self._target(*self._args, **self._kwargs)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
backend-core | target(sockets=sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/supervisors/multiprocess.py", line 63, in target
backend-core | return self.real_target(sockets)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
backend-core | return asyncio.run(self.serve(sockets=sockets))
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
backend-core | return runner.run(main)
backend-core | ^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
backend-core | return self._loop.run_until_complete(task)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
backend-core | await self._serve(sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
backend-core | config.load()
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
backend-core | self.loaded_app = import_from_string(self.app)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 22, in import_from_string
backend-core | raise exc from None
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
backend-core | module = importlib.import_module(module_str)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
backend-core | return _bootstrap._gcd_import(name[level:], package, level)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
backend-core | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
backend-core | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
backend-core | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
backend-core | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
backend-core | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
backend-core | File "/code/main.py", line 2, in <module>
backend-core | from backend.api.quivr_api.modules.chat_routes import chat_router
backend-core | ModuleNotFoundError: No module named 'backend'
backend-core | INFO: Waiting for child process [75]
backend-core | INFO: Child process [75] died
backend-core | INFO: Waiting for child process [77]
backend-core | INFO: Child process [77] died
backend-core | INFO: Waiting for child process [78]
backend-core | INFO: Child process [78] died
backend-core | Process SpawnProcess-44:
backend-core | Traceback (most recent call last):
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
backend-core | self.run()
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
backend-core | self._target(*self._args, **self._kwargs)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
backend-core | target(sockets=sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/supervisors/multiprocess.py", line 63, in target
backend-core | return self.real_target(sockets)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
backend-core | return asyncio.run(self.serve(sockets=sockets))
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
backend-core | return runner.run(main)
backend-core | ^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
backend-core | return self._loop.run_until_complete(task)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
backend-core | await self._serve(sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
backend-core | config.load()
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
backend-core | self.loaded_app = import_from_string(self.app)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 22, in import_from_string
backend-core | raise exc from None
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
backend-core | module = importlib.import_module(module_str)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
backend-core | return _bootstrap._gcd_import(name[level:], package, level)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
backend-core | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
backend-core | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
backend-core | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
backend-core | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
backend-core | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
backend-core | File "/code/main.py", line 2, in <module>
backend-core | from backend.api.quivr_api.modules.chat_routes import chat_router
backend-core | ModuleNotFoundError: No module named 'backend'
backend-core | Process SpawnProcess-43:
backend-core | Traceback (most recent call last):
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
backend-core | self.run()
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
backend-core | self._target(*self._args, **self._kwargs)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
backend-core | target(sockets=sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/supervisors/multiprocess.py", line 63, in target
backend-core | return self.real_target(sockets)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
backend-core | return asyncio.run(self.serve(sockets=sockets))
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
backend-core | return runner.run(main)
backend-core | ^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
backend-core | return self._loop.run_until_complete(task)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
backend-core | await self._serve(sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
backend-core | config.load()
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
backend-core | self.loaded_app = import_from_string(self.app)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 22, in import_from_string
backend-core | raise exc from None
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
backend-core | module = importlib.import_module(module_str)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
backend-core | return _bootstrap._gcd_import(name[level:], package, level)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
backend-core | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
backend-core | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
backend-core | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
backend-core | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
backend-core | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
backend-core | File "/code/main.py", line 2, in <module>
backend-core | from backend.api.quivr_api.modules.chat_routes import chat_router
backend-core | ModuleNotFoundError: No module named 'backend'
backend-core | Process SpawnProcess-42:
backend-core | Traceback (most recent call last):
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
backend-core | self.run()
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
backend-core | self._target(*self._args, **self._kwargs)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
backend-core | target(sockets=sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/supervisors/multiprocess.py", line 63, in target
backend-core | return self.real_target(sockets)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
backend-core | return asyncio.run(self.serve(sockets=sockets))
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
backend-core | return runner.run(main)
backend-core | ^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
backend-core | return self._loop.run_until_complete(task)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
backend-core | await self._serve(sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
backend-core | config.load()
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
backend-core | self.loaded_app = import_from_string(self.app)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 22, in import_from_string
backend-core | raise exc from None
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
backend-core | module = importlib.import_module(module_str)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
backend-core | return _bootstrap._gcd_import(name[level:], package, level)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
backend-core | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
backend-core | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
backend-core | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
backend-core | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
backend-core | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
backend-core | File "/code/main.py", line 2, in <module>
backend-core | from backend.api.quivr_api.modules.chat_routes import chat_router
backend-core | ModuleNotFoundError: No module named 'backend'
backend-core | INFO: Waiting for child process [63]
backend-core | INFO: Child process [63] died
backend-core | INFO: Waiting for child process [75]
backend-core | INFO: Child process [75] died
backend-core | INFO: Waiting for child process [78]
backend-core | INFO: Child process [78] died
backend-core | INFO: Waiting for child process [85]
backend-core | INFO: Child process [85] died
backend-core | Process SpawnProcess-47:
backend-core | Traceback (most recent call last):
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
backend-core | self.run()
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
backend-core | self._target(*self._args, **self._kwargs)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
backend-core | target(sockets=sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/supervisors/multiprocess.py", line 63, in target
backend-core | return self.real_target(sockets)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
backend-core | return asyncio.run(self.serve(sockets=sockets))
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
backend-core | return runner.run(main)
backend-core | ^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
backend-core | return self._loop.run_until_complete(task)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
backend-core | await self._serve(sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
backend-core | config.load()
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
backend-core | self.loaded_app = import_from_string(self.app)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 22, in import_from_string
backend-core | raise exc from None
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
backend-core | module = importlib.import_module(module_str)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
backend-core | return _bootstrap._gcd_import(name[level:], package, level)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
backend-core | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
backend-core | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
backend-core | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
backend-core | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
backend-core | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
backend-core | File "/code/main.py", line 2, in <module>
backend-core | from backend.api.quivr_api.modules.chat_routes import chat_router
backend-core | ModuleNotFoundError: No module named 'backend'
backend-core | Process SpawnProcess-48:
backend-core | Process SpawnProcess-46:
backend-core | Traceback (most recent call last):
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
backend-core | self.run()
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
backend-core | self._target(*self._args, **self._kwargs)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
backend-core | target(sockets=sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/supervisors/multiprocess.py", line 63, in target
backend-core | return self.real_target(sockets)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
backend-core | return asyncio.run(self.serve(sockets=sockets))
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
backend-core | return runner.run(main)
backend-core | ^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
backend-core | return self._loop.run_until_complete(task)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
backend-core | await self._serve(sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
backend-core | config.load()
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
backend-core | self.loaded_app = import_from_string(self.app)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 22, in import_from_string
backend-core | raise exc from None
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
backend-core | module = importlib.import_module(module_str)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
backend-core | return _bootstrap._gcd_import(name[level:], package, level)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
backend-core | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
backend-core | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
backend-core | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
backend-core | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
backend-core | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
backend-core | File "/code/main.py", line 2, in <module>
backend-core | from backend.api.quivr_api.modules.chat_routes import chat_router
backend-core | ModuleNotFoundError: No module named 'backend'
backend-core | Traceback (most recent call last):
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
backend-core | self.run()
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
backend-core | self._target(*self._args, **self._kwargs)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
backend-core | target(sockets=sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/supervisors/multiprocess.py", line 63, in target
backend-core | return self.real_target(sockets)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
backend-core | return asyncio.run(self.serve(sockets=sockets))
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
backend-core | return runner.run(main)
backend-core | ^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
backend-core | return self._loop.run_until_complete(task)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
backend-core | await self._serve(sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
backend-core | config.load()
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
backend-core | self.loaded_app = import_from_string(self.app)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 22, in import_from_string
backend-core | raise exc from None
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
backend-core | module = importlib.import_module(module_str)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
backend-core | return _bootstrap._gcd_import(name[level:], package, level)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
backend-core | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
backend-core | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
backend-core | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
backend-core | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
backend-core | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
backend-core | File "/code/main.py", line 2, in <module>
backend-core | from backend.api.quivr_api.modules.chat_routes import chat_router
backend-core | ModuleNotFoundError: No module named 'backend'
backend-core | Process SpawnProcess-45:
backend-core | Traceback (most recent call last):
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
backend-core | self.run()
backend-core | File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run
backend-core | self._target(*self._args, **self._kwargs)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
backend-core | target(sockets=sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/supervisors/multiprocess.py", line 63, in target
backend-core | return self.real_target(sockets)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
backend-core | return asyncio.run(self.serve(sockets=sockets))
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
backend-core | return runner.run(main)
backend-core | ^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
backend-core | return self._loop.run_until_complete(task)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
backend-core | await self._serve(sockets)
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
backend-core | config.load()
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
backend-core | self.loaded_app = import_from_string(self.app)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 22, in import_from_string
backend-core | raise exc from None
backend-core | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
backend-core | module = importlib.import_module(module_str)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
backend-core | return _bootstrap._gcd_import(name[level:], package, level)
backend-core | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core | File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
backend-core | File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
backend-core | File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
backend-core | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
backend-core | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
backend-core | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
backend-core | File "/code/main.py", line 2, in <module>
backend-core | from backend.api.quivr_api.modules.chat_routes import chat_router
backend-core | ModuleNotFoundError: No module named 'backend'
The ModuleNotFoundError: No module named 'backend'
error indicates that the backend
module is not being found in the Python path. This is likely due to the way the Docker container is set up and how the Python path is configured.
Here are the steps to resolve this issue:
Make sure your project directory structure is correct and includes all necessary files:
quivr/
├── backend/
│ ├── api/
│ │ ├── quivr_api/
│ │ │ ├── modules/
│ │ │ │ ├── chat_routes.py
│ │ │ │ ├── brain_routes.py
│ │ │ └── __init__.py
│ │ └── __init__.py
│ ├── core/
│ ├── Dockerfile
│ ├── Dockerfile.dev
│ ├── poetry.lock
│ ├── poetry.toml
│ ├── pyproject.toml
│ ├── supabase/
│ ├── main.py
│ └── celery_worker.py
├── docker-compose.yml
└── other_files...
main.py
Ensure your main.py
correctly imports the modules:
from fastapi import FastAPI
from backend.api.quivr_api.modules.chat_routes import chat_router
from backend.api.quivr_api.modules.brain_routes import brain_router
app = FastAPI()
app.include_router(chat_router)
app.include_router(brain_router)
@app.get("/healthz")
def read_healthz():
return {"status": "ok"}
PYTHONPATH
Environment VariableEnsure that the PYTHONPATH
environment variable is set correctly in your Docker container. You can do this by adding it to your docker-compose.yml
file or directly in the Dockerfile.
PYTHONPATH
in docker-compose.yml
Add the PYTHONPATH
environment variable to the backend-core
service in your docker-compose.yml
:
version: "3.8"
services:
backend-core:
build:
context: backend
dockerfile: Dockerfile
container_name: backend-core
environment:
- PYTHONPATH=/code
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: [ "CMD", "curl", "http://localhost:5050/healthz" ]
command:
- "uvicorn"
- "main:app"
- "--host"
- "0.0.0.0"
- "--port"
- "5050"
- "--workers"
- "6"
restart: always
volumes:
- ./backend/:/code/
ports:
- 5050:5050
# Other services...
PYTHONPATH
in DockerfileAdd the PYTHONPATH
environment variable to your Dockerfile:
# Using a slim version for a smaller base image
FROM python:3.11.6-slim-bullseye
ARG DEV_MODE
ENV DEV_MODE=$DEV_MODE
# Install dependencies
RUN apt-get clean && apt-get update && apt-get install -y \
libgeos-dev \
libcurl4-openssl-dev \
libssl-dev \
binutils \
pandoc \
curl \
git \
poppler-utils \
tesseract-ocr \
autoconf \
automake \
build-essential \
libtool \
python-dev \
wget \
libmagic-dev \
poppler-utils \
tesseract-ocr \
libreoffice \
libpq-dev \
gcc \
pandoc && \
rm -rf /var/lib/apt/lists/*
RUN ARCHITECTURE=$(uname -m) && \
if [ "$ARCHITECTURE" = "x86_64" ]; then \
wget https://github.com/supabase/cli/releases/download/v1.163.6/supabase_1.163.6_linux_amd64.deb && \
dpkg -i supabase_1.163.6_linux_amd64.deb && \
rm supabase_1.163.6_linux_amd64.deb; \
elif [ "$ARCHITECTURE" = "aarch64" ]; then \
wget https://github.com/supabase/cli/releases/download/v1.163.6/supabase_1.163.6_linux_arm64.deb && \
dpkg -i supabase_1.163.6_linux_arm64.deb && \
rm supabase_1.163.6_linux_arm64.deb; \
fi && \
rm -rf /var/lib/apt/lists/*
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
# Add Rust binaries to the PATH
ENV PATH="/root/.cargo/bin:${PATH}" \
POETRY_CACHE_DIR=/tmp/poetry_cache \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONPATH=/code
WORKDIR /code
# Copy monorepo dependencies
# CORE
COPY core/pyproject.toml core/README.md core/poetry.lock /code/core/
COPY core/quivr_core /code/core/quivr_core
# API
COPY api/pyproject.toml api/poetry.lock api/README.md /code/api/
COPY api/quivr_api /code/api/quivr_api
COPY ./pyproject.toml ./poetry.lock* /code/
COPY ./ci-migration.sh /code/
COPY supabase /code/supabase/
# Copy main.py and celery_worker.py
COPY main.py /code/
COPY celery_worker.py /code/
# Run install
RUN poetry install --no-root --with dev,test && \
playwright install --with-deps && \
rm -rf $POETRY_CACHE_DIR
EXPOSE 5050
# Set the entry point for the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5050"]
After making these changes, rebuild your Docker images and restart the containers:
docker-compose down
docker-compose up --build
By ensuring the PYTHONPATH
is correctly set and the directory structure is correct, the backend-core
service should be able to find the backend
module and start without errors [1].
If you still encounter issues, it might be helpful to loop in a maintainer for further assistance. This is a tough nut to crack, could really use your help on this, @StanGirard.
To continue talking to Dosu, mention @dosu.
I don't think is gonna work, tried all what you said. Cann you give me step by step all commands with dependencies from scratch ubuntu to build Quivr? @dosu
To build and run Quivr from scratch on a fresh Ubuntu installation, follow these detailed steps:
Install Supabase CLI: Follow the instructions here to install the Supabase CLI.
supabase -v # Check that the installation worked
Update your package list:
sudo apt-get update
Install Docker:
sudo apt-get install -y docker.io
Install Docker Compose:
sudo apt-get install -y docker-compose
Start and enable Docker service:
sudo systemctl start docker
sudo systemctl enable docker
Add your user to the Docker group (to avoid using sudo
with Docker commands):
sudo usermod -aG docker $USER
newgrp docker
Clone the repository:
git clone https://github.com/quivrhq/quivr.git && cd quivr
Copy the .env.example
file to .env
:
cp .env.example .env
Update the .env
file:
vim .env # or use nano, emacs, or vscode
Update the OPENAI_API_KEY
variable in the .env
file. You can get your API key here.
Want to use Ollama.ai instead? Uncomment the following lines in the
.env
file: OLLAMA_API_BASE_URL Run the following command to start Ollama:ollama run llama2
You can find more information about Ollama here.
Install additional dependencies required for document handling:
sudo apt-get install -y libgeos-dev libcurl4-openssl-dev libssl-dev binutils curl git autoconf automake build-essential libtool python-dev libmagic-dev poppler-utils tesseract-ocr libreoffice libpq-dev gcc pandoc
Start Supabase:
cd backend && supabase start
Pull and start Docker containers:
cd ../
docker compose pull
docker compose up
If you are a developer, you can run the project in development mode with the following command:
docker compose -f docker-compose.dev.yml up --build
Login to the app:
You can now sign in to the app with admin@quivr.app
& admin
. Access the app at http://localhost:3000/login.
Access Quivr backend API: http://localhost:5050/docs
Access Supabase: http://localhost:54323
By following these steps, you should have Quivr up and running on your fresh Ubuntu installation. For more detailed information, you can refer to the documentation [1][2][3].
To continue talking to Dosu, mention @dosu.
I also had that issue. After running docker compose -f docker-compose.dev.yml up --build
it worked...
I tried this command too, but i had no luck.
What happened?
Issue: Installation of Quivr Failing Due to Missing
backend-base:latest
ImageHello,
I encountered an issue while trying to install Quivr on a fresh installation of POP!_OS and Ubuntu. Both attempts failed at the same point: Docker could not find the
backend-base:latest
image.Steps Taken
No such image: backend-base:latest
.Question
Is there an alternative way to install Quivr or a workaround for this issue? Any guidance or updated instructions would be greatly appreciated.
Thank you!
Relevant log output
Twitter / LinkedIn details
No response