[SRU] Cannot open a browser link from a snap that provides a link

Bug #1580740 reported by Sergio Schvezov on 2016-05-11
This bug affects 10 people
Affects Status Importance Assigned to Milestone
snapd-xdg-open (Ubuntu)

Bug Description


Links in snaps cannot be opened on the host.

[Test Case]

Steps to reproduce:

- Run `sudo snap install telegram-sergiusens`
- Launch telegram-sergiusens.sergiusens (or from the dash)
- Receive a link
- Try an open the link.

The reason for it not working is that there is no browser in ubuntu-core and there is no handler that knows how to redirect this to the classic Ubuntu instance.

[Regression Potential]

 * The fix is a new package to be pulled in by snapd, so there is little risk of regression

[Other Info]

 * snapd-xdg-open is just one piece of two that are needed to fix this bug. The other piece is a fake xdg-open script that is available in the OS snap, which simply makes a D-Bus method invocation to the service in snapd-xdg-open

Leo Arias (elopio) on 2016-05-11
Changed in snappy:
status: New → Confirmed
Michael Vogt (mvo) on 2016-05-12
Changed in snappy:
importance: Undecided → High
status: Confirmed → Triaged
Michael Vogt (mvo) wrote :

Here is a strawman proposal:
- we add a small url-helper to ubuntu-core that contains "dbus-send --session snappy-url-helper $url"
- the snap needs to call "url-helper" (we could also call it xdg-open) when opening a url
- as part of the snapd deb (or as a dependency) we have a small dbus service on the host fs that listens to these dbus-send events and that proxies the url open requests (directly or via a window popup)

Gustavo Niemeyer (niemeyer) wrote :

Calling it xdg-open with similar semantics of xdg-open sounds nice. It already has an error code to report whether a tool was not found for it, so the application can give it a try and react appropriately if unavailable.

We need to do some basic validation on the value to make sure it looks sane and safe. xdg-open itself calls a huge number of openers and browsers, and we cannot trust that to be all safe.

Gustavo Niemeyer (niemeyer) wrote :

Can we prioritize this one to be handled sooner rather than later? Sounds like a very common problem desktop applications will face.

William Hua (attente) wrote :

Here's a proof of concept for the url helper:


We just need to add the fake xdg-open script to the core image, and add the snappy-url-helper to xdg-utils along with a service file to D-Bus activate it on the host.

William Hua (attente) on 2016-05-13
tags: added: snap-desktop-issue
William Hua (attente) wrote :
William Hua (attente) wrote :
William Hua (attente) wrote :
summary: - Cannot open a browser link from a snap that provides a link
+ [SRU] Cannot open a browser link from a snap that provides a link
William Hua (attente) on 2016-06-13
description: updated

Hello Sergio, or anyone else affected,

Accepted snapd-xdg-open into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/snapd-xdg-open/0.0.0~16.04 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-xdg-open (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed
Changed in snapd-xdg-open (Ubuntu Xenial):
importance: Undecided → Medium
Changed in snapd-xdg-open (Ubuntu):
importance: Undecided → Medium
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in snapd-xdg-open (Ubuntu):
status: New → Confirmed
Daniel Llewellyn (diddledan) wrote :

I've run across a similar problem with corebird snapped using github.com/diddledan/corebird-snap. dholbach suggested that it might be this bug.

corebird cannot open browser windows with the message in the terminal:

Error org.freedesktop.DBus.Error.ServiceUnknown: The name com.canonical.SafeLauncher was not provided by any .service files

Using snapd 2.15.2 from xenial-proposed does not fix the problem in my instance. My problem _might_ be a separate issue though, so I'm NOT marking that verification has failed.

Daniel Llewellyn (diddledan) wrote :

Ok, marking verification-done. I obviously misread the instructions and had installed snapd from proposed when I should have been testing snapd-xdg-open.

snapd-xdg-open-0.0.0~16.04 fixes corebird's opening of browser windows (corebird is currently in devmode on my system).

tags: added: verification-done
removed: verification-needed
Martin Pitt (pitti) wrote :

Releasing this is blocked by fixing this bug in yakkety.

Robie Basak (racb) wrote :

I diffed 0.0.0 from Yakkety with 0.0.0~16.04 in Xenial, and I see:

--- snapd-xdg-open-0.0.0/data/com.canonical.SafeLauncher.service 1970-01-01 00:00:00.000000000 +0000
+++ snapd-xdg-open-0.0.0~16.04/data/com.canonical.SafeLauncher.service 2016-07-07 16:39:57.000000000 +0000
@@ -0,0 +1,3 @@
+[D-BUS Service]

It seems that data/com.canonical.SafeLauncher.service has been added in the Xenial backport, but this is not mentioned in the changelog. Was this intentional? Could this mean that the version in Yakkety doesn't work?

Martin Pitt (pitti) wrote :

> Releasing this is blocked by fixing this bug in yakkety.

Ping? Yakkety releases tomorrow and it's too late to land this in yakkety proper, but it should at least be a yakkety SRU. Releasing this to xenial-updates is still blocked by fixing it in the devel series.

tags: added: xenial yakkety
Sebastien Bacher (seb128) wrote :

The .service is generated at build time by the Makefile

"com.canonical.SafeLauncher.service: Makefile
 $(AM_V_GEN) (echo '[D-BUS Service]'; \
              echo 'Name=com.canonical.SafeLauncher'; \"

the static version included in the xenial upload shouldn't be there but it doesn't create issue since it's replaced a buildtime (you can look at the i386 the libexecdir is correct and not the x86 one from the static version)

Changed in snapd-xdg-open (Ubuntu):
status: Confirmed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package snapd-xdg-open - 0.0.0~16.04

snapd-xdg-open (0.0.0~16.04) xenial; urgency=medium

  * Backport to xenial (LP: #1580740)

 -- Ubuntu Desktop Team <email address hidden> Fri, 07 Jul 2016 12:45:00 -0400

Changed in snapd-xdg-open (Ubuntu Xenial):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for snapd-xdg-open has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Daniel Llewellyn (diddledan) wrote :

did this get SRUd for yakkety, too? if not, then that needs to happen!

Ville Ranki (ville-ranki) wrote :

Nope, still can't open links from snaps in Yakkety.

Oliver Grawert (ogra) wrote :

there was another issue found in snap-confine that is just being fixed see bug 1661023
this should soon land in xenial (not sure when it will make its way into yakkety though)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers