EXCEPTION of type 'FrozenInstanceError' occurred with message: ''

Bug #1810213 reported by Hynek Petrak
42
This bug affects 7 people
Affects Status Importance Assigned to Milestone
cliff
Triaged
Undecided
Unassigned

Bug Description

Having cmd2 version 0.9.6 with cliff version 2.14.1 I get an error running cliffdemo:

(cliffdemo) help
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/cmd2/cmd2.py", line 1731, in onecmd_plus_hooks
    statement = self.precmd(statement)
  File "/usr/local/lib/python3.6/dist-packages/cliff/interactive.py", line 172, in precmd
    statement.command = cmd_name
  File "/usr/local/lib/python3.6/dist-packages/attr/_make.py", line 429, in _frozen_setattrs
    raise FrozenInstanceError()
attr.exceptions.FrozenInstanceError
EXCEPTION of type 'FrozenInstanceError' occurred with message: ''

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

It looks like we're going to have to create a new Statement object there, since they have marked the attributes of the Statement class as frozen. Let me know if you want to work on that. I'm available for code review and other pointers if you need them.

Changed in python-cliff:
status: New → Triaged
Revision history for this message
Doug Hellmann (doug-hellmann) wrote :
Revision history for this message
Matthew Thode (prometheanfire) wrote :

does 0.9.7 help?

Revision history for this message
Tony PROUM (ptone) wrote :

Hi,
I've got the same issue using Python 3.7 to build a cliff app.
Using Python 2.7 there is no issue.

This only happens when I entered in interactive mode, using command line arguments, it works fine.

Revision history for this message
Tony PROUM (ptone) wrote :

Same error with python 3.5

Revision history for this message
Nicolas Duchon (buchdag) wrote :

Same with python 3.6.7

Revision history for this message
XiaoRuiguo (705437650-6) wrote :

(mistral) workflow-create workflow.yaml
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/cmd2/cmd2.py", line 1739, in onecmd_plus_hooks
    statement = self.precmd(statement)
  File "/usr/local/lib/python3.6/dist-packages/cliff/interactive.py", line 172, in precmd
    statement.command = cmd_name
  File "/usr/local/lib/python3.6/dist-packages/attr/_make.py", line 428, in _frozen_setattrs
    raise FrozenInstanceError()
attr.exceptions.FrozenInstanceError
EXCEPTION of type 'FrozenInstanceError' occurred with message: ''

Revision history for this message
Steven Almeroth (stavrosian) wrote :

Doug Hellman's patch rolling back `cmd2` to 0.8.9 worked for me on Python 3.7.3

    cmd2 = ">0.8.3,<0.9.0"

https://bugs.launchpad.net/python-cliff/+bug/1810213/comments/2

Ahmed Masud (ahmedmasud)
Changed in python-cliff:
assignee: nobody → Ahmed Masud (ahmedmasud)
Revision history for this message
Eric Miller (erickmiller) wrote :

It seems that this problem happens even with the patch mentioned in #8.

I have tried Python 2.7, 3.5, 3.6, and 3.7.3 with similar results when NOT using the patch, building the python-openstackclient package from source:

(openstack) flavor list
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/cmd2/cmd2.py", line 1804, in onecmd_plus_hooks
    statement = self.precmd(statement)
  File "/usr/lib/python3.5/site-packages/cliff/interactive.py", line 172, in precmd
    statement.command = cmd_name
  File "/usr/lib/python3.5/site-packages/attr/_make.py", line 428, in _frozen_setattrs
    raise FrozenInstanceError()
attr.exceptions.FrozenInstanceError
EXCEPTION of type 'FrozenInstanceError' occurred with message: ''

When using the patch, the "flavor list" command above hangs, the CPU is pegged for the openstack process, and memory is slowly eaten until Linux kills the process.

I have yet to come up with a workaround by just trying a number of things without fully understanding how cliff and cmd2 work. Any ideas? The openstackclient is broken in interactive mode until we have a workaround.

Eric

Revision history for this message
Eric Miller (erickmiller) wrote :

I just noticed that my copy/paste of the error was from when I was using Python 3.5, but the same error is returned with Python 3.7.3:

(openstack) flavor list
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/cmd2/cmd2.py", line 1804, in onecmd_plus_hooks
    statement = self.precmd(statement)
  File "/usr/local/lib/python3.7/site-packages/cliff/interactive.py", line 172, in precmd
    statement.command = cmd_name
  File "/usr/local/lib/python3.7/site-packages/attr/_make.py", line 428, in _frozen_setattrs
    raise FrozenInstanceError()
attr.exceptions.FrozenInstanceError
EXCEPTION of type 'FrozenInstanceError' occurred with message: ''

Revision history for this message
Thomas Bechtold (toabctl) wrote :

This is still broken with python3.7 and cmd2==0.9.18

Ahmed Masud (ahmedmasud)
Changed in python-cliff:
assignee: Ahmed Masud (ahmedmasud) → nobody
Revision history for this message
Felix Yan (felixonmars) 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.