# Uploaded emojis lost with last update?

**URL:** https://meta.discourse.org/t/uploaded-emojis-lost-with-last-update/59306
**Category:** Bug
**Created:** [2017年三月16日 20:07 UTC](https://meta.discourse.org/t/uploaded-emojis-lost-with-last-update/59306 "2017-03-16T20:07:49Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [2017年三月16日 20:07 UTC](https://meta.discourse.org/t/uploaded-emojis-lost-with-last-update/59306/1 "2017-03-16T20:07:49Z")

</div>

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](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 ?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017年三月16日 20:37 UTC](https://meta.discourse.org/t/uploaded-emojis-lost-with-last-update/59306/2 "2017-03-16T20:37:20Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [2017年三月16日 23:05 UTC](https://meta.discourse.org/t/uploaded-emojis-lost-with-last-update/59306/5 "2017-03-16T23:05:27Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [2017年三月16日 23:35 UTC](https://meta.discourse.org/t/uploaded-emojis-lost-with-last-update/59306/6 "2017-03-16T23:35:39Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [2017年三月17日 00:14 UTC](https://meta.discourse.org/t/uploaded-emojis-lost-with-last-update/59306/7 "2017-03-17T00:14:57Z")

</div>

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

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [2017年三月17日 00:32 UTC](https://meta.discourse.org/t/uploaded-emojis-lost-with-last-update/59306/8 "2017-03-17T00:32:27Z")

</div>

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](https://github.com/discourse/discourse/commit/566f367fc347617f3feb908257c6ed925d0e2577)

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [2017年三月20日 08:16 UTC](https://meta.discourse.org/t/uploaded-emojis-lost-with-last-update/59306/9 "2017-03-20T08:16:06Z")

</div>


