I upgraded from 1.3.8 to 1.4.5 using the official commands (upgrade + migrate). My functions started not executing when my app calls them.
I figured all the updates I had to do (btw a migration guide would have been super useful, it's barely indicated in the documentation....)
Here is my function code now (a snippet) :
import datetime
import json
import os
import random
from appwrite.client import Client
from appwrite.query import Query
from appwrite.services.databases import Databases
def main(context):
context.log("Hello world!")
context.log(os.environ['APPWRITE_FUNCTION_PROJECT_ID'])
client = Client()
(
client
.set_endpoint("https://example.app/v1")
.set_project(os.environ['APPWRITE_FUNCTION_PROJECT_ID'])
.set_key(os.environ["APPWRITE_FUNCTION_API_KEY"])
)
try:
payload = json.loads(context.req.payload)
context.log(payload)
context.log(os.environ['APPWRITE_FUNCTION_USER_ID'])
user_id = os.environ['APPWRITE_FUNCTION_USER_ID']
context.log(payload, user_id)
except Exception as e:
context.error(e)
return context.res.send(e, 500)
It just fails everytime, I don't even have the log in the executions.
It simply spits out An internal curl error has occurred within the executor! Error Msg: Could not resolve host: 652c11d386e18\nError Code: 500
What's the issue ?
Is this function from before 1.4?
Yes I created it even before 1.3.8
(I edited it to use context.res etc...)
Those will stay using the old format
To use the new format, you need to create a new function.
Or recreate the old one
The point was the old functions should have still worked after the upgrade
I guess, but it didn't work at all so I edited it but still nothing..
So...you probably should try to create a new function now to use the new format
Wait is it impossible to create a function without github now ?
I'm self hosting the github connection doesn't work well...
Oh okay I can do it with the CLI, not very convenient
What do you mean? CLI was the best approach before git.
Regardless you can upload manually like before too
Recommended threads
- DeploymentStatus enum value `canceled` m...
Hey, Sorry if it has been reported already, I found an issue using the Dart SDK where the `canceled` enum value is missing from `DeploymentStatus`. This causes...
- Synchronous function execution timeout w...
I am calling server functions with xasync = true and I still get this error message. Synchronous function execution timed out. Use asynchronous execution inste...
- Function running for more than 2 hours i...
This is my projectID: 669fe01b003800dd0503 Cloud functionID is 696ea05400147eb8eb3b I hope this doesn't count against my GB-hours?