19:18:09 Found 859 models, 27 data tests, 1 opera...
# ask-elementary-ai
l
191809 Found 859 models, 27 data tests, 1 operation, 341 sources, 1585 macros 191809 The selection criterion 'monitoring' does not match any enabled nodes 191809 Nothing to do. Try checking your model configs and model specification args Monitoring model is in the project Thats his configuration
Copy code
models:
  +persist_docs: 
    relation: true
    columns: true  # persist docs in the database
  pagob2b_dbt:
    +pre-hook:
      - "{{ validate_model_filename(model) }}"
      - "{{ validate_model_dependencies(model) }}"
      - "{{ validate_model_content(model) }}"
    +post-hook: 
      - "{{ set_node_colors() }}"
      - "{{ apply_table_meta() }}" #tagueamento
    +materialized: custom_materialization
    monitoring:
      database: "platform"
      enabled: "{{ target.name in ('elementary_metrics') }}"
Copy code
common: &common
  type: x
  catalog: pagob2b
  host: x
  http_path: x
  ansi_mode: false
  threads: 8

pagob2b_dbt:
  target: x
  outputs:
    dev: # este profile é usado apenas no target dev do dab
      <<: *common
      schema: x
      token: x
    staging:
      <<: *common
      schema: x
      token: x
    prod:
      <<: *common
      schema: x
      token: x
    elementary_metrics:
      type: databricks
      method: http
      catalog: platform
      schema: "general_elementary_metrics"
      http_path: x
      host: x
      token: "{{ env_var('DBT_ACCESS_TOKEN') }}"
Copy code
resources:
  jobs:
    pagob2b-dbt_job_modular:
      name: pagob2b-dbt_job_modular

      # dbt_selector: Seletores dbt para rodar (ex: model1, model2+, +model3, +model4+)
      parameters:
        - name: dbt_selector
          default: "1"

      tasks:
        - task_key: dbt_modular
          job_cluster_key: dbt_job_cluster 
          dbt_task:
            project_directory: ../
            profiles_directory: dbt_profiles/
            commands:
              - 'dbt deps --target=${bundle.target}'
              - 'dbt seed --target=${bundle.target}'
              - |
                dbt build --target=${bundle.target} --select {{job.parameters.dbt_selector}} --vars '{"job_name": "{{job.name}}", "job_id": "{{job.id}}", "job_run_id": "{{job.run_id}}", "job_run_url": "${workspace.host}/jobs/{{job.id}}/runs/{{job.run_id}}"}'
          libraries:
          - pypi:
              package: dbt-databricks>=1.8.0,<2.0.0
        
      job_clusters:
        - job_cluster_key: dbt_job_cluster
          new_cluster:
            spark_version: 15.4.x-scala2.12
            node_type_id: i3.xlarge
            data_security_mode: SINGLE_USER
            num_workers: 0
            aws_attributes:
                instance_profile_arn: xxx
                zone_id: auto            
            spark_conf:
                spark.master: "local[*, 4]"
                spark.databricks.cluster.profile: singleNode
            spark_env_vars:
              SCHEMA_NAME: ${var.SCHEMA_NAME}

targets:
  staging:
    mode: development
    
  prod:
    mode: production
    resources:
      jobs:
        x_modular:
          tasks:
            - task_key: dbt_metrics_job
              job_cluster_key: dbt_job_cluster 
              dbt_task:
                project_directory: ../
                profiles_directory: dbt_profiles/
                commands:
                - 'dbt deps --target=${bundle.target}'
                - |
                  dbt run --target=elementary_metrics --select monitoring
              depends_on:
                - task_key: dbt_modular
              libraries:
              - pypi:
                  package: dbt-databricks>=1.8.0,<2.0.0
