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

Bug #1837746 reported by Olivier Tilloy on 2019-07-24
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
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.

Olivier Tilloy (osomon) on 2019-10-14
Changed in chromium-browser (Ubuntu):
status: Triaged → Fix Committed
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
Olivier Tilloy (osomon) wrote :
Changed in chromium-browser (Ubuntu):
status: Triaged → Fix Committed
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

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

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 -

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

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.

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.

Olivier Tilloy (osomon) wrote :

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

Alexey Bazhin (baz-irc) wrote :

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

This is resolved my issue

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

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) on 2019-11-18
Changed in chromium-browser (Ubuntu):
status: Fix Committed → New
Olivier Tilloy (osomon) wrote :
Changed in chromium-browser (Ubuntu):
status: New → Confirmed
status: Confirmed → Won't Fix
status: Won't Fix → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers