windmill-labs/windmill · error · Error

${relPath} is ${Math.ceil(size / 1024 / 1024)} MB, over the

Error message

${relPath} is ${Math.ceil(size / 1024 / 1024)} MB, over the ${MAX_MODULE_BYTES / 1024 / 1024} MB per-file limit for a dbt project file. Deploying without it would leave the project incomplete — shrink the file, or keep it out of the project folder.

What it means

The CLI refuses to deploy a dbt project when a file inside the project folder exceeds MAX_MODULE_BYTES (per-file size limit). A dbt seed CSV (large CSV loaded via dbt seed) is the typical offender. Skipping the file silently would deploy a project that compiles locally but fails at run time with a missing relation, so the CLI throws instead of skipping.

Source

Thrown at cli/src/commands/script/script.ts:860

            continue;
          }
          // A dbt project's authored files are text. A binary one -- an image
          // under `docs/`, a `.DS_Store`, a parquet seed -- would be read as
          // mojibake and, if it carries a NUL, rejected by Postgres with an
          // opaque `unsupported Unicode escape sequence`, which the push then
          // reports as success. Skip it, loudly: dbt does not read it either.
          //
          // Asked BEFORE reading: the predicate only stats the file and reads
          // its first 8 KB, so a multi-gigabyte seed next to the project costs
          // that rather than being loaded whole just to be rejected.
          const exclusion = moduleFileExclusion(fullPath);
          if (exclusion !== undefined) {
            // Over the limit but readable as text — a large seed CSV is the
            // realistic case — is refused rather than skipped: dbt WOULD have
            // read it, so shipping the project without it deploys something that
            // compiles here and fails at run time with a missing relation.
            if (exclusion === "oversized") {
              throw oversizedModuleFileError(relPath, fs.statSync(fullPath).size);
            }
            log.warn(
              `Skipping ${relPath}: not a text file, so it is not part of the dbt project the ` +
                `bundle carries — dbt does not read it either`,
            );
            continue;
          }
          // `language` is a required field of the API type and is not used for
          // these: the worker writes them to their relative path and dbt reads
          // the tree.
          modules[relPath] = {
            content: fs.readFileSync(fullPath).toString("utf-8"),
            language: "dbt" as ScriptModule["language"],
          };
        } else if (exts.some((ext) => entry.name.endsWith(ext))) {
          const content = readTextFileSync(fullPath);
          const language = inferContentTypeFromFilePath(entry.name, defaultTs);

View on GitHub (pinned to e474e8803c)

Solutions

  1. Shrink the offending file (trim/sample the seed CSV) so it is under the per-file MB limit
  2. Move the file out of the dbt project folder — dbt does not need it if it is not a real seed/model/analysis
  3. If it is a seed, load the data outside dbt (e.g. a script or warehouse-native load) and keep only a small sample in the project

Example fix

// before
project/seeds/huge_customers.csv  # 120 MB
// after
project/seeds/customers_sample.csv  # < limit; full data loaded via a warehouse-native import
Defensive patterns

Strategy: validation

Validate before calling

const stat = await Deno.stat(file); if (stat.size > MAX_MODULE_BYTES) console.warn(`${file} exceeds the dbt per-file limit; shrink or exclude it before pushing`);

Type guard

function isWithinModuleLimit(size: number): boolean { return size <= MAX_MODULE_BYTES; }

Try / catch

try { await pushDbtProject(dir); } catch (e) { if (String(e.message).includes('MB per-file limit')) { console.error('Remove or shrink the oversized file listed in the error, then retry.'); } else throw e; }

Prevention

When it happens

Trigger: Running a dbt push/deploy that walks the project folder (readDir/readModulesFromDisk) and stats a file larger than MAX_MODULE_BYTES; classification marks it 'oversized' and oversizedModuleFileError is thrown instead of skipping it like non-text files.

Common situations: Large dbt seed CSVs committed into the project; accidentally vendored data dumps, logs or binaries inside the dbt folder; a model output file checked into the repo.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/02036f3258a50277. Report an issue: GitHub.