403 Forbidden Error When Accessing Replit DB from a Python Script

Hello, Replit community!

I’ve encountered a 403 Forbidden error when trying to run my Discord bot that interacts with the Replit database. The error occurs when attempting to import and use the db from replit in my Python script.

Here’s the error message that appears in the console:

Traceback (most recent call last): File "/home/runner/MagicBot/main.py", line 4, in <module> from replit import db File "/home/runner/MagicBot/.pythonlibs/lib/python3.10/site-packages/replit/__init__.py", line 5, in <module> from . import web File "/home/runner/MagicBot/.pythonlibs/lib/python3.10/site-packages/replit/web/__init__.py", line 9, in <module> from .app import debug, ReplitAuthContext, run File "/home/runner/MagicBot/.pythonlibs/lib/python3.10/site-packages/replit/web/app.py", line 7, in <module> from ..database.database import ObservedDict, ObservedList, DBJSONEncoder File "/home/runner/MagicBot/.pythonlibs/lib/python3.10/site-packages/replit/database/__init__.py", line 3, in <module> from .default_db import db, db_url File "/home/runner/MagicBot/.pythonlibs/lib/python3.10/site-packages/replit/database/default_db.py", line 40, in <module> if db: File "/home/runner/MagicBot/.pythonlibs/lib/python3.10/site-packages/replit/database/database.py", line 581, in __len__ return len(self.prefix("")) File "/home/runner/MagicBot/.pythonlibs/lib/python3.10/site-packages/replit/database/database.py", line 593, in prefix r.raise_for_status() File "/home/runner/MagicBot/.pythonlibs/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://kv.replit.com/v0/the_url_secret_part_went_here?prefix=&encode=true

I’ve checked that my REPLIT_DB_URL is set correctly in the secrets. I’ve also made sure I’m logged into the correct Replit account that owns the database. The error persists, and I’m unsure how to resolve it. I’m using the latest version of the Replit database client library (Version: 3.3.2) and haven’t made any recent changes to the code that could have led to this issue.

Has anyone else experienced this, or does anyone have insights into what might be causing the error and how to fix it?

Any help or suggestions would be greatly appreciated!

Here’s the link to the repl: https://replit.com/@livinglikemike/MagicBot?v=1

When I click on the link it takes me to a 404 error so idk