# Uploads:recover\_from\_tombstone not resurrecting images

**URL:** <https://meta.discourse.org/t/uploads-recover-from-tombstone-not-resurrecting-images/78295>\
**Category:** Bug\
**Created:** [17.Январь.2018 15:58:29 UTC](https://meta.discourse.org/t/uploads-recover-from-tombstone-not-resurrecting-images/78295 "2018-01-17T15:58:29Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Curtis\_Rueden](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/curtis_rueden/32/84277_2.png) [@Curtis\_Rueden](https://meta.discourse.org/u/Curtis_Rueden)\
**Post date:** [17.Январь.2018 15:58:29 UTC](https://meta.discourse.org/t/uploads-recover-from-tombstone-not-resurrecting-images/78295/1 "2018-01-17T15:58:29Z")

</div>

## Summary

I believe the `uploads:recover_from_tombstone` script is not restoring everything it should from the tombstone. My reasoning is as follows:

Recently, our Discourse forum had a problem where uploaded images would no longer appear:

> **[Inability to see images since Dec 30](https://forum.image.sc/t/inability-to-see-images-since-dec-30/8629)**
>
> Hello! Is anyone else having problems viewing some of the images? For example, I can’t see @quokka79 or @Paul\_Guichard’s logos. I’ve tried using chrome and firefox on linux and mac, but they don’t appear. I also did a hard refresh and cleared my...

And [here](http://forum.imagej.net/t/contest-new-imagej-logo/8485/16) is an example topic illustrating the issue.

## Description

The problem began around December 30. I investigated yesterday, and events unfolded as follows:

1. I upgraded to the latest version of Discourse (v2.0.0.beta1 +123) hoping it would magically fix the issue. But sadly not.

2. We noticed that automatic backup was stuck in a pending state since two weeks. I canceled it via the web interface.

3. I noticed Sidekiq was clogged with a huge number (\>200,000) of pending jobs—mainly digest mails. Jobs were being processed, but the queue was growing too fast to keep up. I decided to go for the [nuclear option](https://meta.discourse.org/t/sidekiq-queue-keeps-growing/58956/15) and `flushall`. Since then, the Sidekiq queue has been under control.

4. I saw that the broken images still had `src="transparent.png"` and `data-orig-src="upload://..."`. I tried to run the `uploads:recover_from_tombstone` script (described [here](https://meta.discourse.org/t/old-image-uploads-become-broken-images/47236/2)) to see if it could fix things, but the problem persisted.

5. I did some digging to find out whether the missing images were really gone:

6. I tried running `rake:recover_from_tombstone` again today; here is the abbreviated output:

## Questions

1. _ **Is this a bug or limitation of the recovery script?** _ Looking at [the source of that routine](https://github.com/discourse/discourse/blob/v2.0.0.beta1/lib/tasks/uploads.rake#L393-L463), I guess it only checks the `src` of each `img` and does not look at any `data-orig-src` attribute? Should it? Apologies if I am misreading things; my Ruby-fu is very weak.

2. _ **How should I proceed to fix my forum?** _ I read on other threads that it is best not to manually copy things out of the tombstone. I am concerned that if I don’t fix this before Friday—when we migrate to hosted Discourse, woohoo! 🎆—these images will be permanently lost.

3. _ **Is it normal that even since yesterday, some additional images were recovered from the tombstone today?** _ Is this typical? Or is it indicative of some other bug? How can I check?

4. _ **Why are these images ending up in the tombstone in the first place?** _ Is there an outstanding bug here? Should I have been [disabling Sidekiq during upgrades](https://meta.discourse.org/t/old-image-uploads-become-broken-images/47236/5)?

---

_[View the full topic](https://meta.discourse.org/t/uploads-recover-from-tombstone-not-resurrecting-images/78295)._
