Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

**Bug: Database Conflict When PraisonAI Detects Supabase/Postgres in Production Environments** #335

Open
jimboswankster opened this issue Jan 24, 2025 · 0 comments

Comments

@jimboswankster
Copy link

Title:

Bug: Database Conflict When PraisonAI Detects Supabase/Postgres in Production Environments


Description:

Issue:

When using PraisonAI in environments where a .env file includes credentials for Supabase or PostgreSQL (e.g., production setups), PraisonAI prioritizes these databases over SQLite. This behavior causes schema conflicts, particularly with the users table, as PraisonAI expects a different schema than most production applications.

Impact:

  • Data Integrity Risks: Production databases may be unintentionally modified.
  • Tool Inaccessibility: The tool cannot be used without modifying .env or isolating it in a separate environment.
  • Data Safety This is a necessary feature for data security and safety during production.
  • Separation of concerns keep the real db safe, while working with the praisonAi [code] tool.

Steps to Reproduce:

  1. Configure a .env file with Supabase or PostgreSQL connection strings.
  2. Run PraisonAI in a project where the database schema conflicts with the tool (e.g., a production app with different users table requirements).
  3. Observe schema conflicts and resulting errors.

Suggested Solution:

A feature was added in [Pull Request #<PR_NUMBER>](<PR_LINK>) to introduce a FORCE_SQLITE toggle. This toggle bypasses Supabase/Postgres detection and forces the tool to use SQLite, ensuring isolation from production databases.


Workaround:

Before this feature is merged, users can manually:

  1. Patch the db.py file to skip Supabase/Postgres detection and enforce SQLite usage.
  2. Use the patch provided in the codePatches directory of the pull request.

Linked Resources:


Request for Maintainers:

Consider merging the feature in Pull Request: #334 and adding documentation for users who might encounter similar issues.
Let me know if there are any additional adjustments you'd like me to make! It is my opinion that this would be well suited for a centralized config file where the user can select whichever database they want used instead of having auto-detect, or in addition to having autodetect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant