nextcloud / previewgenerator

Nextcloud app to do preview generation in the background.
https://apps.nextcloud.com/apps/previewgenerator
GNU Affero General Public License v3.0
455 stars 57 forks source link

Preview Generator 2.1.0: unable to create directory '~/.cache/dconf': Operation not permitted. dconf will not work properly #154

Open Sanookmakmak opened 5 years ago

Sanookmakmak commented 5 years ago

Nextcloud 15.05 on Ubuntu 18.04 with ISPConfig:

While executing the Preview Generator cronjob:

(process:8261): dconf-CRITICAL **: 06:50:06.831: unable to create directory '/var/www/clients/client1/web7/.cache/dconf': Operation not permitted.  dconf will not work properly.
func=xmlSecCheckVersionExt:file=xmlsec.c:line=188:obj=unknown:subj=unknown:error=19:invalid version:mode=abi compatible;expected minor version=2;real minor version=2;expected subminor version=25;real subminor version=26

Does not generate previews for PDF files!

kroerig commented 5 years ago

same issue here.

/usr/bin/libreoffice: 52: cd: can't cd to /root

(process:6668): dconf-CRITICAL **: unable to create directory '/var/www/web1/.cache/dconf': Permission denied.  dconf will not work properly.
Sanookmakmak commented 5 years ago

Preview generator does not create preview for PDF, Office documents and video files.

:-(

Sanookmakmak commented 5 years ago

The .cache folder is used for generating previews only for office documents (.odt, .ods, .odp) IMHO.

The default location of it is the home directory of the user, in case of an ISPConfig server it is /var/www/clients/client1/web1 for the first site of client 1.

The home directory has setup the immutable bit, therefore the .cache folder can be created only by

chattr -i /var/www/client/client1/web1
mkdir /var/www/client/client1/web1/.cache
chown web1:client1 /var/www/client/client1/web1/.cache
chattr +i /var/www/client/client1/web1

After adding the .cache folder manually as root, preview generation of office documents are working.

But not every user has root access to disable the immutable bit, so in my opinion this is a bug in the preview generator app and should be fixed @rullzer.

acloudadmin commented 4 years ago

Hi I'm having a similar problem, but the path is different and I'm having a tough time figuring out the permissions.

The path for me is /root/.cache

I've tried changing the owner:group to www-data:www-data (which is the permission needed for most other nextcloud files and folders in my install), but no luck.

Any suggestions? Thanks!

chagwood commented 4 years ago

I have this error also - but I am not using the /var/www/... directory structure at all. So I'm not sure where the script is getting this from. Shouldn't it read from the nextcloud config to place these directorys in the data directory of users?

Sanookmakmak commented 4 years ago

The path for me is /root/.cache

then your preview-generator cronjob is running as root

chagwood commented 4 years ago

when you say that "The default location of it is the home directory of the user" - do you mean like with linux user accounts?

I have nextcloud installed with users within that, but no other accounts locally on the machine.

I want to get the preview of office documents to work, but when I run:

sudo -u www-data php /usr/share/nginx/nextcloud/occ preview:generate-all -vvv

I get: (process:13779): dconf-CRITICAL **: 02:16:49.573: unable to create directory '/var/www/.cache/dconf': Permission denied. dconf will not work properly.

My nextcloud data is located in /media/datastore/nextcloud-data so I'm assuming the previews would be placed somewhere in there? (along with the image previews that generate successfully)

chagwood commented 4 years ago

I figured it out - since the sudo -u www-data php /usr/share/nginx/nextcloud/occ preview:generate-all -vvv command is being run under the www-data user, that user's home directory was set to /var/www/ hence the error about being unable to create the .cache/dconf directory.

I stopped nginx and php7.3-fpm and ran the command usermod -d /usr/share/nginx/ www-data which changed www-data's home directory. Created the .conf directory and now preview-generate-all -vvv doesn't show any errors when attempting to create previews for office docs.

jacotec commented 2 years ago

Sorry to dig out this old issue, but I'm also facing this problem at one installation.

Although I run:

sudo -u www-data php -f /var/www/nextcloud/occ preview:generate-all -vvv

I'm getting the error message "unable to create directory '/root/.cache/dconf' "

The home path of www-data is "/var/www/", I'm running the occ command as user www-data ... why in the world does it like to create the cache in the /root/ - Folder?`And how do I fix this?

Klaupe commented 2 years ago

Sorry to dig out this old issue, but I'm also facing this problem at one installation.

Although I run:

sudo -u www-data php -f /var/www/nextcloud/occ preview:generate-all -vvv

I'm getting the error message "unable to create directory '/root/.cache/dconf' "

The home path of www-data is "/var/www/", I'm running the occ command as user www-data ... why in the world does it like to create the cache in the /root/ - Folder?`And how do I fix this?

I have the same issue here. Were you able to solve this?

joshtrichards commented 1 month ago

https://gitlab.gnome.org/GNOME/dconf/-/issues/18

In environments where this is a problem, maybe if you disable dconf for llibreoffice on your server would work? e.g.

https://wiki.documentfoundation.org/QA/ConfigurationLayers