Skip to content
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.

Container Stats Fails #3

Closed
MwC-Trexx opened this issue Sep 17, 2018 · 27 comments
Closed

Container Stats Fails #3

MwC-Trexx opened this issue Sep 17, 2018 · 27 comments

Comments

@MwC-Trexx
Copy link

Problem/Motivation

STATS function is broken

Expected behavior

Showing Container CPU/Memory Stats

Actual behavior

Get Error Message: Error running ps: exit status 1

Steps to reproduce

Point to container, and click stats icon.

@addons-assistant
Copy link

👋 Thanks for opening your first issue here! If you're reporting a 🐛 bug, please make sure you include steps to reproduce it. Also, logs, error messages and information about your hardware might be usefull.

@addons-assistant
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@frenck
Copy link
Member

frenck commented Nov 19, 2018

Please do not mark this stale my friend bot

@TonyApuzzo
Copy link

TonyApuzzo commented Nov 23, 2018

I have the same problem.

New user of portainer, clicked on stats tab and got error as above. No stats shown.

Plain install of HassOS on RPI 3b+ 0.82

@tarbax
Copy link

tarbax commented Jan 6, 2019

same problem here.
latest hassio (resinos) on intel nuc

@turricansi
Copy link

i have the same problem

@lweberru
Copy link

the issue here. I get this also within command line executing a "docker top" command:

docker top homeassistant
Error response from daemon: Error running ps: exit status 1

@tboyce021
Copy link

tboyce021 commented Mar 20, 2019

Mine tells me

ps: ps: invalid option -- 'e'

Edit: Maybe somewhat related to portainer/portainer#616. The reporter there was apparently able to set the arguments with a Docker image. Perhaps something similar would work here?

@frenck
Copy link
Member

frenck commented Apr 1, 2019

Works in upcoming version:

image

image

@frenck frenck closed this as completed Apr 1, 2019
General Project Management automation moved this from Triage to Done Apr 1, 2019
@tboyce021
Copy link

Should this work in 0.5.0? I just tried and still get the same error.

@frenck
Copy link
Member

frenck commented Apr 1, 2019

it should, as per screenshots above.

Could you please provide me with your system details? (shown in the startup of the add-on, in the logs).

@frenck
Copy link
Member

frenck commented Apr 1, 2019

re-opening issue to see what @tboyce021 comes up with.

@frenck frenck reopened this Apr 1, 2019
General Project Management automation moved this from Done to To do Apr 1, 2019
@tboyce021
Copy link

tboyce021 commented Apr 1, 2019

Mine is actually probably a HassOS issue. I just thought to try it on the host itself and get the same ps: ps: invalid option -- 'e' error from docker top homeassistant. Here is my info though:

 Add-on version: 0.5.0
 You are running the latest version of this add-on.
 System: HassOS 2.11  (amd64 / qemux86-64)
 Home Assistant version: 0.90.2
 Supervisor version: 152

Edit: This is using the VMDK with Proxmox on a NUC.

@lweberru
Copy link

lweberru commented Apr 2, 2019

still don't work with 0.5.0 (same error as before)

@lweberru
Copy link

lweberru commented Apr 2, 2019

Here what I get logging into portainer itself via console:

root@a0d7b954-portainer:/$ /opt/portainer/docker ps
CONTAINER ID        IMAGE                                      COMMAND                  CREATED             STATUS              PORTS                                           NAMES
e806381245dd        hassioaddons/portainer-armv7               "/init"                  6 hours ago         Up 6 hours          0.0.0.0:9000->9000/tcp                                           addon_a0d7b954_portainer
eb3b6e69c037        homeassistant/armhf-hassio-supervisor      "python3 -m hassio"      13 hours ago        Up 13 hours                                           hassos_supervisor
20927f2427b7        hassioaddons/ssh-armv7                     "/init"                  7 days ago          Up 7 days                                           addon_a0d7b954_ssh
5eb193cb226e        hassioaddons/mqtt                          "/init"                  7 days ago          Up 7 days           0.0.0.0:1883-1884->1883-1884/tcp, 0.0.0.0:4883-4884->4883-4884/tcp, 0.0.0.0:5713->5713/tcp   addon_a0d7b954_mqtt
5371162416eb        homeassistant/raspberrypi3-homeassistant   "/bin/entry.sh pytho…"   8 days ago          Up 8 days                                           homeassistant
78285007e64a        hassioaddons/node-red-armv7                "/init"                  9 days ago          Up 9 days                                           addon_a0d7b954_nodered
45470316462e        homeassistant/armv7-addon-configurator     "/run.sh"                3 weeks ago         Up 3 weeks          0.0.0.0:3218->3218/tcp                                           addon_core_configurator
befdcc6f06ea        homeassistant/armv7-addon-samba            "/run.sh"                3 weeks ago         Up 3 weeks                                           addon_core_samba
5b76919e33b2        netdata/netdata                            "/usr/sbin/run.sh"       2 months ago        Up 2 weeks          0.0.0.0:19999->19999/tcp                                           netdata
root@a0d7b954-portainer:/$ /opt/portainer/docker top 5371162416eb
Error response from daemon: Error running ps: exit status 1
root@a0d7b954-portainer:/$

