YunoHost-Apps / discourse_ynh

Discourse package for YunoHost
https://www.discourse.org/
GNU General Public License v2.0
24 stars 12 forks source link

Missing images after backup restore #105

Closed artybdrlt closed 2 years ago

artybdrlt commented 2 years ago

Describe the bug

Hi, When I try to install a new Discourse instance on a VPS / ProxMox VM, I always install some plugins. As far as everything is new on this instance, images can be uploaded and are displayed as expected. However, as soon as I perform a backup restoration, everything is restored with categories, layout, posts... but images / thumbnails are also restored but displayed as white cards, like they are missing. I have found two things that explain why this issue is happening:

When I checked nginx-access logs I could see rightaway that nginx couldn't access pictures. As soon as I run chmod 750 /var/www/discourse/public/uploads/default/original pictures were displayed successfully. As a conclusion, I don't really know if this issue is Discourse-related or Yunohost-related.

Context

Logs

A little part of /var/log/nginx/*****.fr-error.log

2022/02/14 10:56:29 [crit] 11936#11936: *450 stat() "/var/www/discourse/public/uploads/default/original/1X/5e868b83073119fc5d275d8f2f36ef4737f315c2.png" failed (13: Permission denied), client: 10.0.7.2, server: forum.dev.lydra.fr, request: "GET /uploads/default/original/1X/5e868b83073119fc5d275d8f2f36ef4737f315c2.png HTTP/2.0", host: "forum.dev.lydra.fr", referrer: "https://forum.dev.lydra.fr/"
2022/02/14 10:56:29 [crit] 11936#11936: *450 stat() "/var/www/discourse/public/uploads/default/original/1X/87161989147ee773e97364c1a5dfec084580c92e.png" failed (13: Permission denied), client: 10.0.7.2, server: forum.dev.lydra.fr, request: "GET /uploads/default/original/1X/87161989147ee773e97364c1a5dfec084580c92e.png HTTP/2.0", host: "forum.dev.lydra.fr", referrer: "https://forum.dev.lydra.fr/"
2022/02/14 10:56:29 [crit] 11936#11936: *450 stat() "/var/www/discourse/public/uploads/default/original/1X/2443b25857d65a672b755be1aab91f618e3a0837.png" failed (13: Permission denied), client: 10.0.7.2, server: forum.dev.lydra.fr, request: "GET /uploads/default/original/1X/2443b25857d65a672b755be1aab91f618e3a0837.png HTTP/2.0", host: "forum.dev.lydra.fr", referrer: "https://forum.dev.lydra.fr/"
2022/02/14 10:56:29 [crit] 11936#11936: *450 stat() "/var/www/discourse/public/uploads/default/original/1X/0c9a6316e812051976aa3799a1c0d2e0410f22da.png" failed (13: Permission denied), client: 10.0.7.2, server: forum.dev.lydra.fr, request: "GET /uploads/default/original/1X/0c9a6316e812051976aa3799a1c0d2e0410f22da.png HTTP/2.0", host: "forum.dev.lydra.fr", referrer: "https://forum.dev.lydra.fr/"
2022/02/14 10:56:29 [crit] 11936#11936: *450 stat() "/var/www/discourse/public/uploads/default/original/1X/b749eb40f92f79885c4d9f8ad9bca317fe19718a.png" failed (13: Permission denied), client: 10.0.7.2, server: forum.dev.lydra.fr, request: "GET /uploads/default/original/1X/b749eb40f92f79885c4d9f8ad9bca317fe19718a.png HTTP/2.0", host: "forum.dev.lydra.fr", referrer: "https://forum.dev.lydra.fr/"
2022/02/14 11:55:35 [crit] 11936#11936: *450 stat() "/var/www/discourse/public/uploads/default/original/1X/2c0828ecef56ba913fd6a520eb8980282e54e673.png" failed (13: Permission denied), client: 10.0.7.2, server: forum.dev.lydra.fr, request: "GET /uploads/default/original/1X/2c0828ecef56ba913fd6a520eb8980282e54e673.png HTTP/2.0", host: "forum.dev.lydra.fr", referrer: "https://forum.dev.lydra.fr/c/herboristerie/9"
2022/02/14 11:55:41 [crit] 11936#11936: *450 stat() "/var/www/discourse/public/uploads/default/original/1X/2c0828ecef56ba913fd6a520eb8980282e54e673.png" failed (13: Permission denied), client: 10.0.7.2, server: forum.dev.lydra.fr, request: "GET /uploads/default/original/1X/2c0828ecef56ba913fd6a520eb8980282e54e673.png HTTP/2.0", host: "forum.dev.lydra.fr", referrer: "https://forum.dev.lydra.fr/c/herboristerie/9"
2022/02/14 11:55:43 [crit] 11936#11936: *450 stat() "/var/www/discourse/public/uploads/default/original/1X/e0edce6b571135c661ce6720684460ce1d88cc2f.jpeg" failed (13: Permission denied), client: 10.0.7.2, server: forum.dev.lydra.fr, request: "GET /uploads/default/original/1X/e0edce6b571135c661ce6720684460ce1d88cc2f.jpeg HTTP/2.0", host: "forum.dev.lydra.fr", referrer: "https://forum.dev.lydra.fr/t/le-grand-guide-de-la-medecine-energetique/38"

If applicable and useful, add screenshots to help explain your problem. image

yalh76 commented 2 years ago

restore script has been fixed in last versions