Content sharing from snap common is broken

Bug #1650671 reported by Tim Kuhlman
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Critical
Zygmunt Krynicki

Bug Description

Running on yakety with snapd at version 2.18+ppa123.a5877498-1 from the snappy edge ppa the content interface does not work for content in $SNAP_COMMON

I'm working with the promreg charm which is the producer, it has this config:
slots:
  content:
    content: promreg
    read: [$SNAP_COMMON/promreg]

The consumer is the prometheus charm which has this config.
plugs:
  content:
    content: promreg
    target: etc/prometheus/promreg

The directory '/var/snap/promreg/common/promreg' does exist and has data in it. The destination directory in the prometheus snap didn't originally exist but I tried creating it after reading
http://askubuntu.com/questions/841004/cannot-get-basic-content-interface-example-working-with-snapcraft

After getting a shell with the command `sudo snap run --shell prometheus` I see that the destination dir is empty if the destination dir was pre-existing and it doesn't exist at all if dir wasn't pre-existing. There is no error message to indicate what the problem is.

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

See updated documentation at https://github.com/snapcore/snapd/wiki/Content-Interface. Appears to be fixed in 2.19.1+

Revision history for this message
Jacek Nykis (jacekn) wrote :

Thank's to zyga for interactive troubleshooting session! Here is additional info and workaround:

1. Sharing content from $SNAP_COMMON is supported in snapd 2.20.1 and later, it's available in -proposed
2. Docs here mention "writable" content sharing: https://github.com/snapcore/snapd/wiki/Content-Interface but it has "writable-data" and "write" in a few places. I wrongly assumed was to allow one snap to write into another one. That section actually refers to "/var/snap/" data
3. Once snaps are connected this commands makes content visible:

/usr/lib/snapd/snap-discard-ns name-of-consumer-snap

I was told that 3 will be fixed. 2 is just wiki edit to clarify info a bit more

Zygmunt Krynicki (zyga)
Changed in snappy:
assignee: nobody → Zygmunt Krynicki (zyga)
importance: Undecided → Critical
status: New → In Progress
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

The one thing in content sharing that was never implemented is live modification of preseved mount namespaces. If that means nothing you don't dispair. I'm working on fixing this now.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This is now tracked as https://github.com/snapcore/snapd/pull/2624

There's a chance this will not land as it seems to cause an oops in the kernel.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Ooops, sorry, I commented on the wrong bug. Please disregard comment #4

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I'm closing this bug. The issue that affects content sharing not being reflected in existing apps is tracked elsewhere.

Changed in snappy:
status: In Progress → Invalid
Revision history for this message
Jacek Nykis (jacekn) wrote :

@zyga

Can you please comment on this bug indicating where it is tracked (I disregarded comment #4 lik you asked)?

Changed in snappy:
status: Invalid → New
status: New → Confirmed
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This is now fixed in master. Snapd can create directories on the fly, even in read-only $SNAP locations. It is also extensively tested. Please try snapd 2.31 release candidate 2 once it gets released in a day or two.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This has been fixed and released for some time now. Marking as such.

Changed in snappy:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.