Skip to content
Back

ClientException with SocketException: Cloud Functions 500 Status Codes

  • 0
  • Functions
  • Cloud
Mj
11 Apr, 2026, 08:00

hi @eldad i have noticed this 500 status code in my function requests, it seems its not able to connect to the internet in the function as requests to APIs and urls fail with ClientException with SocketException: failed host lookup: ... (OS Error: name or service not known, errno = -2)

i also get this error which is basically same thing:

TypeScript
Error: Exception: Invalid or expired token.
Unhandled error: Exception: Invalid or expired token.``` 


Note that this happens like twice in every 10 request.
TL;DR
Developers are getting a ClientException with SocketException error in their functions, resulting in 500 status codes when making HTTP requests. The issue seems to be with connecting to the internet. It occurs frequently and impacts both internal and external URLs. The error message indicates a 'failed host lookup' and 'invalid or expired token.' This issue happens approximately twice in every 10 requests. **Solution:** The developers are advised to check the project ID, runtime, and region details. It is mentioned that the problem may be related to connecting to the internet within the function.
Arhan Ansari
11 Apr, 2026, 08:01

Better not to tag eldad directly....

eldad
11 Apr, 2026, 08:02

all good I asked 👍

eldad
11 Apr, 2026, 08:02

please share the code, project ID, runtime, region etc

Mj
11 Apr, 2026, 08:55

status code 500, project id: 6751d496002a1bcc7486, dart runtime, FRA region

Mj
11 Apr, 2026, 08:58

Error is always ClientException with SocketException: Failed host lookup:, wether its appwrite services or doing a HTTP request to external URLs in the function, it gives that error. it's happening more frequently now.

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