snap htop doesnt show processes

Bug #1583794 reported by Oliver Leitner on 2016-05-19
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
htop-snap
Fix Released
Undecided
Maximiliano Bertacchini
snapd (Ubuntu)
Medium
Jamie Strandboge
Xenial
Medium
Unassigned

Bug Description

the snap package of "htop" shows no procresslist after installing it.

does it only work for other snap "apps" or does it work for the whole system?

Oliver Leitner (shadow333) wrote :
Jamie Strandboge (jdstrand) wrote :

Thank you for reporting a bug.

Did you connect the 'system-observe' interface? Eg:

sudo snap connect htop:system-observe ubuntu-core:system-observe

If after doing this it still does not work, can you attach the output of 'grep audit /var/log/syslog' and indicate the architecture of the system that has the problem?

tags: added: snapd-interface
Changed in snap (Ubuntu):
status: New → Incomplete
Oliver Leitner (shadow333) wrote :

hi jamie,

running your command outputs the following:

error: cannot perform the following tasks:
- Connect htop:system-observe to ubuntu-core:system-observe (cannot connect plug "system-observe" from snap "htop", no such plug)

output from syslog shows multiple collitions with apparmor:

[177602.095032] audit: type=1400 audit(1463692021.910:28304): apparmor="STATUS" operation="profile_load" name="snap.tmux.tmux" pid=8814 comm="apparmor_parser"
[177614.634377] audit: type=1400 audit(1463692034.450:28305): apparmor="DENIED" operation="open" profile="snap.tmux.tmux" name="/home/myuser/" pid=8847 comm="tmux" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
[177614.634486] audit: type=1400 audit(1463692034.450:28306): apparmor="DENIED" operation="open" profile="snap.tmux.tmux" name="/" pid=8847 comm="tmux" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

cpu: Intel(R) Core(TM)2 Duo CPU T5870 @ 2.00GHz
uname: Linux lappy 4.6.0-999-lowlatency #201605152200 SMP PREEMPT Mon May 16 02:06:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
snapd version: 2.0.3

Jamie Strandboge (jdstrand) wrote :

I forgot to mention that your snap needs to specify 'plugs: [ system-observe ]'. Eg:

...
apps:
  htop:
    ...
    plugs: [ system-observe ]

Once you do that, the snap connect command should work.

As for the apparmor logs, the first is not a denial, it is indicating that the tmux profile was loaded. The next two indicate a denial with tmux which IIRC you filed elsewhere. Log entries you would be interested in would be for 'snap.htop....'.

Oliver Leitner (shadow333) wrote :

hi jamie, thanks for the answer,

ahhh, ok, i thouhgt snaps where ment to replace apt, and as such worked out of the box without me needing to edit any config.

i guess ill stay with the apt htop then for now.

Jamie Strandboge (jdstrand) wrote :

I'm slightly confused-- if you are just a user of the htop snap, then it sounds like there is a bug in the snap packaging for htop since it isn't requesting the system-observe plug. If you are the developer of the htop snap, simply adjust your packaging as mentioned then the snap connect command will work.

Oliver Leitner (shadow333) wrote :

im just a user, indeed.

Oliver Leitner (shadow333) wrote :

uhhhmz, thats also the reason i file a bug report rather than fixing it;-)

Jamie Strandboge (jdstrand) wrote :

Ok, thanks for the info. Since this bug is in the packaging of an individual snap, I'm going to close this bug. The snap has a 'mailto' support url and through that I see who the person is and will point him to this bug.

Changed in snap (Ubuntu):
status: Incomplete → Invalid
Jamie Strandboge (jdstrand) wrote :

Reopening after talking to maxiberta. As it happens, htop doesn't work with system-observe and system-observe needs a few additional accesses.

Changed in snap (Ubuntu):
assignee: nobody → Jamie Strandboge (jdstrand)
status: Invalid → Confirmed
importance: Undecided → Medium
Jamie Strandboge (jdstrand) wrote :

This are the missing accesses:
@{PROC}/*/task/ r,
@{PROC}/*/task/*/stat r,
@{PROC}/*/task/*/statm r,
@{PROC}/*/task/*/cmdline r,

I'll get this fixed in snapd.

Changed in snap (Ubuntu):
status: Confirmed → Triaged
Changed in snap (Ubuntu):
status: Triaged → In Progress
Changed in snapd (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Jamie Strandboge (jdstrand)
no longer affects: snap (Ubuntu)
Jamie Strandboge (jdstrand) wrote :

This will be fixed in 2.0.6.

Changed in snapd (Ubuntu):
status: In Progress → Fix Committed

Hello Oliver, or anyone else affected,

Accepted snapd into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/snapd/2.0.6 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in snapd (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed

htop is now working as expected with snapd 2.0.6.

tags: added: verification-done
removed: verification-needed
Changed in snapd (Ubuntu Xenial):
importance: Undecided → Medium
Brian Murray (brian-murray) wrote :

Hello Oliver, or anyone else affected,

Accepted snapd into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/snapd/2.0.7 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: removed: verification-done
tags: added: verification-needed
Jamie Strandboge (jdstrand) wrote :

The htop package in the store does not specify "plugs: [ system-observe ]" in its yaml so I had to fetch it, unsquash it, adjust meta/snap.yaml to have plugs, snapcraft snap ./squashfs-root, then install to test. After doing that I can do 'sudo snap connect htop:system-observe ubuntu-core:system-observe' and verify this bug: htop now shows the process list.

tags: added: verification-done
removed: verification-needed

It actually works without "system-observe", but only shows processes owned by the current user. Just realized "system-observe" enables htop to show all other processes. I'm fixing that asap. Thanks!

I just learned from this bugreport about the htop snap. Thanks!

Mark

Oliver Leitner (shadow333) wrote :

well, except for the little glitch that Maximiliano mentoined, it seems to work now... looking forward for your fix, Maxiberta. thanks for the support guys.

Federico Gimenez (fgimenez) wrote :

Verified with latest proposed:

fgimenez@fgimenez-Standard-PC-i440FX-PIIX-1996:~$ apt-cache policy snapd
snapd:
  Installed: 2.0.8
  Candidate: 2.0.8
  Version table:
 *** 2.0.8 500
        500 http://archive.ubuntu.com/ubuntu xenial-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     2.0.5 500
        500 http://es.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
     2.0.2 500
        500 http://es.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
fgimenez@fgimenez-Standard-PC-i440FX-PIIX-1996:~$ sudo snap install htop
228.00 KB / 228.00 KB [===========================================================================================================================] 100.00 % 431.02 KB/s

Name Version Rev Developer Notes
htop 2.0.1 16 maxiberta -

fgimenez@fgimenez-Standard-PC-i440FX-PIIX-1996:~$ htop

[... shows processes ...]

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package snapd - 2.0.8

---------------
snapd (2.0.8) xenial; urgency=medium

  * New upstream release: LP: #1589534
    - debian: make `snap refresh` times more random (LP: #1537793)
    - cmd: ExecInCoreSnap looks in "core" snap first, and only in
      "ubuntu-core" snap if rev>125.
    - cmd/snap: have 'snap list' display helper message on stderr
      (LP: #1587445)
    - snap: make app names more restrictive.

 -- Michael Vogt <email address hidden> Wed, 08 Jun 2016 07:56:58 +0200

Changed in snapd (Ubuntu Xenial):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :
Download full text (6.5 KiB)

This bug was fixed in the package snapd - 2.11+16.10

---------------
snapd (2.11+16.10) yakkety; urgency=medium

  * New upstream release: LP: #1605303
    - increase version number to reflect the nature of the update
      better
    - store, daemon, client, cmd/snap, docs/rest.md: adieu search
      grammar
    - debian: move snapd.refresh.timer into timers.target
    - snapstate: add daemon-reload to fix autopkgtest on yakkety
    - Interfaces: hardware-observe
    - snap: rework the output after a snap operation
    - daemon, cmd/snap: refresh --devmode
    - store, daemon, client, cmd/snap: implement `snap find --private`
    - tests: add network-observe interface spread test
    - interfaces/builtin: allow getsockopt for connected x11 plugs
    - osutil: check for nogrup instead of adm
    - store: small cleanups (more needed)
    - snap/squashfs: fix test not to hardcode snap size
    - client,cmd/snap: cleanup cmd/snap test suite, add extra args
      testThis cleans up the cmd/snap test suite:
    - wrappers: map "never" restart condition to "no."
    - wrappers: run update-desktop-database after add/remove of desktop
      files
    - release: work around elementary mistake
    - many: remove all traces of channel from the buying codepath
    - store: kill setUbuntuStoreHeaders
    - docs: add payment methods documentation
    - many: present user with a choice of payment backends
    - asserts: add cross checks for snap asserts
    - cmd/snap,cmd/snap-exec: support running hooks via snap-exec.
    - tests: improve snap run symlink tests
    - tests: add content sharing interface spread test
    - store & many: a mechanical branch shortening store names
    - snappy: remove old snappy pkg
    - overlord/snapstate: kill flagscompat
    - overlord/snapstate, daemon, client, cmd/snap: devmode override
      (aka confined)
    - tests: extend refresh test to talk to the staging and production
      stores
    - asserts,daemon: cross checks for account and account-key
      assertions
    - client: existing JSON fixtures uses tabs for indentation
    - snap-exec: add proper integration test for snap-exec
    - spread.yaml, tests: replace hello-world with test-snapd-tools
    - tests: add locale-control interface spread test
    - tests: add mount-observe interface spread test
    - tests: add system-observe interface spread test
    - many: add AuthContext to mediate user updates to the state
    - store/auth: add helper for the macaroon refresh endpoint
    - cmd: add buy command
    - overlord: switch snapstate.Update to use ListRefresh (aka
      /snaps/metadata)
    - snap-exec: fix silly off-by-one error
    - tests: stop using hello-world.echo in the tests
    - tests: add env command to test-snapd-tools
    - classic: remove (most of) "classic" mode, this is implemented as a
      snap now
    - many: remove snapstate.Candidate and other cleanups
    - many: removed authenticator, store gets a user instead
    - asserts: fix minor doc comment typo
    - snap: ensure unknown arguments to `snap run` are ignored
    - overlord/auth: add Device/SetDevice to persist device identity in
      state
    - overlord: make SyncBoot work aga...

Read more...

Changed in snapd (Ubuntu):
status: Fix Committed → Fix Released
Changed in htop-snap:
status: New → Fix Released
assignee: nobody → Maximiliano Bertacchini (maxiberta)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers