Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'Processor' for /proc/cpuinfo #13

Closed
anoymouserver opened this issue May 13, 2022 · 0 comments
Closed

KeyError: 'Processor' for /proc/cpuinfo #13

anoymouserver opened this issue May 13, 2022 · 0 comments

Comments

@anoymouserver
Copy link
Collaborator

On my Raspberry the ext-respondd currently aborts after startup and reports:

Apr 15 18:25:36 ffplieningrpb4olv6a systemd[1]: Started ext-respondd (respondd status for servers).
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]: Traceback (most recent call last):
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:   File "/opt/ext-respondd/ext-respondd.py", line 48, in <module>
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:     extResponddClient.start()
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:   File "/opt/ext-respondd/lib/respondd_client.py", line 60, in start
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:     responseStruct[request] = self.buildStruct(request)
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:   File "/opt/ext-respondd/lib/respondd_client.py", line 82, in buildStruct
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:     return responseClass.getStruct()
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:   File "/opt/ext-respondd/lib/respondd.py", line 31, in getStruct
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:     ret = self._get()
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:   File "/opt/ext-respondd/lib/nodeinfo.py", line 115, in _get
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:     'model': self.getCPUInfo()['model name'],
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:   File "/opt/ext-respondd/lib/nodeinfo.py", line 74, in getCPUInfo
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:     ret["model name"] = ret["Processor"]
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]: KeyError: 'Processor'
Apr 15 18:26:30 ffplieningrpb4olv6a systemd[1]: ext-respondd.service: Main process exited, code=exited, status=1/FAILURE
Apr 15 18:26:30 ffplieningrpb4olv6a systemd[1]: ext-respondd.service: Failed with result 'exit-code'.

The syslog said something about KeyError: 'Processor' well in the /proc/cpuinfo it is also written in small letters: processor, so I made a small adjustment in the /opt/ext-respondd/lib/nodeinfo.py:

    if 'model name' not in ret:
      ret["model name"] = ret["processor"]

and the ext-respondd runs again.

Originally posted by @Django-BOfH in #9 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant