[snap] Cannot run chromium as user www-data because home directory is /var/www
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Confirmed
|
Undecided
|
Unassigned | ||
chromium-browser (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
snapd (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Since the move to snap, and upgrade to 19.10, I can no longer use headless-chromium to do automated conversions.
The script, as currently run by Apache (user www-data) as a back-end server process is:
/usr/bin/timeout 60 chromium-browser --no-sandbox --headless --disable-gpu --window-
This returns error 1, with:
dconf-CRITICAL **: 19:41:17.958: unable to create directory '/var/www/
WARNING: cannot create user data directory: cannot create "/var/www/
mkdir /var/www/snap: permission denied
Sorry, home directories outside of /home are not currently supported.
See https:/
So... how are we supposed to use scripted Chrome for headless work, when the snaps don't support it?
This is a major blocker for me, as it completely destroys my ability to do any development work, because the build-toolchain for selftests relies on the ability of chrome to operate headless.
ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: chromium-browser 77.0.3865.
ProcVersionSign
Uname: Linux 5.3.0-19-generic x86_64
ApportVersion: 2.20.11-0ubuntu8
Architecture: amd64
CurrentDesktop: MATE
DRM.card0-DP-1:
enabled: disabled
dpms: Off
status: disconnected
edid-base64:
modes:
DRM.card0-DP-2:
enabled: disabled
dpms: Off
status: disconnected
edid-base64:
modes:
DRM.card0-HDMI-A-1:
enabled: enabled
dpms: On
status: connected
edid-base64: AP/////
modes: 1920x1200 1920x1080 1600x1200 1680x1050 1280x1024 1280x1024 1440x900 1440x900 1280x960 1280x800 1152x864 1280x720 1280x720 1280x720 1024x768 1024x768 1024x768 832x624 800x600 800x600 800x600 800x600 720x576 720x480 720x480 640x480 640x480 640x480 640x480 640x480 720x400
DRM.card0-HDMI-A-2:
enabled: enabled
dpms: On
status: connected
edid-base64: AP/////
modes: 1600x1200 1280x1024 1280x1024 1280x1024 1024x768 1024x768 1024x768 1024x768 832x624 800x600 800x600 800x600 800x600 800x600 640x480 640x480 640x480 640x480 640x480 720x400
DRM.card0-HDMI-A-3:
enabled: enabled
dpms: On
status: connected
edid-base64: AP/////
modes: 1600x1200 1280x1024 1280x1024 1280x1024 1024x768 1024x768 1024x768 1024x768 832x624 800x600 800x600 800x600 800x600 800x600 640x480 640x480 640x480 640x480 640x480 720x400
Date: Tue Oct 22 19:48:51 2019
DiskUsage:
Filesystem Type Size Used Avail Use% Mounted on
/dev/sdb1 ext4 1.8T 491G 1.3T 29% /home
tmpfs tmpfs 32G 927M 31G 3% /dev/shm
/dev/sdb1 ext4 1.8T 491G 1.3T 29% /home
InstallationDate: Installed on 2017-02-03 (991 days ago)
InstallationMedia: Ubuntu-MATE 17.04 "Zesty Zapus" - Alpha amd64 (20170125)
MachineType: System manufacturer System Product Name
ProcKernelCmdLine: BOOT_IMAGE=
Snap.ChromeDriv
ERROR: ld.so: object 'libgtk3-
ChromeDriver 77.0.3865.120 (416d6d8013e9ad
Snap.ChromiumVe
ERROR: ld.so: object 'libgtk3-
Chromium 77.0.3865.120 snap
SourcePackage: chromium-browser
UpgradeStatus: Upgraded to eoan on 2019-10-21 (0 days ago)
dmi.bios.date: 05/16/2018
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 3805
dmi.board.
dmi.board.name: Z170 PRO GAMING
dmi.board.vendor: ASUSTeK COMPUTER INC.
dmi.board.version: Rev X.0x
dmi.chassis.
dmi.chassis.type: 3
dmi.chassis.vendor: Default string
dmi.chassis.
dmi.modalias: dmi:bvnAmerican
dmi.product.family: To be filled by O.E.M.
dmi.product.name: System Product Name
dmi.product.sku: SKU
dmi.product.
dmi.sys.vendor: System manufacturer
Headless chromium as a snap works.
What doesn't work is running it as user www-data, which has $HOME set to /var/www.
Try exporting HOME to something the snap can write to, or alternatively run chromium with the --user-data-dir= argument.
Please share the results here. Thanks!