Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"dbt seed --full-refresh" doesn't work if the relation exists already #34

Open
nicoweidner opened this issue Jan 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@nicoweidner
Copy link
Contributor

I created test_seed.csv in the seeds folder with the following content:

field1,field2,field3
value11,value21,1
value12,value22,2

Then I ran dbt seed, which created and populated the stream dbt_demo__test_seed as expected (where dbt_demo is my local namespace).

However, when running dbt seed --full-refresh afterwards, I get this error:

15:41:12  Unhandled error while executing seed.example.test_seed
Decodable: ResourceAlreadyExists: {'timestamp': '2024-01-14T15:41:12.112+00:00', 'message': 'Unable to delete stream id [cad36ab9] as it is referenced by connection [ff748cbd].'}
@nicoweidner nicoweidner added the bug Something isn't working label Jan 14, 2024
@nicoweidner
Copy link
Contributor Author

Initial analysis:

  • dbt seed --full-refresh calls reset_csv_table in full refresh mode, see this section
  • reset_csv_table then attempts to drop the relation
  • However, the drop_relation implementation does not account for connections - it only tries to delete pipelines first, then the stream. So in the seed case, it doesn't handle the created REST connection and just tries to delete the stream - which fails, as it is referenced by the connection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant