Bug 280219 - sysutils/iocage: "AttributeError: module 'collections' has no attribute 'Iterable'"
Summary: sysutils/iocage: "AttributeError: module 'collections' has no attribute 'Iter...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Michael Gmelin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-10 17:31 UTC by Alan Somers
Modified: 2024-07-12 15:32 UTC (History)
2 users (show)

See Also:
grembo: maintainer-feedback+
grembo: merge-quarterly+


Attachments
Fix the errors in two iocage modules (2.33 KB, patch)
2024-07-10 17:40 UTC, Alan Somers
asomers: maintainer-approval? (grembo)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer freebsd_triage 2024-07-10 17:31:01 UTC
While running with Python 3.11, when reporting certain errors, iocage will crash like this:

$ sudo iocage update JAIL
********************************************************************************               
fdescfs(5) is not mounted, performance may suffer. Please run:                                 
mount -t fdescfs null /dev/fd                                                                                                                                                                 
You can also permanently mount it in /etc/fstab with the following entry:                                                                                                                     
fdescfs /dev/fd  fdescfs  rw  0  0                                                                                                                                                            
********************************************************************************               
                                                                                               
Snapshot: zroot/iocage/jails/JAIL@ioc_update_RELEASE_2024-07-10_17-11-26 created. 
Updating jail...                                                                                                                                                                              
                                                                                                                                                                                              
* Updating JAIL to the latest patch level...                                                                                                                                              
tmp48o54bff: Cannot upgrade from a version that is not a release                               
(including alpha, beta and release candidates)                                                 
using tmp48o54bff. Instead, FreeBSD can be directly                                            
upgraded by source or upgraded to a RELEASE/RELENG version                                                                                                                                    
prior to running tmp48o54bff.
Currently running: RELEASE
Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
    sys.exit(cli())
             ^^^^^                             
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/iocage_cli/update.py", line 53, in cli
    ioc.IOCage(jail=jail, skip_jails=skip_jails).update(**kwargs)
  File "/usr/local/lib/python3.11/site-packages/iocage_lib/iocage.py", line 2076, in update
    ioc_fetch.IOCFetch(
  File "/usr/local/lib/python3.11/site-packages/iocage_lib/ioc_fetch.py", line 917, in fetch_update
    iocage_lib.ioc_common.consume_and_log(
  File "/usr/local/lib/python3.11/site-packages/iocage_lib/ioc_common.py", line 904, in consume_and_log
    for output in filter(lambda o: any(v for v in o), exec_gen):
  File "/usr/local/lib/python3.11/site-packages/iocage_lib/ioc_exec.py", line 259, in exec_jail
    raise iocage_lib.ioc_exceptions.CommandFailed(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/iocage_lib/ioc_exceptions.py", line 34, in __init__
    collections.Iterable
AttributeError: module 'collections' has no attribute 'Iterable'
Comment 1 Alan Somers freebsd_committer freebsd_triage 2024-07-10 17:40:57 UTC
Created attachment 251966 [details]
Fix the errors in two iocage modules
Comment 2 David Laszlo 2024-07-12 06:43:05 UTC
I can confirm that I am also experiencing this issue. My environment details are as follows:
FreeBSD version: 14.1-RELEASE-p2
Python version: 3.11.9
iocage version: 1.2
Comment 3 Michael Gmelin freebsd_committer freebsd_triage 2024-07-12 14:33:20 UTC
Thanks for the patch!
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-07-12 14:33:47 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e15d19c28d11eb9da6ad543b4e3f0ff61783ced5

commit e15d19c28d11eb9da6ad543b4e3f0ff61783ced5
Author:     Michael Gmelin <grembo@FreeBSD.org>
AuthorDate: 2024-07-12 14:30:27 +0000
Commit:     Michael Gmelin <grembo@FreeBSD.org>
CommitDate: 2024-07-12 14:30:27 +0000

    sysutils/iocage: Fixes for python 3.11

    PR:             280219
    Reported by:    asomers
    Tested by:      asomers

 sysutils/iocage/Makefile                                      |  2 +-
 sysutils/iocage/files/patch-iocage__lib_ioc__common.py (new)  | 11 +++++++++++
 .../iocage/files/patch-iocage__lib_ioc__exceptions.py (new)   | 11 +++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
Comment 5 Alan Somers freebsd_committer freebsd_triage 2024-07-12 14:56:38 UTC
Can we please have an MFH because Python 3.11 is already in the latest quarterly branch?
Comment 6 commit-hook freebsd_committer freebsd_triage 2024-07-12 15:26:53 UTC
A commit in branch 2024Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=41e0bde90dbb4bedf8411fbc278606d92cf90208

commit 41e0bde90dbb4bedf8411fbc278606d92cf90208
Author:     Michael Gmelin <grembo@FreeBSD.org>
AuthorDate: 2024-07-12 14:30:27 +0000
Commit:     Michael Gmelin <grembo@FreeBSD.org>
CommitDate: 2024-07-12 15:24:51 +0000

    sysutils/iocage: Fixes for python 3.11

    PR:             280219
    Reported by:    asomers
    Tested by:      asomers

    (cherry picked from commit e15d19c28d11eb9da6ad543b4e3f0ff61783ced5)

 sysutils/iocage/Makefile                                      |  2 +-
 sysutils/iocage/files/patch-iocage__lib_ioc__common.py (new)  | 11 +++++++++++
 .../iocage/files/patch-iocage__lib_ioc__exceptions.py (new)   | 11 +++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
Comment 7 Alan Somers freebsd_committer freebsd_triage 2024-07-12 15:28:43 UTC
Thanks!