k
A message from kapa.ai
The error message:
Copy code
The selection criterion 'monitoring' does not match any enabled nodes Nothing to do. Try checking your model configs and model specification args
indicates that dbt cannot find any enabled model named
monitoring
in your project for the current target. Looking at your configuration:
Copy code
yaml monitoring:   database: "platform"   enabled: "{{ target.name in ('elementary_metrics') }}"
This means the
monitoring
model is only enabled when the dbt target is
elementary_metrics
. If you run dbt with any other target (e.g.,
dev
,
staging
,
prod
), the model will be disabled and dbt will not find it when you use
--select monitoring
. Common causes and solutions: 1. Target mismatch: Make sure you are running dbt with
--target elementary_metrics
. If you use another target, the model will be disabled and not selectable. 2. Variable or typo issues: Double-check that the target name in your command matches exactly what is in your
dbt_project.yml
and
profiles.yml
. 3. Model path or naming: Ensure the model file is named correctly and is in the correct directory so dbt can find it. 4. YAML syntax: Your YAML for enabling the model looks correct, but make sure there are no indentation or syntax errors elsewhere that could affect model discovery. Relevant examples from knowledge sources: - If a model or package is disabled for a target, dbt will not find it when you try to select it. This is a common cause for the "does not match any nodes" error. For example, in Elementary, users often set models to only be enabled for certain targets, and then encounter this error when running with a different target. The solution is to run with the correct target or adjust the enabled condition as needed [see example](https://slack.com/archives/C02CTC89LAX/p1687776269471449). - If you use a variable to control enabling, ensure you pass the correct variable name and value. A mismatch between the variable in the YAML and the CLI can cause the model to remain disabled [see example](https://slack.com/archives/C02CTC89LAX/p1680689840547609). Summary: You need to run your dbt command with
--target elementary_metrics
for the
monitoring
model to be enabled and selectable. If you use any other target, the model will be disabled and dbt will not find it. If you still see the error after confirming the target, double-check for typos in the target name and ensure the model file is in the correct location. If you need the model enabled for multiple targets, adjust the
enabled
condition accordingly.
l
@kapa.ai - | dbt run --target=elementary_metrics --select monitoring im running as this
k
A message from kapa.ai
Based on your configuration and the command you are running:
Copy code
dbt run --target=elementary_metrics --select monitoring
If you are still seeing the error:
Copy code
The selection criterion 'monitoring' does not match any enabled nodes Nothing to do. Try checking your model configs and model specification args
Possible causes based on the knowledge sources: 1. Model is not enabled for the target: Your model is configured as:
Copy code
yaml    monitoring:      database: "platform"      enabled: "{{ target.name in ('elementary_metrics') }}"
This should enable the model when the target is
elementary_metrics
. If you are running with this target and still see the error, it suggests dbt is not recognizing the model as enabled. 2. Model path or naming issue: If the model file is not in the correct directory or is not named properly, dbt may not find it. Double-check that the file is in your
models/
directory and named
monitoring.sql
(or similar). 3. YAML indentation or syntax: Incorrect YAML formatting can cause dbt to ignore model configurations. Make sure your
dbt_project.yml
is valid and the
monitoring
section is correctly nested under your project. 4. dbt cache or dependency issues: Sometimes, dbt needs a clean or a fresh dependency install. Try running:
Copy code
dbt clean    dbt deps
Relevant knowledge source examples: - Users have encountered similar issues when the model/package is disabled for the target, or when the model is not properly included in the project. The solution is to ensure the model is enabled for the correct target and that the model file is discoverable by dbt. See [this example](https://slack.com/archives/C02CTC89LAX/p1687776269471449) and [this one](https://slack.com/archives/C02CTC89LAX/p1680689840547609). If after checking all the above you still have the issue: - There may be a problem with how dbt is parsing your configuration, or a deeper issue with your project structure. The knowledge sources do not provide a more specific solution for this exact scenario. Summary: If your model is enabled for the
elementary_metrics
target and the file is in the correct location, dbt should find it. If not, double-check the model path, YAML syntax, and try cleaning and reinstalling dependencies. If the problem persists, the knowledge sources do not provide further troubleshooting steps for this specific case.
l
@kapa.ai it's not a file, it is a folder
k
A message from kapa.ai
Thank you for clarifying that
monitoring
is a folder, not a single model file. Based on the knowledge sources, dbt’s
--select
works with both model files and folders, but the folder must be discoverable as a model path and the models inside must be enabled for the current target. If you use
--select monitoring
, dbt will look for enabled models inside a folder named
monitoring
under your model paths. Key points from the knowledge sources: - If the selection criterion (like a folder name) does not match any enabled nodes, dbt will return the error you are seeing. This can happen if all models in the folder are disabled for the current target, or if the folder is not in the correct location under your model paths. This is consistent with the error described in several threads, where the enabled condition or model path was the root cause [see example](https://slack.com/archives/C02CTC89LAX/p1687776269471449). - If you use a conditional
enabled
flag (like
enabled: "{{ target.name in ('elementary_metrics') }}"
), and you run with the correct target, all models inside the folder should be enabled. If none are enabled, dbt will not find any nodes to run [see example](https://slack.com/archives/C02CTC89LAX/p1680689840547609). What to check: 1. Folder location: Ensure the
monitoring
folder is directly under a directory listed in your
model-paths
(usually
models/
). For example:
Copy code
models/      monitoring/        some_model.sql
2. Model enabled status: All models inside
monitoring
must have their
enabled
property evaluate to
true
for the
elementary_metrics
target. If the folder is empty or all models are disabled, dbt will not find any nodes. 3. YAML configuration: If you are using a folder-level configuration in
dbt_project.yml
, make sure it is correctly indented and under the right project name. For example:
Copy code
yaml    models:      pagob2b_dbt:        monitoring:          enabled: "{{ target.name in ('elementary_metrics') }}"
Summary: If
monitoring
is a folder, dbt will only select models inside it that are enabled for the current target. If you see the "does not match any enabled nodes" error, it means either the folder is not in the right place, or all models inside are disabled for the target you are using. Double-check the folder location and the enabled conditions for the models inside. If you have confirmed all of the above and still have the issue, the knowledge sources do not provide further troubleshooting steps for this specific scenario.