Copy link
Member

frenck commented Apr 2, 2019

Makes sense, the daemon does this on the host level, so this indicates the ps command on the host is more limited. Probably caused by busybox, which runs on HassOS, which has more limited functionality compared to the procps-ng version.

@tboyce021
Copy link

Sounds like this isn't going to be fixed on HassOS. Is there a way to make Portainer use the HassOS API or is this just going to remain broken for HassOS?

@tboyce021
Copy link

tboyce021 commented Apr 5, 2019

I'm not sure the HassOS API is sufficient for this anyway. I only see a way to get stats for the supervisor, HA, and add-ons, but I don't see a way to get stats for any container installed outside of that (i.e. using Portainer itself).

@tomlut
Copy link

tomlut commented May 2, 2019

Any idea who we could ask in the dev team about adding the ps command to HassOS?

This is a valuable tool for tracking down excessive resource use.

@TonyApuzzo
Copy link

HassOS uses buildroot to configure the system. It should be a relatively simple matter of tracking down which buildroot package contains the full ps and friends and adding it to a configuration file and rebuilding HassOS. If there is already a ps linked to busybox then will have figure out how to not have them conflict.

I may have some time this weekend to do a sample build of HassOS and see if that addresses this issue.

Disclaimer, I'm not a core dev and have little to no influence. But, if it works I will create a pull-request and see if it is accepted.

@tboyce021
Copy link

FYI, it does have ps but it comes from busybox and doesn't support the -e flag that Portainer apparently uses.

@TonyApuzzo
Copy link

TonyApuzzo commented May 4, 2019

I built the work-in-progress HassOS dev branch (3.1) with PROCPS_NG enabled and that does seem to fix portainer stats:

image

I will create a PR in HassOS and see if it goes anywhere.

UPDATE: home-assistant/operating-system#398

TonyApuzzo added a commit to TonyApuzzo/hassos that referenced this issue May 4, 2019
portainer requires ability to run 'ps -e' which is not supported
by busybox's ps.

This fixes hassio-addons/addon-portainer#3

Tested on odroid_xu4 target.
pvizeli pushed a commit to home-assistant/operating-system that referenced this issue May 7, 2019
portainer requires ability to run 'ps -e' which is not supported
by busybox's ps.

This fixes hassio-addons/addon-portainer#3

Tested on odroid_xu4 target.
@TonyApuzzo
Copy link

The pull request with the fix was accepted into the dev branch for HassOS 3.1 -- I do not know how long it will be before the 3.x branch goes live for general users, but it will eventually be in the base.

pvizeli pushed a commit to home-assistant/operating-system that referenced this issue May 10, 2019
portainer requires ability to run 'ps -e' which is not supported
by busybox's ps.

This fixes hassio-addons/addon-portainer#3

Tested on odroid_xu4 target.
@lweberru
Copy link

Just updated HASSOS to Release 2.12. And now it is really working. Well done!

@tomlut
Copy link

tomlut commented May 13, 2019

Confirmed. Nicely done.

@frenck
Copy link
Member

frenck commented May 13, 2019

Nice! Closing issue! 👍

@frenck frenck closed this as completed May 13, 2019
General Project Management automation moved this from To do to Done May 13, 2019
@addons-assistant
Copy link

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@addons-assistant addons-assistant bot locked as resolved and limited conversation to collaborators Jun 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

8 participants