[snap] wrapper script doesn't source ~/.chromium-browser.init

Bug #1837746 reported by Olivier Tilloy
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Fix Released
Medium
Olivier Tilloy

Bug Description

(initially reported here: https://discourse.ubuntu.com/t/call-for-testing-chromium-browser-deb-to-snap-transition/11179/82)

The /usr/bin/chromium-browser script in the old deb packages had the following line:

    test -f ~/.chromium-browser.init && . ~/.chromium-browser.init

which allowed users to customize CHROMIUM_FLAGS. This was lost when transitioning to the snap. For compatibility, it should be added back, so that users who rely on this don't observe regressions when transitioning to the snap.

Tags: snap
Olivier Tilloy (osomon)
Changed in chromium-browser (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Olivier Tilloy (osomon) wrote :
Revision history for this message
Olivier Tilloy (osomon) wrote :
Revision history for this message
Olivier Tilloy (osomon) wrote :

I have temporarily reverted that commit until the request for auto-connection has been granted, because snaps in the candidate channels had become uninstallable.
Once the voting period is over (next week), I will work with Jamie to restore it.

Changed in chromium-browser (Ubuntu):
status: Fix Committed → Confirmed
status: Confirmed → Triaged
Revision history for this message
Olivier Tilloy (osomon) wrote :
Changed in chromium-browser (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Alexey Bazhin (baz-irc) wrote :

Chromium snap refuses to start if file exists:

$ chromium
/snap/chromium/917/bin/chromium.launcher: 78: .: Can't open /home/baz/.chromium-browser.init

Revision history for this message
Olivier Tilloy (osomon) wrote :

It works here. What's the output of the following commands:

    ls -l ~/.chromium-browser.init

    snap connections chromium | grep personal-files

Revision history for this message
Alexey Bazhin (baz-irc) wrote :

$ ls -l ~/.chromium-browser.init
-rw-r--r-- 1 baz baz 60 мар 16 2018 /home/baz/.chromium-browser.init

$ snap connections chromium | grep personal-files
personal-files chromium:chromium-config :personal-files -

Revision history for this message
Alexey Bazhin (baz-irc) wrote :

# dmesg | grep chromium-browser.init
[803454.414690] audit: type=1400 audit(1572333616.781:52868): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/home/baz/.chromium-browser.init" pid=5334 comm="chromium.launch" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

Revision history for this message
Jalon Funk (francescohickle15) wrote :

I can confirm that if "personal-files" slot isn't connected and "~/.chromium-browser.init" exist then chromium snap fails to start.

The solution is to either connect "personal-files" slot or delete "~/.chromium-browser.init" (arguably it's pointless to have this file if access is blocked).

@osomon you may also use something like:

test -f $REALHOME/.chromium-browser.init && . $REALHOME/.chromium-browser.init || true

which will ignore failure of sourcing ".chromium-browser.init" and let chromium start.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Well spotted! I wonder how the personal-files interface ended up in this semi-connected state for Alexey…

In any case, Alexey to work around the problem I would suggest disconnecting and reconnecting the personal-files interface:

    snap disconnect chromium:chromium-config
    snap connect chromium:chromium-config

And I'm going to add a " || true" as suggested by Jalon Funk.

Revision history for this message
Olivier Tilloy (osomon) wrote :

In fact adding a " || true" statement doesn't cut it, chromium still fails to start with the same error.

Revision history for this message
Alexey Bazhin (baz-irc) wrote :

snap disconnect chromium:chromium-config
snap connect chromium:chromium-config

This is resolved my issue

Revision history for this message
Olivier Tilloy (osomon) wrote :

This, however, should fix the problem when the personal-files interface isn't connected: https://git.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source/commit/?id=8799b7e8e5c6b8af9aa789df745b2dacb3652f02

Revision history for this message
Alexey Bazhin (baz-irc) wrote :

I have put CHROMIUM_FLAGS="--force-device-scale-factor=2.0 --new-window" in ~/.chromium-browser.init as I did before. But multiple options is not parsed correctly as it was. I getting error: "[18384:18384:1111/111220.448169:ERROR:display.cc(55)] Failed to parse the default device scale factor:2 --new-window"

Alexey Bazhin (baz-irc)
Changed in chromium-browser (Ubuntu):
status: Fix Committed → New
Revision history for this message
Olivier Tilloy (osomon) wrote :
Changed in chromium-browser (Ubuntu):
status: New → Confirmed
status: Confirmed → Won't Fix
status: Won't Fix → Fix Committed
Changed in chromium-browser (Ubuntu):
status: Fix Committed → 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.