Currently have this, but am getting an error saying 'Internal Runtime Error'
TypeScript
from appwrite.client import Client
from appwrite.services.databases import Databases
def main(req, res):
client = Client()
(client
.set_endpoint(endpoint)
.set_project(id)
.set_key(api key)
)
databases = Databases(client)
result = databases.list_collections(collection_id)
send = []
for i in result['collections']:
send.append(i['$id'])
return res.json({"collections": send})
TL;DR
The code appears to be a Python function to list all collections using the Appwrite service. The user is getting an 'Internal Runtime Error' while running the code. The error might be due to missing or incorrect values for endpoints, project ID, and API key. There is no mention of a solution in the thread.can you confirm that the appwrite service is up and running?
And btw, list_collections takes db Id as argument
Recommended threads
- Function executions fail with cURL error...
Appwrite version: 1.8.0 Executor version: 0.11.4 Function runtime: Python 3.12 SELF-HOSTED Function executions that occur at the same moment as the executor's ...
- Broken Appwrite can’t make functions nor...
Hii guys, I was having this issue with my locally hosted Appwrite, I can’t create functions ( both template and manual), I can’t make a custom domain ( like in ...
- Tips for Debugging Appwrite Functions Lo...
Hi everyone! 👋 I have an Appwrite Function running locally with Docker, but I’m struggling to debug it because execution doesn’t reach the breakpoints I set. ...