Back

[SOLVED] How to configure function to receive external webhook

  • 0
  • Self Hosted
  • Functions
rohan
3 Nov, 2023, 18:53

this what i needed thanks 🙂

TL;DR
Solution: The user was having issues with configuring their function to receive an external webhook. The issue was due to misconfiguration of the `_APP_DOMAIN_FUNCTIONS` environment variable and the custom domain. The user didn't have the source code and was using a fresh Node.js starter template. They checked the executions tab and confirmed that the function was not triggering any execution. It was suggested that there might be something wrong with the function code itself. The user mentioned that they didn't need a certificate because they were already reverse proxying. It was confirmed that the error message was related to the domain not being connected to any Appwrite resource yet and advised
rohan
3 Nov, 2023, 18:58

What will be the execution permission for domain based functions?

Drake
3 Nov, 2023, 21:50

you'll have to grant everyone access

rohan
4 Nov, 2023, 16:04

@Steven i created a custom domain for my function and also given public access

rohan
4 Nov, 2023, 16:05

still im getting this error

Drake
4 Nov, 2023, 16:15

Is this on cloud?

rohan
4 Nov, 2023, 16:15

self hosted

rohan
4 Nov, 2023, 16:15

this is the error

TypeScript
[Error] Timestamp: 2023-11-04T16:14:40+00:00
[Error] Method: POST
[Error] URL: /v1/functions/:functionId/executions
[Error] Type: Appwrite\Extend\Exception
[Error] Message: This domain is not connected to any Appwrite resource yet. Please configure custom domain or function domain to allow this request.
[Error] File: /usr/src/code/app/controllers/general.php
[Error] Line: 67
Warning: Trying to access array offset on value of type null in /usr/src/code/app/controllers/general.php on line 158
[Error] Timestamp: 2023-11-04T16:14:40+00:00
[Error] Method: GET
[Error] URL: /console/*
[Error] Type: Appwrite\Extend\Exception
[Error] Message: Execution error: 
[Error] File: /usr/src/code/app/controllers/general.php
[Error] Line: 159
rohan
4 Nov, 2023, 16:16

this is the domain status

Drake
4 Nov, 2023, 16:17

What version of Appwrite?

rohan
4 Nov, 2023, 16:17

1.4.9

Drake
4 Nov, 2023, 16:18

This is in the function?

rohan
4 Nov, 2023, 16:18

yes

rohan
4 Nov, 2023, 16:18

but i dont need certificate bec im already reverse proxying

Drake
4 Nov, 2023, 16:20

Maybe something is wrong with your function. What's your function code?

rohan
4 Nov, 2023, 16:21

its just starter node js template

Drake
4 Nov, 2023, 16:21

Share please.

Also this function was created after upgrading to 1.4, right?

rohan
4 Nov, 2023, 16:22

yes it was

Drake
4 Nov, 2023, 16:22

Do you see anything in the executions tab?

rohan
4 Nov, 2023, 16:22
rohan
4 Nov, 2023, 16:22

its not trigerring any execution

rohan
4 Nov, 2023, 16:23

i dont have the source code.. i just uploaded it and deleted.. its just fresh node js starter template

Drake
4 Nov, 2023, 16:25

Something is wrong with the _APP_DOMAIN_FUNCTIONS env var you set and the custom domain you added. Are they the same/similar?

rohan
4 Nov, 2023, 16:29

oh my bad.. it was configured wrongly

Drake
4 Nov, 2023, 18:18

[SOLVED] How to configure function to receive external webhook

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more