Back

[Solved]Functions are failing

  • 0
  • Functions
  • Web
Drake
23 Oct, 2023, 02:53

ooh that res.send at the end should be context.res.send()

TL;DR
The functions were failing because there was an issue with the website. The problem was that the documentation was not updated properly. The solution is to delete the old function and create a new one with the same ID. Alternatively, you can create a completely new function. Make sure to use the new syntax for the updated function. There is no migration path specified, so you need to manually recreate the function. The user encountered a timeout error but resolved it by changing the code and using `context.res.send()` instead of `res.send()`.
Drake
23 Oct, 2023, 02:56

btw i tested this (w/ the context.res.send() at the end) and it worked

Ajit Singh
23 Oct, 2023, 02:59

Yeah I changed that

Ajit Singh
23 Oct, 2023, 02:59

If it is working that is in exception

Ajit Singh
23 Oct, 2023, 03:00

if it works than the code need not go into the expception

Ajit Singh
23 Oct, 2023, 03:00

It still gives me An internal curl error has occurred within the executor! Error Msg: Operation timed out\nError Code: 500

Ajit Singh
23 Oct, 2023, 03:23

So what I did is I created a new function

Ajit Singh
23 Oct, 2023, 03:23

put everything same in my new and old function

Ajit Singh
23 Oct, 2023, 03:24

new function runs old function fails

Ajit Singh
23 Oct, 2023, 03:24

Do I have to create a new function and discard old functions

Drake
23 Oct, 2023, 03:28

What do you mean by old function? Was the function created before 1.4?

Ajit Singh
23 Oct, 2023, 03:28

yes

Ajit Singh
23 Oct, 2023, 03:28

when cloud was at 1.1.2

Ajit Singh
23 Oct, 2023, 03:29

Is there a migration path I missed

Ajit Singh
23 Oct, 2023, 03:29

I chnged the code inside the function

Drake
23 Oct, 2023, 03:30

In that case it still uses the old syntax. In order to use the new syntax, you must recreate the function

Ajit Singh
23 Oct, 2023, 03:30

So I have to create a new function

Ajit Singh
23 Oct, 2023, 03:30

Delete the old function right

Drake
23 Oct, 2023, 03:31

If you want to have the same ID, you can delete the old function and create the new one with the same id. Otherwise, just create a new function

Ajit Singh
23 Oct, 2023, 03:32

Okay I need the same id

Ajit Singh
23 Oct, 2023, 03:32

I'll work on it

Ajit Singh
23 Oct, 2023, 03:32

but there should be a migration path defined some where when cloud is updated

Ajit Singh
23 Oct, 2023, 03:47

Thanks

Ajit Singh
29 Oct, 2023, 11:50

[Solved]Functions are failing

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