V8-archive: Thumbnailer not working on the demo

Created on 27 Mar 2019  Â·  13Comments  Â·  Source: directus/v8-archive

Bug Report

Steps to Reproduce

  1. Login to https://directus.app/#/files and and see that no thumbnails are shown.

Expected Behavior

Thumbnails should be shown.

Actual Behavior

No thumbnails are shown, and they return 404 errors.

Other Context & Screenshots

We are trying to set up the thumbnailer locally and not having great success, getting 404s.

Technical Details

Directus API 2.0.18 Docker (this is not latest- however the issue persists on directus.app)

bug

Most helpful comment

I can confirm this is the case with the latest release 2.0.20 too. Thank you @computerwizjared for reporting. @bjgajjar can we have a quick look on this?

All 13 comments

I can confirm this is the case with the latest release 2.0.20 too. Thank you @computerwizjared for reporting. @bjgajjar can we have a quick look on this?

sometimes when you restart apache they start to work. It's something very unstable right now.

Okay, so @bjgajjar drilled down the issue and it seems that issue is with server configuration specifically for nginx.

The thumbnailer works independently from the public/thumbnails path. Now the directory has .htaccess file which handles the redirection and executes index.php file inside it. So it works fine for Apache servers.

When it comes to nginx, the redirection doesn't work & file is being handled via Slim framework. The router config is not written for that path as it is independent of Slim & thumbnails are not generated. We can configure ngnix to handle requests like this. @computerwizjared can you confirm you're using nginx & this works for you?

location /thumbnail/ {
    rewrite /thumbnail/ /thumbnail/index.php;
}
location ^/thumbnail/index.php(/.*)?$ {
    fastcgi_split_path_info ^(/thumbnail/index.php)(/.*)$;
    fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    fastcgi_index  index.php;
    include fastcgi_params;
}

@benhaynes @rijkvanzanten I had a question regarding this special case of handling thumbnails! Is there any specific need to keeping thumbnail outside of Slim? Because of this, we have to be dependent on server configuration. I & @bjgajjar are thinking if we can handle it inside slim so it can be independent of server configuration.

Is there any specific need to keeping thumbnail outside of Slim

I would say one of the main reasons is to keep control of images in one location — This means you can CDN all images if you decide to host them externally such as AWS.

@theharshin I'm going to try this out and get back to you shortly.
@shealavington We're using the Flysystem adapter for S3, could that be part of the issue?

@theharshin I tried your changes however now I am getting {"error":{"error":8,"message":"API Environment Configuration Not Found: thumbnail"}} instead of just a 404. Looks like #577 and/or directus/docker#10.
Before, I was using the directus/docker default nginx config: https://github.com/directus/docker/blob/master/projects/api/rootfs/etc/nginx/conf.d/default.conf.

Any thoughts? Thank you!

@computerwizjared

You need to restart you server/nginx once you made changes to nginx file.

@bjgajjar I'm aware- thanks. I use Directus Docker so it restarts Nginx with each change.

Do you know by chance why the Directus demo site thumbnailer isn't working?

Uploading to the demo gives a Missing Storage Configuration...

@rijkvanzanten @bjgajjar — any ideas why this is happening? Can we get it fixed and confirm things are working?

~I see that question a lot @Benhaynes , people wondering why uploads don't work on the demo, it seems correct to not allow people to complete that action. — I can't imagine you'd like people randomly uploading files to the demo server, littering files.~ 😂

I think I may have misunderstood actually haha, it's specifically asking about the thumbnailer for existing files.

Both the files and thumbnails should be working on the demo now.

@benhaynes I'm not showing any thumbnails on the demo- thoughts? Just getting 404s when loading the file library.

I spend some time reconfiguring the symlinks between the "canary" and "stable" demos. They should sync up nicely now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rijkvanzanten picture rijkvanzanten  Â·  3Comments

cdwmhcc picture cdwmhcc  Â·  3Comments

ondronix picture ondronix  Â·  3Comments

andgar2010 picture andgar2010  Â·  3Comments

benhaynes picture benhaynes  Â·  4Comments