# Travis builds failing posts.cached\_version does not exist

**URL:** https://meta.discourse.org/t/travis-builds-failing-posts-cached-version-does-not-exist/150081
**Category:** Development
**Created:** [May 1, 2020, 3:42pm UTC](https://meta.discourse.org/t/travis-builds-failing-posts-cached-version-does-not-exist/150081 "2020-05-01T15:42:02Z")
**Posts on this page:** 9
**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: [May 1, 2020, 3:42pm UTC](https://meta.discourse.org/t/travis-builds-failing-posts-cached-version-does-not-exist/150081/1 "2020-05-01T15:42:02Z")

</div>

I’ve got 3 plugins that I’m doing proper travis builds for that all started failing yesterday. They are all failing like this, and I don’t see how this problem could be caused by the plugins:

```plaintext
020-05-01 00:29:58.212 UTC [334] ERROR: column posts.cached_version does not exist at character 193
2020-05-01 00:29:58.212 UTC [334] HINT: Perhaps you meant to reference the column "posts.baked_version".
2020-05-01 00:29:58.212 UTC [334] STATEMENT: SELECT "posts"."id", "posts"."user_id", "posts"."topic_id", "posts"."post_number", "posts"."raw", "posts"."cooked", "posts"."created_at", "posts"."updated_at", "posts"."reply_to_post_number", "posts"."cached_version", "posts"."reply_count", "posts"."quote_count", "posts"."deleted_at", "posts"."off_topic_count", "posts"."like_count", "posts"."incoming_link_count", "posts"."bookmark_count", "posts"."score", "posts"."reads", "posts"."post_type", "posts"."vote_count", "posts"."sort_order", "posts"."last_editor_id", "posts"."hidden", "posts"."hidden_reason_id", "posts"."notify_moderators_count", "posts"."spam_count", "posts"."illegal_count", "posts"."inappropriate_count", "posts"."last_version_at", "posts"."user_deleted", "posts"."reply_to_user_id", "posts"."percent_rank", "posts"."notify_user_count", "posts"."like_score", "posts"."deleted_by_id" FROM "posts" WHERE ("posts"."deleted_at" IS NULL) AND 1=0
PG::UndefinedColumn: ERROR: column posts.cached_version does not exist
LINE 1: ...ts"."updated_at", "posts"."reply_to_post_number", "posts"."c...

```

I just upgraded a site and it worked fine, so it’s not something affecting sites working properly.

I just tried again (it’s been 14 hours!) and it looks like the problem persists. Is there something that I need to update?

> **[Travis CI](https://app.travis-ci.com/github/pfaffman/discourse-topic-default-tag)**
>
> Travis CI enables your team to test and ship your apps with confidence. Easily sync your projects with Travis CI and you'll be testing your code in minutes.

> **[Travis CI](https://app.travis-ci.com/github/literatecomputing/discourse-prometheus)**
>
> Travis CI enables your team to test and ship your apps with confidence. Easily sync your projects with Travis CI and you'll be testing your code in minutes.

> **[Travis CI](https://app.travis-ci.com/github/pfaffman/discourse-allow-pm-to-staff)**
>
> Travis CI enables your team to test and ship your apps with confidence. Easily sync your projects with Travis CI and you'll be testing your code in minutes.

---

<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: [May 1, 2020, 8:57pm UTC](https://meta.discourse.org/t/travis-builds-failing-posts-cached-version-does-not-exist/150081/2 "2020-05-01T20:57:29Z")

</div>

> [@pfaffman](#):
>
> `column posts.cached_version does not exist`

So this is what you are referring to? Did we remove that column?I remember @sam removing some columns recently.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 1, 2020, 8:59pm UTC](https://meta.discourse.org/t/travis-builds-failing-posts-cached-version-does-not-exist/150081/3 "2020-05-01T20:59:46Z")

</div>

Many years ago

Are any of these plugins unofficial? Are you installing an old version of calendar?

---

<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: [May 1, 2020, 9:28pm UTC](https://meta.discourse.org/t/travis-builds-failing-posts-cached-version-does-not-exist/150081/4 "2020-05-01T21:28:44Z")

</div>

They’re all unofficial, else, I’d not be testing them. 😉

Sorry if that wasn’t clear.

These have all been passing all tests for some . . . weeks at least. There was some time a while back that they failed tests for a few days and then started working again a few days later.

None of them is doing anything with calendar that I know of. [this one](https://github.com/pfaffman/discourse-topic-default-tag) is fairly trivial if you want to have a look.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 1, 2020, 9:30pm UTC](https://meta.discourse.org/t/travis-builds-failing-posts-cached-version-does-not-exist/150081/5 "2020-05-01T21:30:00Z")

</div>

Do any of them have migrations?

---

<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: [May 1, 2020, 9:51pm UTC](https://meta.discourse.org/t/travis-builds-failing-posts-cached-version-does-not-exist/150081/6 "2020-05-01T21:51:50Z")

</div>

Nope. I have no idea how to have them do migrations. 😉

---

<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: [May 4, 2020, 4:24pm UTC](https://meta.discourse.org/t/travis-builds-failing-posts-cached-version-does-not-exist/150081/7 "2020-05-04T16:24:37Z")

</div>

So, it got better. 14 hours ago, [https://travis-ci.org/](https://travis-ci.org/) re-ran for my custom plugins and they all passed. I didn’t change anything. This has happened at least once before where travis builds failed and a few days later they started passing again without my doing anything.

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [July 1, 2020, 8:44am UTC](https://meta.discourse.org/t/travis-builds-failing-posts-cached-version-does-not-exist/150081/8 "2020-07-01T08:44:20Z")

</div>

I’m getting the same issue while running migrations with our `discourse-ratings` plugin alone with a vanilla dev setup. I don’t see any code which specifically asks for `cached_version` column.

commit hash: 093ee1d80c269afd00ba1341a3e71eb97e4ce7f1

I ran `RAILS_ENV=test rake db:drop db:create db:migrate` so there should be no data in the db.

This is the line

> <https://github.com/paviliondev/discourse-ratings/blob/76ec8e20754070be593503d45e25b789c002537b/db/migrate/20200520084648_add_rating_types.rb#L6>

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [July 2, 2020, 4:46am UTC](https://meta.discourse.org/t/travis-builds-failing-posts-cached-version-does-not-exist/150081/9 "2020-07-02T04:46:04Z")

</div>

Ok, this is what worked for us. We called `reset_column_information` on the relevant tables before the migration. Somehow, the `cached_version` column is `cached` 😉 in the schema cache. Also, this seems to be an issue particularly in `test` environment.

> **[ActiveRecord::Base.reset\_column\_information - APIdock](https://apidock.com/rails/ActiveRecord/Base/reset_column_information/class)**
>
> ActiveRecord::Base.reset\_column\_information - Ruby on Rails API documentation. View source code and usage examples.
