# Imported images missing thumbnails, getting tombstoned

**URL:** https://meta.discourse.org/t/imported-images-missing-thumbnails-getting-tombstoned/85011
**Category:** Development
**Created:** [10.Апрель.2018 18:58:01 UTC](https://meta.discourse.org/t/imported-images-missing-thumbnails-getting-tombstoned/85011 "2018-04-10T18:58:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [10.Апрель.2018 18:58:01 UTC](https://meta.discourse.org/t/imported-images-missing-thumbnails-getting-tombstoned/85011/1 "2018-04-10T18:58:01Z")

</div>

Continuing the discussion from [My journey into a massive posts rebake job](https://meta.discourse.org/t/my-journey-into-a-massive-posts-rebake-job/84816):

So I’ve been working on this import for a [community that really likes lots of really huge images](https://blenderartists.org/forum/). There are about 160GB of images.

After the import images were getting moved to tombstone. Also, even when the images are un-tombstoned and posts rebaked, they still aren’t getting thumbnails generated.

One thing that I’m wondering about is that `embedded_image_html` (in `script/import_scripts/base/uploader.rb`), generates

```
<img src="#{upload.url}" width="#{image_width}" height="#{image_height}"><br/>

```

rather than the “new style”

```
![discourse-custom|350x349](upload://p8qkAX4eV6X5fkq8N57DKqINJDN.png)

```

@bartv has noticed that there are no entries in (I think) `post_uploads` or `optimized_images` tables.

I’ve looked at the upload model and `lib/upload_creator.rb`. I can’t find what moves things to tombstone.

@zogstrip or @gerhard. . . Is it possible that including images with the HTML style image links is causing them to get tombstoned and/or not get thumbnails generated?

---

<div class="post-metadata">

### Author: ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)
#### Post date: [10.Апрель.2018 19:05:53 UTC](https://meta.discourse.org/t/imported-images-missing-thumbnails-getting-tombstoned/85011/2 "2018-04-10T19:05:53Z")

</div>

Correct; in addition, the attachments aren’t in the uploads table either; I only find avatar images there.

I haven’t spent too much time with the untombstone process as it’s _very_ slow for our site - well over 30 seconds per attachment, and we have over 400k images in the tombstone directory. Instead of running untombstone, we moved all the files in the tombstone directory back to the original directory.

Rather than relying on such a fix, we’re aiming to get the data into the database correctly in the first place.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [18.Апрель.2018 23:53:10 UTC](https://meta.discourse.org/t/imported-images-missing-thumbnails-getting-tombstoned/85011/4 "2018-04-18T23:53:10Z")

</div>

I’ve added a `post.rebake!` After the `post.update` in the import script. I don’t know if that’ll help.

Also, Bart’s copy of the database was taken before sidekiq had finished. It was meant to be a test that there wouldn’t be a problem with the restore. But my copy did leave sidekiq running. Could it be that images got tombstoned before sidekiq could process them?

(and if so, turning off having discobot send a message to every user imported is probably a good default.)

The real problem with the recover\_from\_tombstone rake task is that every image gets a linear search of the database.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [15.Май.2019 21:20:11 UTC](https://meta.discourse.org/t/imported-images-missing-thumbnails-getting-tombstoned/85011/5 "2019-05-15T21:20:11Z")

</div>

Did you get it all sorted? @tgxworld and @vinothkannans have made some huge improvements and bug fixes in that departement recenlty.
