Back

[SOLVED] Unable to find image 'openruntimes/dart:v2-3.0' when upgrading to new functions

  • 0
  • Flutter
  • Functions
Tomic R.
23 Sep, 2023, 06:31

Hello! I am currently in the process of updating my functions to the newer version. Previously, my function was on dart v2.17. Now, I wanted to update and had to update the runtime to dart v3.0

This is what I did so far:

  • Update pubspec.yaml for new dart_appwrite package
TypeScript
environment:
  sdk: '>=3.0.0 <4.0.0'

dependencies: 
  dart_appwrite: ^10.0.0
      
dev_dependencies:
  lints: ^2.0.1
  • In appwrite.json, update the runtime:
TypeScript
        {
            "$id": "xyz",
            "name": "xyz",
            "runtime": "dart-3.0",
            "path": "functions/xyz",
            "entrypoint": "lib/main.dart",
            "ignore": [
                ".packages",
                ".dart_tool"
            ],
            "execute": [
                "users"
            ],
            "events": [],
            "schedule": "",
            "timeout": 15
        },
  • Changed runtime in appwrite console (image 1)
  • Added the dart-3.0 to the .env in runtimes (image 2)

But still, when deploying, I get the following error:

TypeScript
Docker Error: Unable to find image 'openruntimes/dart:v2-3.0' locally
docker: Error response from daemon: manifest for openruntimes/dart:v2-3.0 not found: manifest unknown: manifest unknown.
See 'docker run --help'.

You can see the docker images I have in the third image.

TL;DR
The user was trying to update their functions to a newer version and encountered an error when deploying. They followed the necessary steps to update their code and runtime configuration, but still received an error stating that the image 'openruntimes/dart:v2-3.0' could not be found locally. Solution: It appears that the user needed to delete their old function and create a new one. Additionally, they needed to upgrade their Appwrite version to 1.4.3. After making these changes, the error was resolved and the user was able to successfully deploy their updated function.
Tomic R.
23 Sep, 2023, 06:31
D5
23 Sep, 2023, 06:44

What's your appwrite version?

Tomic R.
23 Sep, 2023, 06:44

1.4.2

D5
23 Sep, 2023, 06:45

Try upgrading to 1.4.3

D5
23 Sep, 2023, 06:45

Make backups previously of course

Tomic R.
23 Sep, 2023, 07:11

I'm still getting the same error

VincentGe
23 Sep, 2023, 13:51

Did you try deploying to the old one or rewriting them and creating a new function?

VincentGe
23 Sep, 2023, 13:52

you need to delete the old and create a new one

Tomic R.
24 Sep, 2023, 07:02

Ah okay, didn't know this

Tomic R.
24 Sep, 2023, 07:03

But I have deleted the old one and created a new one, but now I'm getting this error in the appwrite console logs (In my function, I don't have a src/folder and also not a line output = ....

TypeScript
Compiling ...
Info: Compiling with sound null safety.
src/server.dart:125:22: Error: This expression has type 'void' and can't be used.
            output = await user_code.main(context);
                     ^
Error: AOT compilation failed
Generating AOT kernel dill failed!
VincentGe
24 Sep, 2023, 14:24

So in Appwrite 1.4.3, which cloud is now on, the syntax for functions have changed

VincentGe
24 Sep, 2023, 14:25

It's a long read, but look through these pages: https://appwrite.io/docs/functions

VincentGe
24 Sep, 2023, 14:25

The dart function you used likely didn't have the right format for the new runtimes.

Tomic R.
24 Sep, 2023, 16:11

So, I actually have changed my code to the new syntax before writing here, but your comment made me think again if I haven't forgotten anything. Turns out, I had Future<void> main instead of Future main which caused the error. Thank you for your help guys!

VincentGe
24 Sep, 2023, 17:25

<a:dogekek:922629563278839870> I don't actually know dart that well, but I'm helping you walk through the debugging process

Tomic R.
24 Sep, 2023, 17:53

Well, now it’s solved, thanks! xD

safwan
25 Sep, 2023, 05:04

[SOLVED] Unable to find image 'openruntimes/dart:v2-3.0' when upgrading to new functions

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