Back

Dart pub get with SSH Key

  • 0
  • Self Hosted
  • Functions
Drake
27 Oct, 2023, 18:50

Wait it's a public repo?

TL;DR
The user is having issues with using Appwrite Cloud for their Flutter/Dart app. They are experiencing problems with low memory, AOT compilation failures, and issues with fetching public repositories. They have tried different solutions like increasing memory and using shallow clone. The user is also seeking help in debugging the issue and comparing the cloud and self-hosted deployments. The user provides the `pubspec.yaml` for both their project and the dependencies. The issue is still unresolved. Solution: There is no solution mentioned in the thread.
jaboyc
27 Oct, 2023, 18:53

Yes that's the strange thing. It's getting blocked by something that's public

jaboyc
27 Oct, 2023, 18:54

That public repository is one of the dependencies of my private repository. So it's able to fetch my private repository successfully, but not the public repo which is weird

jaboyc
27 Oct, 2023, 18:56

I've tried the deployment a few times in Appwrite Cloud and it fails every time. This deployment works perfectly fine in the self-hosted container locally though, so I'm trying to figure out what's different

Drake
27 Oct, 2023, 20:11

Ya sounds odd...

Drake
27 Oct, 2023, 21:54

what about memory. did you teal the memory env var? what are the memory and swap ones set to?

jaboyc
27 Oct, 2023, 23:12

Sorry I don't understand what you mean by that. I haven't changed anything from the defaults. I can provide the .env file if you would like

jaboyc
27 Oct, 2023, 23:13

