Uploaded emojis lost with last update?

AI-generated summary

In the ‘Bug’ category, Steven reported an issue where custom emojis disappeared from the admin panel after upgrading to Discourse 1.8.0.beta7, despite the files remaining on the FTP. He noted the issue occurred on two forums using a custom emoji plugin and that Meta Discourse was unaffected. codinghorror suggested this was due to a previously unstable storage method for custom emojis. tgxworld confirmed that a recent commit changed how uploads are stored but that the migration job was likely failing with an all-or-nothing approach.

Steven attempted to resolve the issue manually by deleting and re-uploading emojis, then running the Jobs::MigrateCustomEmojis command via the Rails console. The command succeeded in restoring the emojis but produced several warnings about missing delegate library support for image processing. tgxworld subsequently released a fix at 566f367 to prevent the job from failing entirely, ensuring that if errors occur, the system logs warnings rather than rolling back all migrations.

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 Mi Piace

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 Mi Piace

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 Mi Piace