So i wanted to run a function, tho i don't have any body on this one, and when executing, i got an error 500.
Code:
const client = new AppwriteClient()
.setEndpoint(process.env.APPWRITE_FUNCTION_API_ENDPOINT)
.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
const functions = new Functions(client);
const f = await functions.createExecution("67d8394c0038d8f14c00", null, false);
SDK Error:
AppwriteException: Server Error
at _Client.call (file://<file>)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async handler (file://<file>) {
code: 500,
type: 'general_unknown',
response: '{"message":"Server Error","code":500,"type":"general_unknown","version":"1.6.1"}'
}
API/Server Error:
2025-03-17T16:46:20.244116082Z [Error] Timestamp: 2025-03-17T16:46:20+00:00
2025-03-17T16:46:20.244211771Z [Error] Method: POST
2025-03-17T16:46:20.244232189Z [Error] URL: /v1/functions/:functionId/executions
2025-03-17T16:46:20.244237238Z [Error] Type: TypeError
2025-03-17T16:46:20.244242228Z [Error] Message: {closure}(): Argument #2 ($body) must be of type string, null given, called in /usr/src/code/vendor/utopia-php/framework/src/App.php on line 607
2025-03-17T16:46:20.244247346Z [Error] File: /usr/src/code/app/controllers/api/functions.php
2025-03-17T16:46:20.244252145Z [Error] Line: 1768
After a look, i changed the body from null to "" and it worked, tho i think there is some missing checks (convert null body to something, prevent null in the SDK, better SDK error description)
Recommended threads
- TablesDB `updateRows` returns `database_...
Hi Appwrite team! I’m seeing a strange issue with TablesDB bulk row updates on a self-hosted Appwrite instance. **Environment** - Appwrite self-hosted `1.9.0` ...
- [SOLVED] Realtime Missing Channels
```js useEffect(() => { let subscription: RealtimeSubscription; async function loadChips() { try { const {rows: chi...
- Functions executed by events does not ap...
Hello, Running self-hosted Appwrite version 1.9.0 (with console 7.8.26). When functions are triggered by an event (eg. databases.\*tables.\*.rows.\*.create) doe...