🐛 Bug Report: Functions always throw timeout error after creating user account during 1min · Issue #6195 · appwrite/appwrite · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a very simple function which list documents (I only tried with Dart).
Upload the function (manual or VCS Github)
On the mobile app, create a new session with a provider account.createOAuth2Session() (I tried with Apple only)
User is now created & logged
During ~1min, try to call the function, it always throw Execution timed out..
If you do the same steps BUT at step 5. wait ~1min (just do nothing at all, just take a coffee ☕️) & then call the function: it works well 😅.
After waiting this time it always work.
My supposition is when creating a new user, Appwrite has a process in background, we need to wait this process to finish & then we can launch functions.
👍 Expected behavior
During the first ~1min, try to call the function, it should work & not throw error.
👎 Actual Behavior
During the first ~1min, try to call the function, it throw error Execution timed out.
🎲 Appwrite version
Version 1.4.x
💻 Operating system
Linux
🧱 Your Environment
I use Hetzner with 2 vCPU, 4GB Ram, 20Gb disk storage (CX21 offer)
Appwrite version: 1.4.2.
👀 Have you spent some time to check if this issue has been raised before?
I tried to make the issue reproductible to debug it & patch it :slight_smile:
1- So first create a very basic function in Dart:
import'dart:async';
import'dart:io';
import'package:dart_appwrite/dart_appwrite.dart';
Future<dynamic> main(final context) async {
final client =Client()
.setEndpoint(Platform.environment['APPWRITE_FUNCTION_ENDPOINT']!)
.setProject(Platform.environment['APPWRITE_FUNCTION_PROJECT_ID'])
.setKey(Platform.environment['APPWRITE_API_KEY'])
.setSelfSigned(status:true);
final databases =Databases(client);
try {
final response =await databases.listDocuments(
databaseId:'DB_ID',
collectionId:'SYNC_DB',
queries: [
Query.limit(100),
],
);
context.log('Fetched !');
context.log(response.documents.length.toString());
} catch (e) {
// You can also log errors to the console
context.error('There is an error!');
context.error(e.toString());
}
// `res.json()` is a handy helper for sending JSONreturn context.res.json({
'motto':'Build Fast. Scale Big. All in One Place.',
'learn':'https://appwrite.io/docs',
'connect':'https://appwrite.io/discord',
'getInspired':'https://builtwith.appwrite.io',
});
}
2- Add API key to function which had documents list permissions at minimum
3- Add execute access to Users (important)
4- Login to the app with Provider (Google or Apple, don't tried with others), don't make it with email/password, it can't always crash with (sometimes yes but not always).
_account.createOAuth2Session();
5- Direct after login success, execute the function with a button for example
👟 Reproduction steps
This bug is very strange :/
account.createOAuth2Session()
(I tried with Apple only)Execution timed out.
.If you do the same steps BUT at step 5. wait ~1min (just do nothing at all, just take a coffee ☕️) & then call the function: it works well 😅.
After waiting this time it always work.
My supposition is when creating a new user, Appwrite has a process in background, we need to wait this process to finish & then we can launch functions.
👍 Expected behavior
During the first ~1min, try to call the function, it should work & not throw error.
👎 Actual Behavior
During the first ~1min, try to call the function, it throw error
Execution timed out.
🎲 Appwrite version
Version 1.4.x
💻 Operating system
Linux
🧱 Your Environment
I use Hetzner with 2 vCPU, 4GB Ram, 20Gb disk storage (CX21 offer)
Appwrite version: 1.4.2.
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: