Bug 56612 - computerroom/computer/state: 'NoneType' object has no attribute 'powerOn'
computerroom/computer/state: 'NoneType' object has no attribute 'powerOn'
Status: NEW
Product: UCS@school
Classification: Unclassified
Component: UMC - Computer room
UCS@school 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-09-18 11:46 CEST by Mika Westphal
Modified: 2024-01-12 10:12 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.057
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2023091221000503, 2023031621000374, 2023121321000317, 2024010221000151
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mika Westphal univentionstaff 2023-09-18 11:46:11 CEST
5.0-4 errata771 - UCS@school 5.0 v4

Interner Server-Fehler in "computerroom/computer/state".
Request: computerroom/computer/state

Traceback (most recent call last):
  File "%PY3%/univention/management/console/base.py", line 387, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "%PY3%/six.py", line 693, in reraise
    raise value
  File "%PY3%/univention/management/console/base.py", line 285, in execute
    function.__func__(self, request, *args, **kwargs)
  File "%PY3%/univention/management/console/modules/decorators.py", line 189, in _response
    return function(self, request)
  File "%PY3%/univention/management/console/modules/computerroom/__init__.py", line 208, in _decorated
    return func(self, *args, **kwargs)
  File "%PY3%/univention/management/console/modules/decorators.py", line 470, in _response
    result = _multi_response(self, request)
  File "%PY3%/univention/management/console/modules/decorators.py", line 189, in _response
    return function(self, request)
  File "%PY3%/univention/management/console/modules/decorators.py", line 594, in _response
    return list(function(self, iterator, *nones))
  File "%PY3%/univention/management/console/modules/decorators.py", line 436, in _fake_func
    yield function(self, *args)
  File "%PY3%/univention/management/console/modules/computerroom/__init__.py", line 986, in computer_state
    computer.powerOn()
AttributeError: 'NoneType' object has no attribute 'powerOn'
Comment 1 Jürn Brodersen univentionstaff 2023-11-07 14:32:08 CET
https://git.knut.univention.de/univention/ucsschool/-/blob/5.0/ucs-school-umc-computerroom/umc/python/computerroom/__init__.py#L267

return self.instance._computerroom.get(value) returns None if the computer wasn't found instead of raising a KeyError as the sanitizer expects.

We should also add the computername to the error message, to make the message more helpful.
Comment 4 Jürn Brodersen univentionstaff 2023-12-14 11:49:22 CET
Same problem, but for powerOn

13.12.23 14:49:52.285  MAIN        ( ERROR   ) : Interner Server-Fehler in "computerroom/computer/state".
Request: computerroom/computer/state

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 387, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 285, in execute
    function.__func__(self, request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 189, in _response
    return function(self, request)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/computerroom/__init__.py", line 208, in _decorated
    return func(self, request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 478, in _response
    result = _multi_response(self, request)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 189, in _response
    return function(self, request)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 602, in _response
    return list(function(self, iterator, *nones))
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 444, in _fake_func
    yield function(self, *args)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/computerroom/__init__.py", line 992, in computer_state
    computer.powerOff()
AttributeError: 'NoneType' object has no attribute 'powerOff'
Comment 5 Mika Westphal univentionstaff 2024-01-12 10:12:03 CET
2024010221000151  5.0-6 errata906 - UCS@school 5.0 v4

Interner Server-Fehler in "computerroom/computer/state".
Request: computerroom/computer/state

Traceback (most recent call last):
  File "%PY3%/univention/management/console/base.py", line 387, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "%PY3%/six.py", line 693, in reraise
    raise value
  File "%PY3%/univention/management/console/base.py", line 285, in execute
    function.__func__(self, request, *args, **kwargs)
  File "%PY3%/univention/management/console/modules/decorators.py", line 189, in _response
    return function(self, request)
  File "%PY3%/univention/management/console/modules/computerroom/__init__.py", line 208, in _decorated
    return func(self, request, *args, **kwargs)
  File "%PY3%/univention/management/console/modules/decorators.py", line 478, in _response
    result = _multi_response(self, request)
  File "%PY3%/univention/management/console/modules/decorators.py", line 189, in _response
    return function(self, request)
  File "%PY3%/univention/management/console/modules/decorators.py", line 602, in _response
    return list(function(self, iterator, *nones))
  File "%PY3%/univention/management/console/modules/decorators.py", line 444, in _fake_func
    yield function(self, *args)
  File "%PY3%/univention/management/console/modules/computerroom/__init__.py", line 997, in computer_state
    computer.powerOn()
AttributeError: 'NoneType' object has no attribute 'powerOn'