8000 system monitor process no longer exists · Issue #5582 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

system monitor process no longer exists #5582

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

Closed
Tommatheussen opened this issue Jan 27, 2017 · 4 comments · Fixed by #9535
Closed

system monitor process no longer exists #5582

Tommatheussen opened this issue Jan 27, 2017 · 4 comments · Fixed by #9535

Comments

@Tommatheussen
Copy link
Contributor

Home Assistant release (hass --version):
0.36.1

Python release (python3 --version):
3.4.3

Component/platform:

sensor:
  - platform: systemmonitor

Description of problem:
When tracking the state of some processes, psutil reads in all processes and then filters them.
This results in processes sometimes being stopped before their process files have been read, resulting in an error (see traceback below).

Expected:
It's ok that some processes have been stopped while updating, handling the error would be nicer though.

Problem-relevant configuration.yaml entries and steps to reproduce:

sensor:
  - platform: systemmonitor
     resources:
       - type: process
          arg: deluged
       - type: process
          arg: deluge-web

Traceback (if applicable):

17-01-27 01:34:54 homeassistant.core: Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/PlexMediaServer/hass/lib/python3.4/site-packages/psutil/_pslinux.py", line 1084, in wrapper
    return fun(self, *args, **kwargs)
  File "/PlexMediaServer/hass/lib/python3.4/site-packages/psutil/_pslinux.py", line 1157, in name
    name = self._parse_stat_file()[0]
  File "/PlexMediaServer/hass/lib/python3.4/site-packages/psutil/_common.py", line 293, in wrapper
    return fun(self)
  File "/PlexMediaServer/hass/lib/python3.4/site-packages/psutil/_pslinux.py", line 1119, in _parse_stat_file
    with open_binary("%s/%s/stat" % (self._procfs_path, self.pid)) as f:
  File "/PlexMediaServer/hass/lib/python3.4/site-packages/psutil/_pslinux.py", line 181, in open_binary
    return open(fname, "rb", **kwargs)
FileNotFoundError: [Errno 2] No such file or directory: '/proc/14214/stat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 234, in _step
    result = coro.throw(exc)
  File "/PlexMediaServer/hass/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 387, in _update_entity_states
    yield from update_coro
  File "/PlexMediaServer/hass/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 216, in async_update_ha_state
    yield from self.hass.loop.run_in_executor(None, self.update)
  File "/usr/lib/python3.4/asyncio/futures.py", line 386, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 287, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 275, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/PlexMediaServer/hass/lib/python3.4/site-packages/homeassistant/components/sensor/systemmonitor.py", line 137, in update
    if any(self.argument in l.name() for l in psutil.process_iter()):
  File "/PlexMediaServer/hass/lib/python3.4/site-packages/homeassistant/components/sensor/systemmonitor.py", line 137, in <genexpr>
    if any(self.argument in l.name() for l in psutil.process_iter()):
  File "/PlexMediaServer/hass/lib/python3.4/site-packages/psutil/__init__.py", line 634, in name
    name = self._proc.name()
  File "/PlexMediaServer/hass/lib/python3.4/site-packages/psutil/_pslinux.py", line 1090, in wrapper
    raise NoSuchProcess(self.pid, self._name)
psutil.NoSuchProcess: psutil.NoSuchProcess process no longer exists (pid=14214)

Additional info:
I'm not sure if it's helpful, but I use it to track 4 different processes, perhaps this causes the filtering to be slow.

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@Tommatheussen
Copy link
Contributor Author

Well, I was about to mention it didn't happen anymore, but it still this, just gotten one these morning:

17-04-02 11:49:49 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.system_monitor_process_plexpy fails
Traceback (most recent call last):
  File "/home/hass/.homeassistant/deps/psutil/_pslinux.py", line 1314, in wrapper
    return fun(self, *args, **kwargs)
  File "/home/hass/.homeassistant/deps/psutil/_pslinux.py", line 1387, in name
    name = self._parse_stat_file()[0]
  File "/home/hass/.homeassistant/deps/psutil/_common.py", line 313, in wrapper
    return fun(self)
  File "/home/hass/.homeassistant/deps/psutil/_pslinux.py", line 1349, in _parse_stat_file
    with open_binary("%s/%s/stat" % (self._procfs_path, self.pid)) as f:
  File "/home/hass/.homeassistant/deps/psutil/_pslinux.py", line 190, in open_binary
    return open(fname, "rb", **kwargs)
FileNotFoundError: [Errno 2] No such file or directory: '/proc/16942/stat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/PlexMediaServer/hass/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
    None, self.update)
  File "/usr/lib/python3.4/asyncio/futures.py", line 386, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 287, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 275, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/PlexMediaServer/hass/lib/python3.4/site-packages/homeassistant/components/sensor/systemmonitor.py", line 141, in update
    if any(self.argument in l.name() for l in psutil.process_iter()):
  File "/PlexMediaServer/hass/lib/python3.4/site-packages/homeassistant/components/sensor/systemmonitor.py", line 141, in <genexpr>
    if any(self.argument in l.name() for l in psutil.process_iter()):
  File "/home/hass/.homeassistant/deps/psutil/__init__.py", line 641, in name
    name = self._proc.name()
  File "/home/hass/.homeassistant/deps/psutil/_pslinux.py", line 1320, in wrapper
    raise NoSuchProcess(self.pid, self._name)
psutil.NoSuchProcess: psutil.NoSuchProcess process no longer exists (pid=16942, name='sshd')

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@balloobbot
Copy link

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

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

Successfully merging a pull request may close this issue.

2 participants
0