The discussion revolves around the issue of logo upload not working after restoring a Discourse instance from a backup. aksiksi encountered the problem and initially thought it was an intermittent issue, but it persisted.
After investigation, aksiksi discovered that the issue was due to most images not being correctly restored from the backup during the restore operation. The solution involved manually extracting the tarball and copying over the missing images into the Discourse uploads directory.
The analysis revealed that the image upload seemed to work fine, but the subsequent GET request to display the uploaded image resulted in a 404 error due to the image not being present in the uploads directory. The backup tarball contained the images, but they were not copied over correctly during the restore operation.
I created a new Discourse instance on a different domain and restored it from backup. Everything went through smoothly. However, none of the logos appeared (all blank, not default). So, I went ahead and used the Branding menu to try to re-upload the logos.
Here is the Discourse log from uploading a new logo:
New : /uploads/default/original/1X/75a192f211147f512bdddabaf50addd43c6a9d86.png Previous : /images/discourse-logo-sketch.png
But, when I check my uploads directory, that particular image does not exist:
/var/discourse# tree shared/standalone/uploads/default/ | grep 75a1
Note that this incorrect logo filename (hash?) matches the one from the original Discord instance which is still online:
New : /uploads/default/original/1X/75a192f211147f512bdddabaf50addd43c6a9d86.png
Any clue what went wrong here? Should I create a new instance and restore that from a fresh backup?
Just an update on this. I ended up creating a new instance today and the logos were restored fine from backup. It was probably some kind of intermittent issue.
Scratch that, I’ve hit the issue again… So, the logo images worked fine until I cleared my browser cache.
Solution
The root cause was that most of the images were not correctly restored from the backup during the restore operation. I was able to solve the issue by manually extracting the tarball and copying over the missing images into the Discourse uploads directory.
Analysis
When I try to upload a new logo, I see the following: