#Inconsistent model load / module not found

1 messages · Page 1 of 1 (latest)

mental sail
#

Hi, I recently upgrade from 0.19.2 to 0.19.11, since this upgrade randomly I have some pipeline in github action which are failing (I'm not suing the dagger action, I'm doing call with the cli)

I shared 2 issues which seems similar from my point of view but on different part of my monorepo:

ERROR [dagger.mod]: Invalid result from function
dagger.QueryError: convert return value: CoreModObject.load directory(path: "/outputs"): load directory(path: "libraries"): module not found: /home/runner/_work/monorepo/monorepo/airflow-dags [traceparent:7a44a9dbcf8bb9b2b72824643e7d8d62-a243166fb9ff6307]

logs from gha:

XX.X✔ connect 0.3s
✔ load module: . 1.4s
✔ parsing command line arguments 0.1s

✔ libraries(
  ┆ source: context /home/runner/_work/monorepo/monorepo/libraries (exclude: ["**/*.env", "**/.dagger", "README.md", "tools"])
  ┆ pipelineId: "xiaohongshu-feat/setup-xiaohongshu-crawler-code"
  ┆ awsCreds: Address.directory: Directory!
  ): Libraries! 8.1s
✘ .test(artifactName: "xiaohongshu"): LibrariesResult! 2.3s ERROR
┇ .test(services: [], markQuery: "not big_file and not gdrive", upTerminal: false) › .withDirectory(
  ┆ path: "/libraries"
  ┆ source: no(digest: "xxh3:cd73f2c7939c7c99")
  ) › 
✘ context /home/runner/_work/monorepo/monorepo/airflow-dags (exclude: ["**/*.env", "**/.dagger", "README.md", "tools", "**/.venv"]) 0.0s ERROR
! module not found: /home/runner/_work/monorepo/monorepo/airflow-dags

In this case we are calling the librarie module which is located in our monorepo at: /libraries and not doing a ref to /airflow-dags

But the pipeline was running in parallel lot of jobs and jobs from the airflow-dags but this one has a dedicated module and each job are running in a separate github runner but can use the same dagger engine.

#

Another issue is the following

11
▼ AirflowKubeTasks.preDeploymentSetup(
┆ ┆ repo: context /home/runner/_work/monorepo/monorepo/airflow_kube_tasks (exclude: [".venv/"])
┆ ┆ env: "dev"
┆ ┆ region: "eu-west-1"
┆ ┆ account: "eustaging"
┆ )
ERROR [dagger.mod]: Invalid result from function
dagger.QueryError: InvalidResultError: unknown error (load: load directory(path: "/infra/terraform"): module not found: /home/runner/_work/monorepo/monorepo/airflow_kube_tasks/dbt [traceparent:210a522d5819eb242c2eb4b554fdcc06-8dda1c97dd0ede27]) @ infrabox.main.Infrabox.edit
Please check if the returned value at runtime matches the function's declared return type.
#
▶ ..XX.....

XX.X✔ connect 0.0s
✔ load module: airflow_kube_tasks 4.6s
✔ parsing command line arguments 0.0s

✔ airflowKubeTasks(
  ┆ source: context /home/runner/_work/monorepo/monorepo/airflow_kube_tasks/airflow_kube_tasks (exclude: ["**/*.env", "**/.dagger", "README.md", "tools"])
  ┆ pipelineId: "trend_pipeline_product_metrics-master"
  ┆ workspacePyproject: _contextFile(path: "/pyproject.toml", module: "/home/runner/_work/monorepo/monorepo/airflow_kube_tasks", digest: "xxh3:56d2ebc68c367ec9"): File!
  ┆ workspaceUvLock: _contextFile(path: "/uv.lock", module: "/home/runner/_work/monorepo/monorepo/airflow_kube_tasks", digest: "xxh3:56d2ebc68c367ec9"): File!
  ┆ librariesSource: context /home/runner/_work/monorepo/monorepo/airflow_kube_tasks/libraries (exclude: ["**/*.env", "**/.dagger", "README.md", "tools"])
  ┆ awsCreds: Address.directory: Directory!
  ): AirflowKubeTasks! 1.7s
