# Immagini rotte spostate al tombstone

**URL:** https://meta.discourse.org/t/broken-images-move-to-tombstone/117779
**Category:** Support
**Created:** [15 Maggio 2019, 8:04am UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779 "2019-05-15T08:04:43Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![appcomqa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/appcomqa/32/133414_2.png) [@appcomqa](https://meta.discourse.org/u/appcomqa)
#### Post date: [15 Maggio 2019, 8:04am UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/1 "2019-05-15T08:04:43Z")

</div>

Hi,

My discourse forum lost 10% images, just show ..

![image](https://global.discourse-cdn.com/meta/original/3X/b/5/b590fce871fb9e10b9c414455db8c64c094718f7.png)

1. broken images on `/var/www/discourse/public/uploads/tombstone` and I have copy tombstone to `/var/www/discourse/public/uploads/default.`

2. I have use `rake uploads:recover_from_tombstone` and `rake posts:missing_uploads` Does not work.

3. [How to find any missing images? - #3 by tgxworld](https://meta.discourse.org/t/how-to-find-any-missing-images/115672/3) not work.

Have any help?

---

<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: [16 Maggio 2019, 4:59am UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/2 "2019-05-16T04:59:10Z")

</div>

Any advice @vinothkannans?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [16 Maggio 2019, 6:20am UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/3 "2019-05-16T06:20:29Z")

</div>

> [@How to find any missing images?](https://meta.discourse.org/t/how-to-find-any-missing-images/115672/12):
>
> If you run the below command in rails console then you can get the list of missing uploads. PostCustomField.where(name: Post::MISSING\_UPLOADS)

Are you sure about the existence of missing uploads in tombstone?

---

<div class="post-metadata">

### Author: ![appcomqa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/appcomqa/32/133414_2.png) [@appcomqa](https://meta.discourse.org/u/appcomqa)
#### Post date: [16 Maggio 2019, 6:50am UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/4 "2019-05-16T06:50:56Z")

</div>

I am sure the image is in the `tombstone` directory.

Eg:

`https://www.example.net/uploads/default/original/4X/1/3/f/13f5a8a1b636146333dacccecf1a98dda9facc71.jpeg`

404 Error.

* * *

`https://cdn.example.net/uploads/default/original/4X/3/4/6/3467394a5f188e390e108a0275335d08bd949d2f.png`

200 //have CDN cache Hit.

* * *

`https://www.example.net/uploads/tombstone/default/original/4X/1/3/f/13f5a8a1b636146333dacccecf1a98dda9facc71.jpeg`

200 // in `tombstone` directory.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [16 Maggio 2019, 6:56am UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/5 "2019-05-16T06:56:27Z")

</div>

`rake uploads:recover_from_tombstone` method should work here. May I know the post url which have missing uploads?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [17 Maggio 2019, 4:09am UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/6 "2019-05-17T04:09:05Z")

</div>

I pushed the below commit to resolve this problem.

[https://github.com/discourse/discourse/commit/0e677daaee3422ac056c3dac1b5bd23a53c4efc2](https://github.com/discourse/discourse/commit/0e677daaee3422ac056c3dac1b5bd23a53c4efc2)

---

<div class="post-metadata">

### Author: ![Lure](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lure/32/130462_2.png) [@Lure](https://meta.discourse.org/u/Lure)
#### Post date: [18 Maggio 2019, 4:34am UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/7 "2019-05-18T04:34:51Z")

</div>

As I am hunting issue with [disappearing thumbnails of Topic List Previews plugin](https://meta.discourse.org/t/topic-list-previews/101646/439), I have tried if you fix helps for my issue, but it does not.

Why are images moved in tombstone at the first place? Any idea why external images (onebox, youtube preview…) thumbnails would be moved to tombstone?

---

<div class="post-metadata">

### Author: ![appcomqa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/appcomqa/32/133414_2.png) [@appcomqa](https://meta.discourse.org/u/appcomqa)
#### Post date: [20 Maggio 2019, 5:07pm UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/13 "2019-05-20T17:07:10Z")

</div>

I have use `rake posts:rebake`

now, all images showing blank, only load `transparent.png`

I noticed that the all broken images post id \> 250,000 (/p/250000)

```
# rake uploads:recover
W, [2019-05-20T12:31:35.997317 #15886] WARN -- : Bad date/time value "2019:05:04 24:10:25": min out of range
W, [2019-05-20T12:31:36.876860 #15886] WARN -- : Bad date/time value "2019:05:04 24:10:25": min out of range

W, [2019-05-20T17:01:52.418659 #15886] WARN -- : Bad date/time value "2019:05:05 24:08:20": min out of range
W, [2019-05-20T17:01:53.266267 #15886] WARN -- : Bad date/time value "2019:05:05 24:08:20": min out of range
W, [2019-05-20T17:01:54.631988 #15886] WARN -- : Bad date/time value "2019:05:05 24:08:48": min out of range
W, [2019-05-20T17:01:55.350312 #15886] WARN -- : Bad date/time value "2019:05:05 24:08:48": min out of range
W, [2019-05-20T17:01:56.605504 #15886] WARN -- : Bad date/time value "2019:05:05 24:09:18": min out of range
W, [2019-05-20T17:01:57.055881 #15886] WARN -- : Bad date/time value "2019:05:05 24:09:18": min out of range
W, [2019-05-20T17:01:58.983880 #15886] WARN -- : Bad date/time value "2019:05:05 24:09:43": min out of range
W, [2019-05-20T17:01:59.740514 #15886] WARN -- : Bad date/time value "2019:05:05 24:09:43": min out of range
W, [2019-05-20T17:02:43.100099 #15886] WARN -- : Bad date/time value "2019:05:05 24:10:11": min out of range
W, [2019-05-20T17:02:43.741339 #15886] WARN -- : Bad date/time value "2019:05:05 24:10:11": min out of range
W, [2019-05-20T17:02:45.227477 #15886] WARN -- : Bad date/time value "2019:05:05 24:10:33": min out of range
W, [2019-05-20T17:02:45.813161 #15886] WARN -- : Bad date/time value "2019:05:05 24:10:33": min out of range
W, [2019-05-20T17:02:47.525792 #15886] WARN -- : Bad date/time value "2019:05:05 24:11:06": min out of range
W, [2019-05-20T17:02:48.099365 #15886] WARN -- : Bad date/time value "2019:05:05 24:11:06": min out of range
W, [2019-05-20T17:02:49.861304 #15886] WARN -- : Bad date/time value "2019:05:05 24:11:32": min out of range
W, [2019-05-20T17:02:50.574582 #15886] WARN -- : Bad date/time value "2019:05:05 24:11:32": min out of range
W, [2019-05-20T17:02:51.938176 #15886] WARN -- : Bad date/time value "2019:05:05 24:12:10": min out of range
W, [2019-05-20T17:02:52.450379 #15886] WARN -- : Bad date/time value "2019:05:05 24:12:10": min out of range
W, [2019-05-20T17:03:28.912249 #15886] WARN -- : Bad date/time value "2019:05:05 24:12:41": min out of range
W, [2019-05-20T17:03:29.395251 #15886] WARN -- : Bad date/time value "2019:05:05 24:12:41": min out of range
W, [2019-05-20T17:03:31.213862 #15886] WARN -- : Bad date/time value "2019:05:05 24:13:10": min out of range
W, [2019-05-20T17:03:31.847879 #15886] WARN -- : Bad date/time value "2019:05:05 24:13:10": min out of range
W, [2019-05-20T17:03:33.291672 #15886] WARN -- : Bad date/time value "2019:05:05 24:13:32": min out of range
W, [2019-05-20T17:03:33.888436 #15886] WARN -- : Bad date/time value "2019:05:05 24:13:32": min out of range
W, [2019-05-20T17:03:35.497848 #15886] WARN -- : Bad date/time value "2019:05:05 24:13:58": min out of range
W, [2019-05-20T17:03:36.206498 #15886] WARN -- : Bad date/time value "2019:05:05 24:13:58": min out of range
W, [2019-05-20T17:03:37.458976 #15886] WARN -- : Bad date/time value "2019:05:05 24:14:28": min out of range
W, [2019-05-20T17:03:37.976304 #15886] WARN -- : Bad date/time value "2019:05:05 24:14:28": min out of range
W, [2019-05-20T17:04:01.443087 #15886] WARN -- : Bad date/time value "2019:05:05 24:14:54": min out of range
W, [2019-05-20T17:04:01.908416 #15886] WARN -- : Bad date/time value "2019:05:05 24:14:54": min out of range
W, [2019-05-20T17:04:03.828456 #15886] WARN -- : Bad date/time value "2019:05:05 24:15:16": min out of range
W, [2019-05-20T17:04:04.711269 #15886] WARN -- : Bad date/time value "2019:05:05 24:15:16": min out of range
W, [2019-05-20T17:04:06.086656 #15886] WARN -- : Bad date/time value "2019:05:05 24:15:52": min out of range
W, [2019-05-20T17:04:06.908895 #15886] WARN -- : Bad date/time value "2019:05:05 24:15:52": min out of range
W, [2019-05-20T17:04:08.577760 #15886] WARN -- : Bad date/time value "2019:05:05 24:16:21": min out of range
W, [2019-05-20T17:04:09.094158 #15886] WARN -- : Bad date/time value "2019:05:05 24:16:21": min out of range
W, [2019-05-20T17:04:10.810286 #15886] WARN -- : Bad date/time value "2019:05:05 24:16:55": min out of range
W, [2019-05-20T17:04:11.256830 #15886] WARN -- : Bad date/time value "2019:05:05 24:16:55": min out of range
W, [2019-05-20T17:04:44.181617 #15886] WARN -- : Bad date/time value "2019:05:05 24:17:23": min out of range
W, [2019-05-20T17:04:44.671349 #15886] WARN -- : Bad date/time value "2019:05:05 24:17:23": min out of range
W, [2019-05-20T17:04:46.344635 #15886] WARN -- : Bad date/time value "2019:05:05 24:17:49": min out of range
W, [2019-05-20T17:04:46.878684 #15886] WARN -- : Bad date/time value "2019:05:05 24:17:49": min out of range
W, [2019-05-20T17:04:48.606346 #15886] WARN -- : Bad date/time value "2019:05:05 24:18:13": min out of range
W, [2019-05-20T17:04:49.435557 #15886] WARN -- : Bad date/time value "2019:05:05 24:18:13": min out of range
W, [2019-05-20T17:04:50.683006 #15886] WARN -- : Bad date/time value "2019:05:05 24:18:56": min out of range
W, [2019-05-20T17:04:51.231679 #15886] WARN -- : Bad date/time value "2019:05:05 24:18:56": min out of range
W, [2019-05-20T17:04:52.954892 #15886] WARN -- : Bad date/time value "2019:05:05 24:19:23": min out of range
W, [2019-05-20T17:04:53.696249 #15886] WARN -- : Bad date/time value "2019:05:05 24:19:23": min out of range
W, [2019-05-20T17:05:05.890965 #15886] WARN -- : Bad date/time value "2019:05:05 24:19:47": min out of range
W, [2019-05-20T17:05:06.473206 #15886] WARN -- : Bad date/time value "2019:05:05 24:19:47": min out of range

```

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [21 Maggio 2019, 3:47pm UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/14 "2019-05-21T15:47:22Z")

</div>

> [@Lure](#):
>
> Why are images moved in tombstone at the first place?

Looks like [topic-previews plugin](https://meta.discourse.org/t/topic-list-previews/101646) adds `PostUpload` record in [`update_post_image`](https://github.com/angusmcleod/discourse-topic-previews/blob/master/lib/cooked_post_processor_edits.rb#L76-L81) method. But after that [`link_post_uploads`](https://github.com/discourse/discourse/blob/0e677daaee3422ac056c3dac1b5bd23a53c4efc2/app/models/post.rb#L873-L878) method removes all existing post\_uploads before re-generating it. [This change](https://github.com/discourse/discourse/commit/434035f167eb15f3e2d8c6a52577d66d0e140b71) in the core triggered this issue. I think the plugin code must handle this to prevent image losses.

@appcomqa do you have any custom plugins installed? And are you in the latest version of Discourse?

---

<div class="post-metadata">

### Author: ![Lure](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lure/32/130462_2.png) [@Lure](https://meta.discourse.org/u/Lure)
#### Post date: [22 Maggio 2019, 2:38pm UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/15 "2019-05-22T14:38:09Z")

</div>

@vinothkannans thanks, will get attention of TLP developers if they can address this properly in plugin.  
Cc: @merefield, @angus

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [22 Maggio 2019, 2:38pm UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/16 "2019-05-22T14:38:56Z")

</div>

Got my attention. Thanks a lot. I’ll try to get a fix out.

---

<div class="post-metadata">

### Author: ![appcomqa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/appcomqa/32/133414_2.png) [@appcomqa](https://meta.discourse.org/u/appcomqa)
#### Post date: [22 Maggio 2019, 11:11pm UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/17 "2019-05-22T23:11:50Z")

</div>

> [@vinothkannans](#):
>
> do you have any custom plugins installed? And are you in the latest version of Discourse?

no have plugin, and latest version `tests-passed`

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [24 Maggio 2019, 4:38pm UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/18 "2019-05-24T16:38:03Z")

</div>

The TLP issue fix is now a plugin PR. It needs a little more testing and review before merging.

My strategy was to create a new custom field on the Post object to temporarily store the id of the thumbnail upload in `update_post_image` (instead of committing it to the PostUploads table straightaway), then it is added in to the collection of upload id’s in an overridden version of `link_post_uploads` and committed to the database there as is currently done.

This strategy retains the transactional integrity of the core code.

There is a much lower risk now the thumbnails will be deleted.

[https://github.com/angusmcleod/discourse-topic-previews/pull/90](https://github.com/angusmcleod/discourse-topic-previews/pull/90)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [12 Ottobre 2022, 7:22pm UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/19 "2022-10-12T19:22:07Z")

</div>



---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [12 Ottobre 2022, 7:42pm UTC](https://meta.discourse.org/t/broken-images-move-to-tombstone/117779/20 "2022-10-12T19:42:37Z")

</div>


