{"record":{"id":"02036f3258a50277","repo":"windmill-labs/windmill","slug":"relpath-is-math-ceil-size-1024-1024-mb","errorCode":null,"errorMessage":"${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.","messagePattern":"(.+?) is (.+?) MB, over the (.+?) 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\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/script/script.ts","lineNumber":860,"sourceCode":"            continue;\n          }\n          // A dbt project's authored files are text. A binary one -- an image\n          // under `docs/`, a `.DS_Store`, a parquet seed -- would be read as\n          // mojibake and, if it carries a NUL, rejected by Postgres with an\n          // opaque `unsupported Unicode escape sequence`, which the push then\n          // reports as success. Skip it, loudly: dbt does not read it either.\n          //\n          // Asked BEFORE reading: the predicate only stats the file and reads\n          // its first 8 KB, so a multi-gigabyte seed next to the project costs\n          // that rather than being loaded whole just to be rejected.\n          const exclusion = moduleFileExclusion(fullPath);\n          if (exclusion !== undefined) {\n            // Over the limit but readable as text — a large seed CSV is the\n            // realistic case — is refused rather than skipped: dbt WOULD have\n            // read it, so shipping the project without it deploys something that\n            // compiles here and fails at run time with a missing relation.\n            if (exclusion === \"oversized\") {\n              throw oversizedModuleFileError(relPath, fs.statSync(fullPath).size);\n            }\n            log.warn(\n              `Skipping ${relPath}: not a text file, so it is not part of the dbt project the ` +\n                `bundle carries — dbt does not read it either`,\n            );\n            continue;\n          }\n          // `language` is a required field of the API type and is not used for\n          // these: the worker writes them to their relative path and dbt reads\n          // the tree.\n          modules[relPath] = {\n            content: fs.readFileSync(fullPath).toString(\"utf-8\"),\n            language: \"dbt\" as ScriptModule[\"language\"],\n          };\n        } else if (exts.some((ext) => entry.name.endsWith(ext))) {\n          const content = readTextFileSync(fullPath);\n          const language = inferContentTypeFromFilePath(entry.name, defaultTs);\n","sourceCodeStart":842,"sourceCodeEnd":878,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/script/script.ts#L842-L878","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Shrink the offending file (trim/sample the seed CSV) so it is under the per-file MB limit","Move the file out of the dbt project folder — dbt does not need it if it is not a real seed/model/analysis","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"],"exampleFix":"// before\nproject/seeds/huge_customers.csv  # 120 MB\n// after\nproject/seeds/customers_sample.csv  # < limit; full data loaded via a warehouse-native import","handlingStrategy":"validation","validationCode":"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`);","typeGuard":"function isWithinModuleLimit(size: number): boolean { return size <= MAX_MODULE_BYTES; }","tryCatchPattern":"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; }","preventionTips":["Add a CI/pre-push check that fails when any file in the dbt folder exceeds the limit","Keep seeds small; load bulk data outside dbt","Add data dumps/logs to ignore rules so they never sit inside the project folder"],"tags":["dbt","file-size","cli","deploy"],"backgroundTag":"file-too-large","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}