Back

[SOLVED] Cannot deploy dart function: Docker Error: Killed

  • 0
  • Flutter
  • Functions
Tomic R.
29 Jun, 2023, 19:51

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:

TypeScript
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:

TypeScript
{
"message": "Not Found",
"code": 404,
"type": "general_route_not_found",
"version": "1.3.7"
}

My appwrite function looks like this:

TypeScript
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);
    });
}
TL;DR
The user is unable to deploy a Dart function in Appwrite and is getting a "Docker Error: Killed" message. They are using a local environment and have already run migrations. Other users in a GitHub issue also reported a similar problem. The solution suggested is to increase the function memory environment variable, which is currently set to 0. Additionally, there is a mismatch in the URL path for deployment, with the user using "deployment" instead of "deployments". Changing it to "deployments" should resolve the issue.
Binyamin
29 Jun, 2023, 19:53

Have you run migrates after upgrading Appwrite?

Also, is this a local environment? If so it's better to write

TypeScript
  client
          .setEndpoint('http://1.1.1.1/v1')
Binyamin
29 Jun, 2023, 19:53

When 1.1.1.1 is your machine host internal IP.

Tomic R.
29 Jun, 2023, 20:00

Yes I have.

Binyamin
29 Jun, 2023, 20:06

This another problem related to this https://github.com/appwrite/appwrite/issues/5623

Drake
29 Jun, 2023, 20:08

Are you self hosting?

Tomic R.
29 Jun, 2023, 20:09

yes, I am

Tomic R.
29 Jun, 2023, 20:10

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.

Binyamin
29 Jun, 2023, 20:11

I think it's another endpoint, I've the same problem as you when trying to access the raw logs

Drake
29 Jun, 2023, 20:11

Try increasing the function memory environment variable

Tomic R.
29 Jun, 2023, 20:12

It's currently set to 0..... xD

Tomic R.
29 Jun, 2023, 20:12

To what should I increase it

Binyamin
29 Jun, 2023, 20:13

Ok I've found the issue

Tomic R.
29 Jun, 2023, 20:13

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?

Binyamin
29 Jun, 2023, 20:13

Look in you url you have something like this

TypeScript
v1/functions/ID/execution/ID?mode=admin&project=ID
Binyamin
29 Jun, 2023, 20:13

?

Tomic R.
29 Jun, 2023, 20:14

uhm

Tomic R.
29 Jun, 2023, 20:14

I am not even able to execute

Tomic R.
29 Jun, 2023, 20:14

because it's not building

Binyamin
29 Jun, 2023, 20:14

When clicking on Raw Data

Tomic R.
29 Jun, 2023, 20:14

wait, lemme see

Tomic R.
29 Jun, 2023, 20:15

so instead of execution, deployment

Binyamin
29 Jun, 2023, 20:16

Change it to plural deployments instead of deployment And let me know

Tomic R.
29 Jun, 2023, 20:17
TypeScript

"$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
}
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