After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 787249 - thumbnails fail to generate with gnome-desktop from git master branch.
thumbnails fail to generate with gnome-desktop from git master branch.
Status: RESOLVED FIXED
Product: gnome-desktop
Classification: Core
Component: Thumbnail
git master
Other Linux
: Normal normal
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-09-04 12:29 UTC by Hussam Al-Tayeb
Modified: 2017-09-06 11:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
thumbnail: Add debug when loading an image file fails (1.15 KB, patch)
2017-09-06 11:35 UTC, Bastien Nocera
committed Details | Review
thumbnail: Fix gsf-office-thumbnailer not working (1.96 KB, patch)
2017-09-06 11:35 UTC, Bastien Nocera
committed Details | Review

Description Hussam Al-Tayeb 2017-09-04 12:29:03 UTC
Using gnome-desktop from git master branch and bubblewrap 0.1.8, thumbnails do not get generated or stored.
I do see a lot of /tmp/gnome-desktop-thumbna*** folders quickly appearing and disappearing.
However no thumbnail shows or gets cached.
Comment 1 Bastien Nocera 2017-09-06 08:52:51 UTC
Do applications generating thumbnails show errors? If so, what are they? You can also try to use the test-desktop-thumbnail test program in gnome-desktop to catch errors.

Are there any specific formats that fail? What distribution do you use?

If the error is not conclusive, please try changing the "#if 0" line in gnome_desktop_thumbnail_script_exec() to "#if 1" and gather the output so we can see how bwrap is launched.
Comment 2 Hussam Al-Tayeb 2017-09-06 09:23:59 UTC
/libgnome-desktop/test-desktop-thumbnail ./back.jpg ../back-thumb.jpb

(process:10156): GnomeDesktop-WARNING **: gnome_desktop_thumbnail_factory_generate_thumbnail() failed to generate a thumbnail for ./back.jpg

The failure is regardless of the format. I use Arch Linux but I compile personal gnome packages because Arch only provides release packages.

Now with changing "#if 0" to "#if 1" in gnome_desktop_thumbnail_script_exec():

./libgnome-desktop/test-desktop-thumbnail ./back.jpg ../back-thumb.jpb
About to launch script: bwrap --ro-bind /usr /usr --proc /proc --dev /dev --symlink usr/lib /lib --symlink usr/lib64 /lib64 --symlink usr/bin /bin --symlink usr/sbin /sbin --chdir / --setenv GIO_USE_VFS local --unshare-all --die-with-parent --bind /tmp/gnome-desktop-thumbnailer-4Y605Y /tmp --ro-bind /home/hussam/cache/gnome/gnome-desktop/src/gnome-desktop/back.jpg /tmp/gnome-desktop-file-to-thumbnail.jpg --seccomp 8 /usr/bin/gdk-pixbuf-thumbnailer -s 256 /tmp/gnome-desktop-file-to-thumbnail.jpg /tmp/gnome-desktop-thumbnailer.png 

(process:14020): GnomeDesktop-WARNING **: gnome_desktop_thumbnail_factory_generate_thumbnail() failed to generate a thumbnail for ./back.jpg
Comment 3 Bastien Nocera 2017-09-06 09:31:43 UTC
Could you try running:
mkdir /tmp/gnome-desktop-thumbnailer-4Y605Y

Followed by:

bwrap --ro-bind /usr /usr --proc /proc --dev /dev --symlink usr/lib /lib --symlink usr/lib64 /lib64 --symlink usr/bin /bin --symlink usr/sbin /sbin --chdir / --setenv GIO_USE_VFS local --unshare-all --die-with-parent --bind /tmp/gnome-desktop-thumbnailer-4Y605Y /tmp --ro-bind /home/hussam/cache/gnome/gnome-desktop/src/gnome-desktop/back.jpg /tmp/gnome-desktop-file-to-thumbnail.jpg /usr/bin/gdk-pixbuf-thumbnailer -s 256 /tmp/gnome-desktop-file-to-thumbnail.jpg /tmp/gnome-desktop-thumbnailer.png 

(That's the same command but without seccomp)
Comment 4 Hussam Al-Tayeb 2017-09-06 09:35:22 UTC
Ok, I reinstalled bubblewrap with --with-priv-mode=setuid (seems I wasn't using that option).

Now. .jpeg, .pdf, and totem work.
I'm checking why the rest won't work.
Comment 5 Hussam Al-Tayeb 2017-09-06 09:42:47 UTC
gsk-office.thumbnailer is failing still.
Exec=gsf-office-thumbnailer -i %i -o %o -s %s
Comment 6 Bastien Nocera 2017-09-06 09:43:50 UTC
With what error?
Comment 7 Bastien Nocera 2017-09-06 10:06:24 UTC
(In reply to Hussam Al-Tayeb from comment #4)
> Ok, I reinstalled bubblewrap with --with-priv-mode=setuid (seems I wasn't
> using that option).

I've filed this:
https://github.com/projectatomic/bubblewrap/issues/213

It's possible to install bwrap in a way that won't run. That's why there's distributions ;)
Comment 8 Bastien Nocera 2017-09-06 11:35:13 UTC
Created attachment 359257 [details] [review]
thumbnail: Add debug when loading an image file fails
Comment 9 Bastien Nocera 2017-09-06 11:35:19 UTC
Created attachment 359258 [details] [review]
thumbnail: Fix gsf-office-thumbnailer not working

The gsf-office-thumbnailer expects a local file path to be passed, but
instead of treating one of expand_thumbnailing_elem()'s arguments as a
local path (which it is), we treated it as a URI and tried to convert it
to a URI.

That obviously failed, and the thumbnailer wasn't even launched.
Comment 10 Bastien Nocera 2017-09-06 11:36:39 UTC
Attachment 359257 [details] pushed as d0575a3 - thumbnail: Add debug when loading an image file fails
Attachment 359258 [details] pushed as 26b1b55 - thumbnail: Fix gsf-office-thumbnailer not working