question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] PermissionError: [Errno 13] Permission denied: '/proc/diskstats' when running from snap

See original GitHub issue

Upon invocation bpytop starts, displays loading screen and promptly exits with the error message: Bpytop exited with errorcode (1). See /root/snap/bpytop/147/.config/bpytop/error.log for more information! The log file boils down to PermissionError: [Errno 13] Permission denied: '/proc/diskstats' I can read /proc/diskstats as normal user (permission 444).

To Reproduce

snap install bpytop
bpytop

Expected behavior bpytop starts in all its glory

Info

  • bpytop version: 1.0.42
  • psutil version: 5.7.2
  • PopOs 20.04, linux pop-os 5.4.0-7642-generic # 46~ 1598628707~ 20.04~ 040157c-Ubuntu
  • Terminal used: bash
  • Font used:?
  • Python: 3.8.2
  • snap: 2.47.1
  • snapd: 2.47.1
  • series 16

Additional context

20/10/20 (22:04:37) | ERROR: Data collection thread failed with exception: [Errno 13] Permission denied: ‘/proc/diskstats’ Traceback (most recent call last): File “/snap/bpytop/147/usr/bin/bpytop”, line 2597, in _runner collector._collect() File “/snap/bpytop/147/usr/bin/bpytop”, line 2930, in _collect io_counters = psutil.disk_io_counters(perdisk=True if SYSTEM == “Linux” else False, nowrap=True) File “/snap/bpytop/147/usr/lib/python3/dist-packages/psutil/init.py”, line 2063, in disk_io_counters rawdict = _psplatform.disk_io_counters(**kwargs) File “/snap/bpytop/147/usr/lib/python3/dist-packages/psutil/_pslinux.py”, line 1123, in disk_io_counters for entry in gen: File “/snap/bpytop/147/usr/lib/python3/dist-packages/psutil/_pslinux.py”, line 1074, in read_procfs with open_text(“%s/diskstats” % get_procfs_path()) as f: File “/snap/bpytop/147/usr/lib/python3/dist-packages/psutil/_common.py”, line 727, in open_text return open(fname, “rt”, **kwargs) PermissionError: [Errno 13] Permission denied: ‘/proc/diskstats’ 20/10/20 (22:04:37) | WARNING: Exiting with errorcode (1). Runtime 0:00:02

(try running bpytop with --debug flag if error.log is empty)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:20 (5 by maintainers)

github_iconTop GitHub Comments

58reactions
islamelnabarawycommented, Oct 20, 2020

This tip from the README file fixed the issue for me:

Give permissions

sudo snap connect bpytop:mount-observe
sudo snap connect bpytop:network-control
sudo snap connect bpytop:hardware-observe
sudo snap connect bpytop:system-observe
sudo snap connect bpytop:process-control
sudo snap connect bpytop:physical-memory-observe
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Errno 13] Permission denied: '/etc/glances/glances.conf' - snap
In my owner view, it is a bug for glances.snap. Some modify should be taken in snapcraft.yaml for glances. But I did not...
Read more >
bpytop not working on virtual mechine but working on dual ...
Error when I tried to run bpytop after installing it from snap : ... PermissionError: [Errno 13] Permission denied: '/proc/diskstats' ...
Read more >
Viewing topic bpytop not working - GamingOnLinux
16/10/20 (12:05:54) | ERROR: Data collection thread failed with exception: [Errno 13] Permission denied: '/proc/diskstats'
Read more >
PermissionError: [Errno 13] Permission denied - Stack Overflow
This happens if you are trying to open a file, but your path is a folder. This can happen easily by mistake. To...
Read more >
error: <class 'permissionerror'>, [errno 13] permission denied ...
The PermissionError: [Errno 13] Permission denied is a common error in python ... [Errno 13] Permission denied: '/proc/diskstats' when running from snap#154.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found