AttributeError: module 'collections' has no attribute 'Iterable'

Bug #1932048 reported by Viktor Ashirov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
High
James Falcon

Bug Description

Description of problem:
cloud-init crashes with AttributeError: module 'collections' has no attribute 'Iterable'

Version-Release number of selected component (if applicable):
cloud-init-20.4-5.fc35.noarch.rpm

How reproducible:
always

Steps to Reproduce:
1. /usr/bin/cloud-init init

Actual results:
><fs> cat /var/log/cloud-init-output.log
failed run of stage init-local
------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/cloudinit/cmd/main.py", line 653, in status_wrapper
    ret = functor(name, args)
  File "/usr/lib/python3.10/site-packages/cloudinit/cmd/main.py", line 261, in main_init
    logging.setupLogging(init.cfg)
  File "/usr/lib/python3.10/site-packages/cloudinit/log.py", line 81, in setupLogging
    elif isinstance(a_cfg, (collections.Iterable)):
AttributeError: module 'collections' has no attribute 'Iterable'
------------------------------------------------------------
failed run of stage init
------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/cloudinit/cmd/main.py", line 653, in status_wrapper
    ret = functor(name, args)
  File "/usr/lib/python3.10/site-packages/cloudinit/cmd/main.py", line 261, in main_init
    logging.setupLogging(init.cfg)
  File "/usr/lib/python3.10/site-packages/cloudinit/log.py", line 81, in setupLogging
    elif isinstance(a_cfg, (collections.Iterable)):
AttributeError: module 'collections' has no attribute 'Iterable'
------------------------------------------------------------
failed run of stage modules-config
------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/cloudinit/cmd/main.py", line 653, in status_wrapper
    ret = functor(name, args)
  File "/usr/lib/python3.10/site-packages/cloudinit/cmd/main.py", line 509, in main_modules
    logging.setupLogging(mods.cfg)
  File "/usr/lib/python3.10/site-packages/cloudinit/log.py", line 81, in setupLogging
    elif isinstance(a_cfg, (collections.Iterable)):
AttributeError: module 'collections' has no attribute 'Iterable'
------------------------------------------------------------
failed run of stage modules-final
------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/cloudinit/cmd/main.py", line 653, in status_wrapper
    ret = functor(name, args)
  File "/usr/lib/python3.10/site-packages/cloudinit/cmd/main.py", line 509, in main_modules
    logging.setupLogging(mods.cfg)
  File "/usr/lib/python3.10/site-packages/cloudinit/log.py", line 81, in setupLogging
    elif isinstance(a_cfg, (collections.Iterable)):
AttributeError: module 'collections' has no attribute 'Iterable'
------------------------------------------------------------

Expected results:
cloud-init doesn't crash

Additional info:
https://bugzilla.redhat.com/show_bug.cgi?id=1972283

Revision history for this message
Viktor Ashirov (vashirov) wrote :
James Falcon (falcojr)
Changed in cloud-init:
status: New → Triaged
importance: Undecided → High
assignee: nobody → James Falcon (falcojr)
Revision history for this message
James Falcon (falcojr) wrote :

Thanks for the bug report. I put a PR up at https://github.com/canonical/cloud-init/pull/922/files .

I didn't include the try/except because this has been supported/deprecated since 3.3, and cloud-init supports back to 3.5

Revision history for this message
Viktor Ashirov (vashirov) wrote :

Awesome, thank you for the quick fix!

James Falcon (falcojr)
Changed in cloud-init:
status: Triaged → Fix Committed
Revision history for this message
James Falcon (falcojr) wrote : Fixed in cloud-init version 21.3.

This bug is believed to be fixed in cloud-init in version 21.3. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.