question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Dictionary changed size during iteration

See original GitHub issue

Describe the bug

I’ve encountered this error twice so far in two days, coincidentally(?) since I upgraded to 0.14.1, and saw it on dbt Cloud. The error is: Completed with 1 error and 0 warnings: dictionary changed size during iteration In both cases this happened when doing dbt test --models source:* (Reference: runs #1683050 and #1678913 in dbt Cloud)

Screenshots and log output

Backtrace: Traceback (most recent call last): File “/usr/local/lib/python3.6/dist-packages/dbt/node_runners.py”, line 196, in safe_run result = self.compile_and_execute(manifest, ctx) File “/usr/local/lib/python3.6/dist-packages/dbt/node_runners.py”, line 134, in compile_and_execute ctx.node = self.compile(manifest) File “/usr/local/lib/python3.6/dist-packages/dbt/node_runners.py”, line 300, in compile return compile_node(self.adapter, self.config, self.node, manifest, {}) File “/usr/local/lib/python3.6/dist-packages/dbt/compilation.py”, line 221, in compile_node node = compiler.compile_node(node, manifest, extra_context) File “/usr/local/lib/python3.6/dist-packages/dbt/compilation.py”, line 118, in compile_node compiled_node, self.config, manifest) File “/usr/local/lib/python3.6/dist-packages/dbt/context/runtime.py”, line 150, in generate model, runtime_config, manifest, None, Provider()) File “/usr/local/lib/python3.6/dist-packages/dbt/context/common.py”, line 496, in generate return generate_model(model, config, manifest, source_config, provider) File “/usr/local/lib/python3.6/dist-packages/dbt/context/common.py”, line 471, in generate_model source_config, provider) File “/usr/local/lib/python3.6/dist-packages/dbt/context/common.py”, line 408, in generate_base “graph”: manifest.to_flat_graph(), File “/usr/local/lib/python3.6/dist-packages/dbt/contracts/graph/manifest.py”, line 235, in to_flat_graph k: v.serialize() for k, v in self.nodes.items() File “/usr/local/lib/python3.6/dist-packages/dbt/contracts/graph/manifest.py”, line 235, in <dictcomp> k: v.serialize() for k, v in self.nodes.items() File “/usr/local/lib/python3.6/dist-packages/dbt/api/object.py”, line 63, in serialize return copy.deepcopy(self._contents) File “/usr/lib/python3.6/copy.py”, line 150, in deepcopy y = copier(x, memo) File “/usr/lib/python3.6/copy.py”, line 239, in _deepcopy_dict for key, value in x.items(): RuntimeError: dictionary changed size during iteration

System information

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

installed version: 0.14.1
   latest version: 0.14.1

The operating system you’re using: The error occured on dbt Cloud

The output of python --version:

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
drewbanincommented, Sep 16, 2019

This was fixed in https://github.com/fishtown-analytics/dbt/pull/1750

We’re going to cut an 0.14.3 release which includes this fix next week!

1reaction
MartinGuindoncommented, Sep 13, 2019

@drewbanin To my knowledge, I’ve actually never encountered that isssue before upgrading to 0.14.1. Also I’ve had quite a few occurrences in the last 2 days.

Runs #1698615, #1696637, #1696312, #1693258, #1692100, #1691359, #1687687, #1687106, #1686503… and maybe more, I stopped looking after page 2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dictionary changed size during iteration" error? - Stack Overflow
The Python "RuntimeError: dictionary changed size during iteration" occurs when we change the size of a dictionary when iterating over it. · To...
Read more >
RuntimeError: dictionary changed size during iteration
The Python "RuntimeError: dictionary changed size during iteration" occurs when we change the size of a dictionary when iterating over it.
Read more >
Runtimeerror: Dictionary Changed Size During Iteration
In this error, Python is letting you know that the size of the python dictionary was updated during iteration. It indicates that you...
Read more >
Dictionary Changed Size During Iteration: Its Origins and Fixes
Dictionary changed size during iteration error occurs as a result of any modifications, removal, or addition of new entries for a dictionary object....
Read more >
Fix Error - Dictionary Changed Size During Iteration - Delft Stack
This Runtime error occurs when we remove, modify, or add new entries in a dictionary object during iteration. This error occurs when iterating ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found