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

[BUG] Permission denied: '/proc/partitions' in snap version (Solved: Reading the snap instructions) #38

Closed
Daniel-at-github opened this issue Aug 8, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Daniel-at-github
Copy link

Describe the bug

In snap (ver. 1.0.2 of 2020-08-04) Exits after initial checks with a PermissionError: [Errno 13] Permission denied: '/proc/partitions'

To Reproduce

snap install bpytop
bpytop
cat ~/snap/bpytop/58/.config/bpytop/error.log

Expected behavior

Start functioning and then show the graphics without crashing.

Screenshots

Only ascii in the issue, after breaking at 86% at startup "Collecting...":

$ bpytop 
Bpytop exited with errorcode (1). See ~/snap/bpytop/58/.config/bpytop/error.log for more information!

Info (please complete the following information):

  • bpytop version: 1.0.2

  • psutil version: 5.4.2 inside the snap (version 5.7.0 or above is required) ⚠️ 🤔 Maybe the bug is here?

  • psutil version: bpytop -v (version 5.7.0 or above is required)

  • (Linux) Linux distribution and version: Ubuntu 16.04.7 LTS (snap based in core18)

  • Terminal used: GNOME Terminal 3.18.3

  • Font used:

  • Python version, python3 --version (version 3.6 or above is required): No idea on ow to look in the snap

# snap info bpytop 
name:      bpytop
summary:   A Python-based resource monitor for your terminal
publisher: James Tigert (kz6fittycent)
store-url: https://snapcraft.io/bpytop
contact:   https://github.com/kz6fittycent/bpytop-snap
license:   Apache-2.0
description: ...
commands:
  - bpytop
snap-id:      iH0DT1txUogChVISBwaxXrKZVCXifuTL
tracking:     latest/stable
refresh-date: today at 11:26 CEST
channels:
  latest/stable:    1.0.2 2020-08-04 (58) 9MB -
  latest/candidate: 
  latest/beta:      
  latest/edge:      1.0.2 2020-08-04 (58) 9MB -
installed:          1.0.2            (58) 9MB -

Additional context

contents of ~/.config/bpytop/error.log

$ cat ~/snap/bpytop/58/.config/bpytop/error.log
08/08/20 (11:31:08) | ERROR: Data collection thread failed with exception: [Errno 13] Permission denied: '/proc/partitions'
Traceback (most recent call last):
  File "/snap/bpytop/58/usr/bin/bpytop", line 2319, in _runner
    collector._collect()
  File "/snap/bpytop/58/usr/bin/bpytop", line 2602, in _collect
    io_counters = psutil.disk_io_counters(perdisk=True if SYSTEM == "Linux" else False, nowrap=True)
  File "/snap/bpytop/58/usr/lib/python3/dist-packages/psutil/__init__.py", line 2014, in disk_io_counters
    rawdict = _psplatform.disk_io_counters()
  File "/snap/bpytop/58/usr/lib/python3/dist-packages/psutil/_pslinux.py", line 1040, in disk_io_counters
    partitions = get_partitions()
  File "/snap/bpytop/58/usr/lib/python3/dist-packages/psutil/_pslinux.py", line 1022, in get_partitions
    with open_text("%s/partitions" % get_procfs_path()) as f:
  File "/snap/bpytop/58/usr/lib/python3/dist-packages/psutil/_pslinux.py", line 201, in open_text
    return open(fname, "rt", **kwargs)
PermissionError: [Errno 13] Permission denied: '/proc/partitions'
08/08/20 (11:31:08) | WARNING: Exiting with errorcode (1). Runtime 0:00:08 
@Daniel-at-github Daniel-at-github added the bug Something isn't working label Aug 8, 2020
@aristocratos
Copy link
Owner

I'm not the maintainer for the snap package.

https://github.com/kz6fittycent/bpytop-snap

Did you follow the instructions?

@Daniel-at-github Daniel-at-github changed the title [BUG] [BUG] Permission denied: '/proc/partitions' in snap version (Solved: Reading the snap instructions) Aug 8, 2020
@Daniel-at-github
Copy link
Author

My bad 😇
Thanks for pointing it out.

If you want to implement an automatic warning for snap installers, it could be something like:

if 'snap' in error_log_path and not proc_partitions_readable():
  warn_and_exit("Detected half installed snap, read the instructions in https://github.com/kz6fittycent/bpytop-snap")

@aristocratos
Copy link
Owner

aristocratos commented Aug 8, 2020

I would rather discourage from installing through any packaging system not automatically synced with the git repo tagged releases, at least not until the project has matured a bit and most of the common bugs have been fixed.

That's why I haven't included any external installation methods in the README.md yet. Could possibly included the AUR repository for arch since it pulls directly from git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants