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:
Error: Exception: Invalid or expired token.
Unhandled error: Exception: Invalid or expired token.```
Note that this happens like twice in every 10 request.
Better not to tag eldad directly....
all good I asked 👍
please share the code, project ID, runtime, region etc
status code 500, project id: 6751d496002a1bcc7486, dart runtime, FRA region
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.
<@564158268319203348>
Share the code
Here is the code:
final response = await _client.get(
Uri.parse('$baseUrl/account/balance'),
headers: {'Authorization': 'Bearer $key'},
);
print(
'balance check for ${key.substring(0, 5)}: status=${response.statusCode}');
you get this response when it happens:
balance check error for sk_0z: ClientException with SocketException: Failed host lookup: '{the uri here}' (OS Error: Name or service not known, errno = -2), uri={the uri here}
Note: i omitted the host lookup/uri value for privacy in the response,
if you need to know what the _client is, its just an http client http.Client()
Is your function execution throwing this or the function code? This doesn’t look like any valid Appwrite authentication. Appwrite doesn’t use the Authorization header
the code inside the function us throwing this.
even appwrite specific code inside the function also throws this, like the error i shared in the first message
Have this been looked into?
This is literally still happening and still affecting my app!!
Authentication failed: Exception: Failed to fetch user: AppwriteException: , ClientException with SocketException: Failed host lookup: 'fra.cloud.appwrite.io' (OS Error: Name or service not known, errno = -2), uri=https://fra.cloud.appwrite.io/v1/account?# (0)
ClientException with SocketException: Failed host lookup: 'https://cloud.blackbox.ai' (OS Error: Name or service not known, errno = -2), uri=https://cloud.blackbox.ai/api/tasks
Seems like the function environment literally cannot resolve the domain name to an IP address.
which of your functions is throwing this?
does it work locally?
Once I can tell which function is it running it will be easier for our engineers to debug the network of its runtime
this function 675f5e0d00091e698d30 is throwing it. i have just updated the runtime from dart 3.5 to dart 3.11 in hopes that it will fix this issue
this function too: imgflux_gen_v2_id
<@564158268319203348> are they on it?
I made sure someone from engineering will look into it when they start work
getting same 500 status
This is my appwrite project: https://cloud.appwrite.io/console/project-fra-691932db0036241caa0e/overview/platforms
500 error is very generic. Do you get same SocketException? please share more information.
this error sir
Recommended threads
- Custom API domain is unreachable
Earlier my custom api domain was working fine. Now it seems to be offline without a trace a few hours later. I didn't change anything, all the relevant DNS reco...
- "Invalid console fingerprint" when unpau...
I've tried logging out and logging back in, still can't figure out why this is happening.
- executeFunction intermittently throws Fo...
Environment: Flutter app using the Appwrite Flutter SDK, calling executeFunction for [describe endpoint, e.g. live-stream-related function]. *Description*: Int...