What does `ERROR: not cleaning ../.meltano/transfo...
# plugins-dbt
m
What does
ERROR: not cleaning ../.meltano/transformers/dbt/target/* because it is protected
mean? That is, what makes that directory “protected”? I don’t see anything obvious in the dbt configuration files.
Copy code
$ meltano invoke dbt-redshift:clean
2023-01-30T03:55:05.527434Z [info     ] Environment 'dev' is active
Extension executing `dbt clean`...
03:55:10  Running with dbt=1.4.0-rc1
03:55:10  Checking ../.meltano/transformers/dbt/target/*
03:55:10  ERROR: not cleaning ../.meltano/transformers/dbt/target/* because it is protected
03:55:10  Checking dbt_packages/*
03:55:10  Cleaned dbt_packages/*
03:55:10  Checking logs/*
03:55:10  Cleaned logs/*
03:55:10  Finished cleaning all paths.


Extension executing `dbt deps`...
03:55:12  Running with dbt=1.4.0-rc1
03:55:13  Installing dbt-labs/dbt_utils
03:55:13    Installed from version 1.0.0
03:55:13    Up to date!
03:55:13  Installing dbt-labs/dbt_project_evaluator
03:55:14    Installed from version 0.4.0
03:55:14    Up to date!
03:55:14  Installing dbt-labs/redshift
03:55:14    Installed from version 0.8.0
03:55:14    Up to date!


Extension executing `dbt clean`...
03:55:16  Running with dbt=1.4.0-rc1
03:55:16  Checking ../.meltano/transformers/dbt/target/*
03:55:16  ERROR: not cleaning ../.meltano/transformers/dbt/target/* because it is protected
03:55:16  Checking dbt_packages/*
03:55:16  Cleaned dbt_packages/*
03:55:16  Checking logs/*
03:55:16  Cleaned logs/*
03:55:16  Finished cleaning all paths.
p
@Matt Menzenski this is a dbt core limitation, they dont allow deleting files outside the project directory. I created an issue in there repo https://github.com/dbt-labs/dbt-core/issues/4762, the TLDR is that they think its fine to support this with a flag like
dbt clean --unsafe
but they arent prioritizing it so it would have to be a community contribution. The issue was closed because it went stale but we can re-open, I just havent had time to work on it
m
Interesting, thanks - it’s not a big deal since the directory is gitignored (so builds in CI pipelines won’t ever have a problem with un-cleaned-up directories)