Troubleshooting¶
Find the message you see, then read the cause and the fix. Messages from dpb validate and dpb generate have the form file:line: message, so start at that line.
Exit codes¶
Every command uses the same three exit codes:
Exit code |
Meaning |
|---|---|
0 |
The command did what it was asked |
1 |
The files have problems. |
2 |
The command could not run: a wrong option, no |
Starting a command¶
error: no datapatchbay.yaml found in <folder> or any parent directory; is this a datapatchbay repo?dpblooks fordatapatchbay.yamlin the working directory and its parents. Run the command inside the repo. In a new repo, create the file with one line,schema_version: 1.error: missing values: --kind, --owner; give them as flags or run without --no-inputdpb new --no-inputnever asks. Give the named flags, or leave out--no-inputto answer the questions in the terminal.error: dataproducts/<folder> already exists; dpb new never overwrites a data productA data product with that name and kind exists. Choose another name, or edit the existing folder.
error: no data product named '<name>'; the data products are: ...dpb describetakes the folder name, such assa_jaffle_orders, or the barename, such asjaffle_orders.dpb listleaves out a data productA file of that data product fails validation.
dpb listprints a warning on stderr. Rundpb validateto see why.
Files and keys¶
unknown key '<key>'; if it is not a typo, it may come from a newer datapatchbayUnknown keys fail, so a typo never passes in silence. Correct the key. The file reference lists the keys of each kind of file. For your own extras, use the free-form
metamap.missing schema_version; add `schema_version: 1`Every file starts with
schema_version. Add the line.schema_version 2 is newer than this datapatchbay understands (newest known: 1); upgrade datapatchbayThe file was written for a newer
dpbthan the one installed. Upgradedpb.invalid YAML: ...The file is not valid YAML. The line number points at where the parser stopped, which can be after the real mistake. Look for an open bracket or quote, or wrong indentation, on the lines before it.
folder inputs/<port> is not listed in `inputs`The port lists in
dataproduct.yamland the folders underinputs/andoutputs/must match in both directions. Add the port to the list, or remove the folder.generated file of '<file>', which is not a data product any more; delete itThe output folder holds the DAG file of a data product that was removed.
dpb generatedoes not delete it. Delete the file, or remove the output folder and generate again.entrypoint file src/<file>.py does not exist in the data product folderThe
build.entrypointof a table points at a file that is not there, often after a rename. The path is relative to the data product folder.
Names¶
data product folder '<folder>' must be named '<name>', which the naming template produces from `name` and `kind`Folder and port names are derived from
nameandkind. After you change either one, rename the folder and the ports to what the message says. To change the convention itself, change the templates underconventions.namesindatapatchbay.yaml.kind '<kind>' is not one of the kinds in the conventions; declared kinds: ...Use one of the declared kinds, or declare the new kind with its prefix under
conventions.kindsindatapatchbay.yaml.
Readers and freshness¶
data product '<reader>' reads '<port>' but is not listed in the readers of that port; add `- product: <reader>` under access.readers in <file>Declaring an input port does not give access. Add the line the message shows to the
port.yamlof the output port. See Give a reader access to an output port.output port '<port>' promises freshness 12h, but source input port '<port>' delivers with a longest gap of 24h (schedule "0 5 * * *")The port promises fresher data than its source delivers. Promise less, with a longer
freshness, or make thescheduleof the source input port more frequent.output port '<port>' promises freshness 1h, but the output port '<port>' that it reads (input port '<port>') promises only 24hThe same, for a data product that reads another one. A port cannot be fresher than the port it reads.
freshness: Value error, '<value>' is not a duration; write a positive whole number and a unit, such as 30m, 24h or 7dWrite the duration as a number and one unit.
Settings and plugins¶
runtime 'docker' needs an image, but none is set (data product '<folder>', table '<table>'); set `image` at the root, data product, port or tableA container runtime runs an image. Set
imageat the level where you setruntime. See Run build code in a container.orchestrator '<name>' has no plugin (data product '<folder>'); available orchestrator plugins: airflowThe name in the settings is not the name of an installed plugin. Correct the name, or install the package that provides the plugin in the same environment as
dpb. The same message exists for executors, runtimes and warehouses.- A setting does not have the value you expect
dpb configprints the root settings and where each comes from.dpb describe <data product>prints the resolved settings of every port and table, with the level that set each one. The nearest level wins: table, then port, then data product, then root.
dbt¶
dbt manifest not found, but tables are built by dbt; run `dbt parse` or set `dbt.manifest`dpb validatereads the dbt manifest to check what the models read. Rundbt parse, thendpb validateagain. Ifdbt parsewrites the manifest somewhere other thantarget/manifest.json, setdbt.manifestindatapatchbay.yaml.model '<model>' of data product '<reader>' reads model '<model>' of data product '<producer>' with `ref()`, which is a read of its private schemaA dbt model reads another data product’s model directly. Declare an input port on the output port, run
dpb generate, and read it withsource('<port>', '<table>'). See Build a table with dbt.model '<model>' of data product '<reader>' reads source '<port>', the output port of data product '<producer>', but '<reader>' has no input port on '<port>'The model reads an output port that its data product does not declare. Add the input port, and ask the owner of the output port to list the data product as a reader.
- A change to a model is not seen by
dpb validate dpbdoes not run dbt and does not check that the manifest is fresh. Rundbt parseafter every change to a model.dbt properties file does not match its table file; run `dpb generate` to refresh itThe table file changed after the properties were generated, or someone edited the properties by hand. Run
dpb generateand commit the result. The same fix applies todbt properties file is missing, and to the same two messages about adbt test file.dbt file is no longer generated from the table files; delete itA table or a table rule was removed, and a generated file is left over in a
models/ortests/folder. Rundpb generate, which removes it, or delete the file.`model-paths` or `test-paths` does not list the `models/` and `tests/` folders of the data products built by dbt; run `dpb generate` to refresh itdbt_project.ymlis behind the data product folders. Rundpb generateand commit the file.model file models/<model>.sql does not exist in the folder of data product '<folder>'; table '<table>' is built by dbtA dbt table needs its model, named by the
dbt_modelnaming template. Create the file, or check the spelling of its name.tables are built by dbt, so a dbt_project.yml is expected at the repo rootCreate
dbt_project.ymlat the repo root with at leastname,versionandprofile.runtime 'docker' cannot run dbt (data product '<folder>', table '<table>'); set `runtime: worker` for the tables built by dbtdbt runs on the Airflow worker only.
- The models land in a schema such as
<target schema>_<private port name> The dbt project does not override the
generate_schema_namemacro. The views and grants then do not find the tables. See the table file reference for the macro.
When the DAG runs¶
- A build task fails with
NotImplementedError: write the build code of the table '<table>' The build function is still the stub that
dpb newwrote. Replace it with code that writes the table to the data product’s private schema.- A build task cannot load the entrypoint file
On the
workerruntime, the DAG file finds the build code from its own location. Deploy the output folder and the data product folders in the same relative places as in the repo. See Deploy the generated DAGs.apply_accessfails because a role does not existThe generated SQL grants to roles and never creates them. Create the role in the warehouse. Until then, the views and grants of the previous run stay in place.
apply_accessfails because another object depends on a viewThe views of an output port are dropped and created again on every run. A view in another schema that selects from them blocks the drop. Remove that view.
- An audit task fails with
quality rule '<rule>' is broken on table '<table>', column '<column>': <n> violation(s) The data breaks a quality rule with severity
error. Correct the data or the build code. If the rule should only report, give itseverity: warning.- A change to the readers has no effect
Access is applied by the
apply_accesstask. The change takes effect on the next run of the data product’s DAG, after the new DAG file is deployed.
Still stuck¶
Search the GitHub issues, or open a new one. Include the command, its output and the dpb files it names.