Skip to content

[Bug]: Table for seed_executions does not exist when running dbt seed for fresh target #511

@a-schot

Description

@a-schot

Overview

When running dbt seed for a new target where there hasn't been a dbt build, the seed executions INSERT statement fails.

How to reproduce

  1. Create a new database
  2. Run dbt seed using the following config:
# dbt_project.yml

on-run-end:
  - {{ dbt_artifacts.upload_results(results) }}

dbt_artifacts:
    +enabled: false
    +schema: _log
    +persist_docs:
      relation: false
      columns: false
    sources:
      +enabled: true
      exposures:
        +alias: dbt_exposure
      invocations:
        +alias: dbt_invocation
      model_executions:
        +alias: dbt_model_execution
      models:
        +alias: dbt_model
      seed_executions:
        +alias: dbt_seed_execution
      seeds:
        +alias: dbt_seed
      snapshot_executions:
        +alias: dbt_execution
      snapshots:
        +alias: dbt_snapshot
      sources:
        +alias: dbt_source
      test_executions:
        +alias: dbt_test_execution
      tests:
        +alias: dbt_test

Expected behaviour

Table gets created if it does not exist.

Screenshots

Image

Debug log excerpt (some information redacted)

2025-06-02 13:50:52.692882 (MainThread): 13:50:52  Using snowflake connection "master"
2025-06-02 13:50:52.693683 (MainThread): 13:50:52  On master: insert into _FIR_ODD_DEV_DB._log.dbt_seed_execution 

        (
            command_invocation_id,
            node_id,
            run_started_at,
            was_full_refresh,
            thread_id,
            status,
            compile_started_at,
            query_completed_at,
            total_node_runtime,
            rows_affected,
            materialization,
             schema,
            
            name,
            alias,
            message,
            adapter_response
        )
        select
            $1,
            $2,
            $3,
            $4,
            $5,
            $6,
            $7,
            $8,
            $9,
            $10,
            $11,
            $12,
            $13,
            $14,
            $15,
            try_parse_json($16)
        from values
           (
               <redacted>
            )
/* {"app": "dbt", "dbt_version": "2025.5.27+006a4ba", "profile_name": "user", "target_name": "DEV", "connection_name": "master"} */
2025-06-02 13:50:52.694406 (MainThread): 13:50:52  Opening a new connection, currently in state init
2025-06-02 13:50:53.230670 (MainThread): 13:50:53  Snowflake adapter: Snowflake query id: 01bcc2de-0306-856c-0002-56ba09c76686
2025-06-02 13:50:53.231467 (MainThread): 13:50:53  Snowflake adapter: Snowflake error: 002003 (42S02): SQL compilation error:
Table '_FIR_ODD_DEV_DB._LOG.DBT_SEED_EXECUTION' does not exist or not authorized.

Environment

Results of running dbt --version:

dbt Cloud CLI - 0.40.3 (3977191c1073e5a9add0112705647ed61dbc5800 2025-05-16T13:18:09Z)

Please paste the contents of your packages.yml file here:

packages:
  - package: brooklyn-data/dbt_artifacts
    version: [">=2.9.3", "<3.0.0"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions