# Rebake aborts with error message

**URL:** <https://meta.discourse.org/t/rebake-aborts-with-error-message/220803>\
**Category:** Self-hosting\
**Tags:** server-resources\
**Created:** [March 12, 2022, 11:19am UTC](https://meta.discourse.org/t/rebake-aborts-with-error-message/220803 "2022-03-12T11:19:39Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [March 12, 2022, 11:19am UTC](https://meta.discourse.org/t/rebake-aborts-with-error-message/220803/1 "2022-03-12T11:19:39Z")

</div>

Hi!  
When I try to rebake posts with a rake task, It sometimes stops with this message:

`168858 / 329447 ( 51.3%)WARNING: terminating connection because of crash of another server process DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. HINT: In a moment you should be able to reconnect to the database and repeat your command.`

And at the end of a wall of text, containing stuff such as:

```plaintext
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/relation.rb:828:in `exec_queries'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/relation.rb:631:in `load'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/relation.rb:249:in `records'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/relation/delegation.rb:88:in `each'
/var/www/discourse/lib/tasks/posts.rake:124:in `block in rebake_posts'

```

There is this:  
`168859 / 329447 ( 51.3%)rake aborted! ActiveRecord::ConnectionNotEstablished: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: the database system is in recovery mode `

* * *

Error in Discourse logs:

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

Any idea how to troubleshoot this?

---

_[View the full topic](https://meta.discourse.org/t/rebake-aborts-with-error-message/220803)._
