rbonghi / jetson_stats

📊 Simple package for monitoring and control your NVIDIA Jetson [Orin, Xavier, Nano, TX] series

Home Page:https://rnext.it/jetson_stats

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install fails when user env vars don't exist

impala454 opened this issue · comments

Describe the bug

When installing jetson-stats via CI, the USER or SUDO_USER environment varialbes do not always exist. Part of the code assumes splits based on this output and crashes during installation of jetson stats.

To Reproduce

Steps to reproduce the behavior:

  1. Start a fresh docker or system without jetson stats installed

  2. Unset the USER environment variable

  3. Install jetson stats (pip or otherwise)

  4. See error

        File "/tmp/pip-install-d86uqbza/jetson-stats/setup.py", line 118, in remove_deprecated_data
          unset_service_permission('jetson_stats')
        File "/tmp/pip-install-d86uqbza/jetson-stats/jtop/service.py", line 195, in unset_service_permission
          if status_permission_user(group):
        File "/tmp/pip-install-d86uqbza/jetson-stats/jtop/service.py", line 165, in status_permission_user
          name, info = line.split(":")
      ValueError: not enough values to unpack (expected 2, got 1)
    

This line is making an assumption that there are returned values: https://github.com/rbonghi/jetson_stats/blob/master/jtop/service.py#L165

Expected behavior

Installation should not crash

Board

N/A - this is building in CI then using the built image on a jetson xavier AGX

Log from jtop.service

N/A

Log from jetson-stats installation

Error output from the install is above

Hi @impala454

I apologize for my late reply, but I noticed that this bug was already fixed in jetson-stats 4.2.3
By the way, I noticed another improvement for cases where the user is not specified.