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
- Appwrite-injected variables are not avai...
I am using rust-1.83 as a runtime and try to access APPWRITE_FUNCTION_API_ENDPOINT or APPWRITE_FUNCTION_API_KEY during runtime. Both are not set during my execu...
- Appwrite (Dart SDK) (for package_info_pl...
Hi team! Many Flutter plugins now need package_info_plus 10.x and device_info_plus 13.x, but appwrite 25.4.0 still constrains package_info_plus: >=8.0.2 <10.0...
- Functions in cloud console not works
please advise as all of my runing functions on Appwrite console was working before , but now it give this error [Invalid `headers` param: Value must be a valid...