For some additional context, the raw function size is 21KB, but when built, it is 2.6MB. Here are screenshots from my working local environment (the first failed build didn't compile purposefully, showing what the raw function size is) and from the cloud environment.

Drake
28 Oct, 2023, 00:40

ya, when it's done, it includes all the dependencies

Drake
28 Oct, 2023, 00:40

that's fine

Drake
28 Oct, 2023, 00:44

what's your pubspec.yaml?

jaboyc
28 Oct, 2023, 00:47

It's quite complex. I'm using melos as a monorepo which hosts many smaller packages I've worked on. Here is the pubspec.yaml for the final project that gets exported to Appwrite Cloud:

TypeScript
name: example_core
description: A sample command-line application.
version: 0.0.7+8
publish_to: none
environment:
  sdk: ">=3.0.0 <4.0.0"
dependencies:
  collection: ^1.16.0
  intl: ^0.18.0
  meta: ^1.8.0
  jlogical_utils_core:
    git:
      url: "git@github.com:jaboyc/jlogical_utils.git"
      ref: "master"
      path: packages/jlogical_utils/jlogical_utils_core
  jlogical_utils_cli:
    git:
      url: "git@github.com:jaboyc/jlogical_utils.git"
      ref: "master"
      path: packages/jlogical_utils/jlogical_utils_cli
dev_dependencies:
  lints: ^2.0.0
  test: 1.24.6

jlogical_utils and jlogical_utils_cli contain many other dependencies, either some other dependencies in the melos project or third-party dependencies.

jaboyc
28 Oct, 2023, 00:47

If you could let me know what exactly you are looking for in the pubspec.yaml, I can provide more answers

Drake
28 Oct, 2023, 01:00

What about the Linkadi one?

jaboyc
28 Oct, 2023, 01:02

Here is the pubspec.yaml for the project using that:

TypeScript
name: pond_cli
description: The cli Pond Framework.

publish_to: "none"

environment:
  sdk: ">=3.0.0 <4.0.0"

version: 0.0.1

dependencies:
  collection: ^1.16.0
  colorize_lumberdash: ^3.0.0
  dcli:
    git:
      url: git@github.com:Linkadi98/dcli.git
      ref: 922bb02830458f065750909dbf40fa785e59c5d5
      path: dcli
  diffutil_dart: ^4.0.0
  equatable: ^2.0.5
  interact:
    git:
      url: git@github.com:Linkadi98/interact.git
      ref: e180aa04146a78fadb11ecc93347321b5b2382cc
  lumberdash: ^3.0.0
  path: ^1.8.0
  process_run: ^0.12.5+2
  xcodeproj:
    git:
      url: git@github.com:jaboyc/xcodeproj.git
      ref: "master"

  persistence_core:
    git:
      url: git@github.com:jaboyc/jlogical_utils.git
      ref: "master"
      path: packages/persistence/persistence_core
  pond_core:
    git:
      url: git@github.com:jaboyc/jlogical_utils.git
      ref: "master"
      path: packages/pond/pond_core
  utils_core:
    git:
      url: git@github.com:jaboyc/jlogical_utils.git
      ref: "master"
      path: packages/utils/utils_core
dev_dependencies:
  lints: ^2.0.0
  test: 1.24.6
jaboyc
31 Oct, 2023, 00:44

Hey @Steven I made some progress on this issue. I debugged and found that running ``` echo "Linkadi - Start" git clone --mirror -v --depth 1 &#103;&#105;&#x74;&#64;&#103;&#x69;&#x74;&#x68;&#x75;&#x62;&#46;&#99;&#111;&#x6d;:Linkadi98/dcli.git /root/.pub-cache/git/cache/dcli-2faae80e94e3ea153ecda89e616c57901ca17885 echo "Linkadi - End"

TypeScript

in the "Build Settings - Commands" section fixed the `fatal: fetch-pack: invalid index-pack output` issue. I suppose it's due to the size of the repo being so large that it needed a shallow clone before it could run `dart pub get`

I wonder if you know why this would happen? Why would the dart runtime in Appwrite Cloud fail when the one in the self-hosted docker container did not fail? I'm assuming there isn't a repository I can look at to see the default `.env` values for cloud projects to investigate myself?
jaboyc
31 Oct, 2023, 00:45

I'm also running into another issue now on Cloud vs. Self-hosted. After I resolved the issue I mentioned above, Appwrite Cloud is now able to run dart pub get successfully, but it cannot compile the program for some strange reason. It doesn't provide any debug information to help me understand why. Check out the logs from my self-hosted deployment vs. the cloud deployment. I'm deploying the exact same code with the exact same "Build Settings - Commands" and the exact same Dart runtime. Is there anything you can suggest to help me debug this issue?

Drake
31 Oct, 2023, 00:54

for the dcli one, i wonder if you can use a regular git url rather than a private url and if that would make a difference. 🤷🏼‍♂️

Drake
31 Oct, 2023, 00:55
TypeScript
Error: AOT compilation failed
Generating AOT kernel dill failed!

This usually happens because of memory problems

jaboyc
31 Oct, 2023, 00:56

The DCLI git url just points to: https://github.com/Linkadi98/dcli which is a public url. It's not a private repo or anything. I did try git clone -v git@github.com:onepub-dev/dcli.git as well (this is the source git repo, not the Linkadi which is a fork of this), but it also failed. I believe it failed due to memory problems since the problem was resolved with the shallow clone

jaboyc
31 Oct, 2023, 00:57

Is there any way to fix this? Am I locked out of using Appwrite Cloud with a sufficiently large Dart project?

Drake
31 Oct, 2023, 01:01

ya i think the memory is low on cloud...we would have to increase it. let me see what we can do

jaboyc
31 Oct, 2023, 01:06

That would be awesome. I feel like that would really help with transitioning from testing locally to deploying on cloud (or at least providing what the memory values are on cloud so I can test what these issues are without just guessing).

jaboyc
7 Nov, 2023, 19:32

Hey @Steven just wanted to see if there are any updates on this. This is still blocking me from being able to use Appwrite Cloud for my Flutter/Dart app

Drake
7 Nov, 2023, 19:52

thanks for following up. We plan on increasing the memory on cloud soon

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