troubleshooting.md
October 1, 2024 ยท View on GitHub
General Troubleshooting Steps
- Ensure Latest Release: Always start with the latest release from the Cohere toolkit releases or the latest commit on the main branch.
Common Issues
-
Community Features Not Accessible:
- Add
USE_COMMUNITY_FEATURES=Trueto your.envfile.
- Add
-
Multiple Errors After Running
make devfor the First Time:- Run
make migratebefore executingmake dev.
- Run
-
Error Installing
psycopg2:- If you encounter an error related to PEP 517 builds, replace
psycopg2withpsycopg2-binaryinpyproject.toml.
- If you encounter an error related to PEP 517 builds, replace
-
pg_configExecutable Not Found:- Ensure PostgreSQL is installed properly. For MacOS, use:
brew install postgresql - Check PostgreSQL documentation for other OS instructions.
- Ensure PostgreSQL is installed properly. For MacOS, use:
-
Platform Mismatch Error:
- Add the following to your
docker_compose.yml:terrarium: platform: linux/amd64 image: ghcr.io/cohere-ai/terrarium:latest ports: - '8080:8080' expose: - '8080'
- Add the following to your
-
Debugging Locally:
- Run
make devto start the Docker containers with reloading enabled. - In a separate shell, execute
make attachto attach an interactive shell for debugging. - Use
import pdb; pdb.set_trace()in your code for debugging.
- Run
-
Alembic Migrations Out of Sync Error:
- If migrations diverge due to changes in different branches:
- Downgrade your local branch:
docker compose run --build backend alembic -c src/backend/alembic.ini downgrade -1 - Delete the out-of-sync migration file (e.g.,
<my_migration_id>.py). - Run
make migrateto sync with the main branch. - Regenerate your migrations:
make migration message="Your migration changes"
- Downgrade your local branch:
- If migrations diverge due to changes in different branches: