Hi! I have created a function for appwrite in dart. My problem is, no matter how simple the function is and no matter what I write in the main.dart file, I always get the following error in Appwrite Console:
Docker Error: Killed
Resolving dependencies...
+ collection 1.17.0 (1.17.2 available)
+ matcher 0.12.12 (0.12.16 available)
+ meta 1.9.1
+ path 1.8.3
+ pub_semver 2.1.4
+ pubspec 2.3.0
+ quiver 3.2.1
+ source_span 1.9.1 (1.10.0 available)
+ stack_trace 1.10.0 (1.11.0 available)
+ string_scanner 1.1.1 (1.2.0 available)
+ term_glyph 1.2.1
+ uri 1.0.0
+ yaml 3.1.1 (3.1.2 available)
Downloading pubspec 2.3.0...
Downloading uri 1.0.0...
Downloading yaml 3.1.1...
Downloading string_scanner 1.1.1...
Downloading path 1.8.3...
Downloading quiver 3.2.1...
Downloading collection 1.17.0...
Downloading pub_semver 2.1.4...
Downloading source_span 1.9.1...
Downloading term_glyph 1.2.1...
Downloading matcher 0.12.12...
Downloading stack_trace 1.10.0...
Downloading meta 1.9.1...
That's all I get. When clicking on "Raw Data", I get the following output:
{
"message": "Not Found",
"code": 404,
"type": "general_route_not_found",
"version": "1.3.7"
}
My appwrite function looks like this:
import 'package:dart_appwrite/dart_appwrite.dart';
void main(final req, final res) {
Client client = Client();
Users users = Users(client);
client
.setEndpoint('http://localhost/v1')
.setProject('[PROJECT_ID]')
.setKey(
'[MY_KEY]')
;
print(req);
final userId = req;
Future result = users.delete(
userId: userId,
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}
Have you run migrates after upgrading Appwrite?
Also, is this a local environment? If so it's better to write
client
.setEndpoint('http://1.1.1.1/v1')
When 1.1.1.1 is your machine host internal IP.
Yes I have.
This another problem related to this https://github.com/appwrite/appwrite/issues/5623
Are you self hosting?
yes, I am
well, they say it should be fixed with 1.3.6, right? But I am on 1.3.7 and I am still facing this issue.
I think it's another endpoint, I've the same problem as you when trying to access the raw logs
Try increasing the function memory environment variable
It's currently set to 0..... xD
To what should I increase it
Ok I've found the issue
And: _APP_FUNCTIONS_CPUS=0 _APP_FUNCTIONS_MEMORY=0 _APP_FUNCTIONS_MEMORY_SWAP=0
These all are 0. I assume I should also set cpus > 0?
Look in you url you have something like this
v1/functions/ID/execution/ID?mode=admin&project=ID
?
uhm
I am not even able to execute
because it's not building
When clicking on Raw Data
wait, lemme see
so instead of execution, deployment
Change it to plural deployments instead of deployment
And let me know
"$id": "[ID]",
"$createdAt": "2023-06-29T20:07:04.677+00:00",
"$updatedAt": "2023-06-29T20:07:04.743+00:00",
"resourceId": "649dde756bd7b92267a0",
"resourceType": "functions",
"entrypoint": "lib/main.dart",
"size": 3850,
"buildId": "[IDK if this is sensitive]",
"activate": true,
"status": "failed",
"buildStdout": "",
"buildStderr": "Docker Error: Killed\nResolving dependencies...\n+ collection 1.17.0 (1.17.2 available)\n+ matcher 0.12.12 (0.12.16 available)\n+ meta 1.9.1\n+ path 1.8.3\n+ pub_semver 2.1.4\n+ pubspec 2.3.0\n+ quiver 3.2.1\n+ source_span 1.9.1 (1.10.0 available)\n+ stack_trace 1.10.0 (1.11.0 available)\n+ string_scanner 1.1.1 (1.2.0 available)\n+ term_glyph 1.2.1\n+ uri 1.0.0\n+ yaml 3.1.1 (3.1.2 available)\nDownloading pubspec 2.3.0...\nDownloading uri 1.0.0...\nDownloading yaml 3.1.1...\nDownloading string_scanner 1.1.1...\nDownloading path 1.8.3...\nDownloading quiver 3.2.1...\nDownloading collection 1.17.0...\nDownloading pub_semver 2.1.4...\nDownloading source_span 1.9.1...\nDownloading term_glyph 1.2.1...\nDownloading matcher 0.12.12...\nDownloading stack_trace 1.10.0...\nDownloading meta 1.9.1...\n",
"buildTime": 0
}
Recommended threads
- Unable to create records with other user...
are we able to create records in collections with permissions of different user than the caller of this request? (with document security on) I have backend func...
- 500 Internal Error when Project is opene...
After migrating from 1.6.1 to 1.7.4 I noticed this strange behaviour: When I open a project in a separate tab I get a 500 internal error. However, then I simpl...
- Sometimes this function shows an error l...
1. Synchronous function execution timed out. Use asynchronous execution instead, or ensure the execution duration doesn't exceed 30 seconds.\nError Code: 408 2...