✘ .preDeploymentSetup(
  ┆ repo: context /home/runner/_work/monorepo/monorepo/airflow_kube_tasks (exclude: [".venv/"])
  ┆ env: "dev"
  ┆ region: "eu-west-1"
  ┆ account: "eustaging"
  ): Directory! 4.0s ERROR
┇ .edit(env: "dev", region: "eu-west-1", account: "eustaging", yqField: ".trend_pipeline_product_metrics.app_version", newValue: "cf2917d") › .withDirectory(
  ┆ path: "/terraform"
  ┆ source: no(digest: "xxh3:b93617787b53397d")
  ) › 
✘ context /home/runner/_work/monorepo/monorepo/airflow_kube_tasks/dbt (exclude: [".venv/"]) 0.0s ERROR
! module not found: /home/runner/_work/monorepo/monorepo/airflow_kube_tasks/dbt

In this second part the dagger module called is in /airflow_kube_tasks but without any reason I have a module not found on /airflow_kube_tasks/dbt which is an independent module, both are no link between them.
In this latest case the module at /airflow_kube_tasks is common / generic modules for our tasks and in some cases we need a bit more of customization so we are creating a dedicated module

#

in each cases if we are doing a restart of the job it's working well

#

so the issue is flacky and I'm not able to reproduce it, the only things is I have this error randomly

mental sail
#

I'm running the dagger module of the application MongoCopy and I have an error about a dbt module

#

the gha step is somethig like that:


  for f in "${dagger_files[@]}"
  do
    DAGGER_MODULE_PATH=$(sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' < "$f")
    # if empty, skip
    if [[ -z "$DAGGER_MODULE_PATH" ]]
    then
      echo "Skipping empty module path in: $f"
      continue
    fi
  
    if [[ -n "${seen[$DAGGER_MODULE_PATH]:-}" ]]
    then
      echo "Already processed module: $DAGGER_MODULE_PATH — skipping."
      continue
    fi
    seen[$DAGGER_MODULE_PATH]=1
  
    app=$(basename "$(dirname "$f")")
    DAGGER_MODULE_PATH=$(cat $f)
    echo "🔧 Processing module: $DAGGER_MODULE_PATH (app=$app)"
  
    # Always update dev/eustaging manifests
    dagger -m "$DAGGER_MODULE_PATH" \
      call --pipeline-id=$app-$CURRENT_BRANCH --aws-creds=~/.aws/ \
      pre-deployment-setup --env=dev --region=eu-west-1 --account=eustaging \
      export --path=/home/runner/_work/monorepo/monorepo --wipe=true
#

the only things is dbt is the previous call of mongocopy in this case

#

but sometime I have the issue on non sequential job but in actions cross jobs

mental sail
#

maybe last information I shared is a different problem because each time I'm re-running the job I have similar issue

small hemlock
#

@mental sail did you wipe your engine cache volume when upgrading from 0.9.2 to 0.9.11? You mentioned that all this is running against the same engine. Do you have it deployed in k8s?

mental sail
#

in local I wipe it but I have also the issue on k8s

#

for this last issue I just found why I had the module not found, I wanted to avoid to have multiple gitignore and gitattributes in the repo so I tried to add:

**/.dagger/.gitignore
**/.dagger/.gitattributes

in my global gitignore of the repo then I had the issue , after remove it it's working, tbh I don't understand why this change is breaking the process

#

(when I'm saying global it's because I'm working in a monorepo)

small hemlock
small hemlock
#

can you refresh us what the current status is please?

mental sail
mental sail
#

in the trace nominatim is a lib in our monorepo located at /libraries/monorepo and don't really know why I have a module not found on airflow-dags and these 2 components are not related at all

mental sail