Score:0

Cannot create user data directory: cannot create "/var/www/snap/chromium/1732": mkdir /var/www/snap: permission denied

in flag

I'm trying to launch the chromium-browser for my scraping project and I'm getting this error on my Ubuntu 20.04.2 LTS (GNU/Linux 5.8.0-1038-aws x86_64)

Chrome process stopped before startup completed. Additional info: /usr/bin/chromium-browser: 12: xdg-settings: not found cmd_run.go:1002: WARNING: cannot create user data directory: cannot create "/var/www/snap/chromium/1732": mkdir /var/www/snap: permission denied Sorry, home directories outside of /home are not currently supported. See https://forum.snapcraft.io/t/11209 for details.

It works on my local machine and when run the df command to see mount points I could see that it's also similar to my local environment.
click to see output of df command

Can someone help me with this? Thanks in advance

Soren A avatar
mx flag
The error says that your home-dir isn't in /home/usr/... but in /var/www/snap. Why is that ? /var/www/ should only be for web-server related stuff.
guiverc avatar
cn flag
You're behind on upgrades; as a fully upgraded *focal* system will report itself as 20.04.3 (https://fridge.ubuntu.com/2021/08/27/ubuntu-20-04-3-lts-released/ shows the ISO release date, but installed systems upgraded ~fortnight before that date)
Devin Y avatar
in flag
@SorenA my PHP project cloned inside that directory.
Devin Y avatar
in flag
@guiverc Thanks. I just started developing on this server. Would it solve this issue after upgrade?
guiverc avatar
cn flag
No; Chromium is a packaged as a *confined* snap, so has limited access outside of $HOME; yes you can add additional directories via `snap connect` (see an answer at https://askubuntu.com/questions/1184357/why-cant-chromium-suddenly-access-any-partition-except-for-home) but no exceptions exist for /var/ which is a system directory. That would require a *classic* confined snap
Soren A avatar
mx flag
@DevinY The error text say's :"Sorry, home directories outside of /home are not currently supported." ... and it is bad style to have development / projects in /var/www. Only copy / install necessary files there when deploying a new version of the project.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.