Uploaded emojis lost with last update?

On two forums I host, I’ve had an issue, all emojis uploaded on admin panel were lost. They were still on the FTP but seemed to have disappeared on the database.

Here is the version where it happened : Discourse 1.8.0.beta7 - https://github.com/discourse/discourse version 61a7162c01daf22d0f759a4c5d4e0974776fab0d

I reuploaded emojis on the two forums and the issue disappeared (for now), and I don’t see anything relevant on /logs page

Meta Discourse doesn’t seem to be affected, so I should notice that for these two forum use a custom plugin based on this one : https://github.com/discourse/discourse-emoji

(I use it to organize flags, so they are not mixed with gifs or meme)

Is it something you’ve been aware of ?

I believe we stored custom emoji in a weird and unsustainable way in the past, and that was fixed by @tgxworld?

If it helps, my previous upgrade was pretty recent too. I think It was the day before. I never had any issue like that before today.

It’s not that big a deal, it took only a few minutes to reupload them in the customize section, but I find it odd that they disappeared like that. And if it doesn’t happen again, it’ll not affect a lot of people.

1 Like

I recently introduced a commit to store custom emoji uploads properly in the uploads table. The good news is the emojis are not lost because they’ll still be in /var/www/discourse/public/uploads/_emojis. The bad news is the job to migrate custom emojis is probably erroring out and is taking a migrate all or nothing approach. Hmm an error should have been raised in the logs though. Otherwise, can you try running

Jobs::MigrateCustomEmojis.new.execute_onceoff({})

and see what it returns?

3 Likes

It failed the first time because I uploaded the emojis earlier. I deleted them on the admin panel, try the command and it went well.

The emojis were automatically added again

root@vps00000:~# cd /var/discourse
root@vps00000:/var/discourse# ./launcher enter app
root@vps00000-app:/var/www/discourse# rails c
[1] pry(main)> Jobs::MigrateCustomEmojis.new.execute_onceoff({})
convert: delegate library support not built-in `/var/www/discourse/public/uploads/default/_emoji/1.png' (LCMS) @ warning/profile.c/ProfileImage/813.
convert: delegate library support not built-in `/var/www/discourse/public/uploads/default/_emoji/0.png' (LCMS) @ warning/profile.c/ProfileImage/813.
convert: delegate library support not built-in `/var/www/discourse/public/uploads/default/_emoji/fragile.png' (LCMS) @ warning/profile.c/ProfileImage/813.
=> nil
[2] pry(main)> exit

Thanks !

If it happens again, I’ll know how to fix it quickly

Anyway I’ve fixed it such that we don’t take a all or nothing approach. We’ll just warn the user about the errors in the logs.

https://github.com/discourse/discourse/commit/566f367fc347617f3feb908257c6ed925d0e2577

4 Likes