# Sidekiq is unexpectedly paused

**URL:** https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666
**Category:** Development
**Created:** [16 januari 2019 om 06:47 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666 "2019-01-16T06:47:17Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![MHR](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@MHR](https://meta.discourse.org/u/MHR)
#### Post date: [16 januari 2019 om 06:47 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/1 "2019-01-16T06:47:17Z")

</div>

We have a setup for both Topic Event / Post Event webhooks, which was working fine.  
But suddenly it stopped working and on any Topic Event or Post Event no webhook was sent.

We have checked for Discourse log also but there is no error.

So is there any way we can troubleshoot this issue?

---

<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: [16 januari 2019 om 07:57 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/2 "2019-01-16T07:57:17Z")

</div>

Check the sidekiq queue. Is it filed up with posts being rebaked due to the recent image changes?

---

<div class="post-metadata">

### Author: ![MHR](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@MHR](https://meta.discourse.org/u/MHR)
#### Post date: [16 januari 2019 om 09:23 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/3 "2019-01-16T09:23:07Z")

</div>

Thanks for your reply,  
I found all my web hook events in scheduled list in sidekiq.

Can you please help me with below things?

1. How to fix it?
2. what does schedule list means? and How to execute those web hook now?

---

<div class="post-metadata">

### Author: ![MHR](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@MHR](https://meta.discourse.org/u/MHR)
#### Post date: [16 januari 2019 om 09:37 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/4 "2019-01-16T09:37:29Z")

</div>

Finally found the issue.  
Sidekiq was paused.

---

<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 januari 2019 om 12:07 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/5 "2019-01-16T12:07:43Z")

</div>

Why was it paused? Did you pause it?

---

<div class="post-metadata">

### Author: ![MHR](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@MHR](https://meta.discourse.org/u/MHR)
#### Post date: [16 januari 2019 om 13:03 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/6 "2019-01-16T13:03:40Z")

</div>

Not sure but may be it’s because of failure of backup.

---

<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: [16 januari 2019 om 14:21 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/7 "2019-01-16T14:21:36Z")

</div>

Make sure you have disk space and reboot.

---

<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 januari 2019 om 22:23 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/8 "2019-01-16T22:23:04Z")

</div>

What happens is sidekiq is paused during backup, but if backup fails, sidekiq is never unpaused. Didn’t you make a bunch of improvements here recently @tgxworld?

Are you on the latest version of Discourse @mhr?

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [21 januari 2019 om 03:46 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/9 "2019-01-21T03:46:46Z")

</div>

> [@codinghorror](#):
>
> but if backup fails, sidekiq is never unpaused. Didn’t you make a bunch of improvements here recently @tgxworld?

We’ll always unpause Sidekiq even if the backup/restore fails.

---

<div class="post-metadata">

### Author: ![MHR](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@MHR](https://meta.discourse.org/u/MHR)
#### Post date: [21 januari 2019 om 13:09 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/10 "2019-01-21T13:09:10Z")

</div>

we are currently using [v2.1.0.beta6 +89](https://github.com/discourse/discourse/compare/6c1e70d5545df680ad5ccfbc2fffbe37f36199bc...tests-passed)

---

<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: [21 januari 2019 om 13:12 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/11 "2019-01-21T13:12:19Z")

</div>

You need to update to latest.

---

<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: [10 februari 2019 om 04:46 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/12 "2019-02-10T04:46:12Z")

</div>

This “pause sidekiq during backups” decision is the source of considerable trauma @tgxworld. Especially for giant backups going to slow offsite network dumps, or if something goes wrong with the backup and it never “finishes”, etc.. users don’t get notifications and so on because Sidekiq is paused, and the longer this goes on.. the worse the effects are on users.

Why did we make this decision to pause Sidekiq during backups? 🤔 do you remember @sam?

---

<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 februari 2019 om 05:20 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/13 "2019-02-10T05:20:20Z")

</div>

One reason is that if sidekiq is running, the backup can fail because an upload gets deleted when tar is running. But maybe having a backup fail isn’t that bad.

---

<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: [10 februari 2019 om 06:39 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/14 "2019-02-10T06:39:55Z")

</div>

Previous to this fix we would have backups often fail due to transaction deadlocks with sidekiq jobs.

The intention here was always to simply pause sidekiq, run pgdump, unpause sidekiq, create tar, compress tar, upload backup

It is very possible there are some flow bugs we need to iron out, seeing issues in our hosting as well, will review this next week

---

<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: [18 februari 2019 om 04:40 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/16 "2019-02-18T04:40:15Z")

</div>

I just committed an awesome fix by @tgxworld for multisite that makes this more reliable. @gerhard also reduced the sidekiq pause window!

We have some additional work left here (never allow you to pause for longer than N hours) so assigning this to @tgxworld till it is implemented.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [21 februari 2019 om 05:55 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/18 "2019-02-21T05:55:04Z")

</div>

A change was made to the backup process which makes it extra sure that the sidekiq process will be unpaused.

> <https://github.com/discourse/discourse/blob/46e62c0d22099bbdb86d98c9e78fa5687e7777f5/lib/backup_restore/backuper.rb#L35-L41>

Closing this for now but feel free to flag this post if it happens again.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [21 februari 2019 om 05:55 UTC](https://meta.discourse.org/t/sidekiq-is-unexpectedly-paused/106666/19 "2019-02-21T05:55:07Z")

</div>


