# Zammad not checking email, but Channel.fetch works

**URL:** https://community.zammad.org/t/zammad-not-checking-email-but-channel-fetch-works/4918
**Category:** Technical assistance
**Created:** [July 9, 2020, 7:58pm UTC](https://community.zammad.org/t/zammad-not-checking-email-but-channel-fetch-works/4918 "2020-07-09T19:58:43Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![samh](https://community.zammad.org/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@samh](https://community.zammad.org/u/samh)
#### Post date: [July 9, 2020, 7:58pm UTC](https://community.zammad.org/t/zammad-not-checking-email-but-channel-fetch-works/4918/1 "2020-07-09T19:58:43Z")

</div>

### Infos:

- Used Zammad version: 3.4.0
- Used Zammad installation source: deb packages via repository
- Operating system: Ubuntu 18.04

### Expected behavior:

- Emails to helpdesk inbox will be imported to Zammad

### Actual behavior:

- Emails sit in inbox and are not imported, unless I run Channel.fetch from Zammad console, in which case email is fetched without complaint

Email worked previously. I have two inboxes going to two different team. Neither works anymore. Outgoing email still works fine if I reply to existing ticket. But Zammad is not fetching emails. It’s possible this is since we updated to 3.4.

The worker is enabled. Not sure where else to look. Nothing jumps out in the production.log – when I fetch manually from console, I can see the check. Otherwise nothing. The scheduler logs are all 0 length which seems weird?

```auto
$ sudo systemctl status zammad-worker-1

 zammad-worker-1.service
   Loaded: loaded (/etc/systemd/system/zammad-worker-1.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-07-09 19:50:22 UTC; 4min 55s ago
 Main PID: 4647 (ruby)
    Tasks: 9 (limit: 4915)
   CGroup: /system.slice/zammad-worker-1.service
           └─4647 script/scheduler.rb start -t

Jul 09 19:50:22 zammad systemd[1]: Started zammad-worker-1.service.

```

---

<div class="post-metadata">

### Author: ![samh](https://community.zammad.org/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@samh](https://community.zammad.org/u/samh)
#### Post date: [July 9, 2020, 8:42pm UTC](https://community.zammad.org/t/zammad-not-checking-email-but-channel-fetch-works/4918/2 "2020-07-09T20:42:41Z")

</div>

I saw this: [After upgrade No Mails and Delayed::Backend::ActiveRecord::Job id: 66271](https://community.zammad.org/t/after-upgrade-no-mails-and-delayed-job-id-66271/2148/4)

from console:

```auto
irb(main):001:0> Delayed::Job.count
=> 0
irb(main):002:0> Delayed::Job.first
=> nil
irb(main):003:0> Delayed::Job.last
=> nil

```

And when I go to Settings -\> Monitoring it shows an unhealthy status: my two channels are active but have not fetched in X hours. Going to health check page I get

{“healthy”:false,“message”:" channel is active but not fetched for about 2 hours; channel is active but not fetched for about 2 hours",“issues”:[" channel is active but not fetched for about 2 hours"," channel is active but not fetched for about 2 hours"],“actions”:[],“token”:ʺ}

I do not have a “Restart Services” anywhere that I can find.

---

<div class="post-metadata">

### Author: ![samh](https://community.zammad.org/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@samh](https://community.zammad.org/u/samh)
#### Post date: [July 9, 2020, 8:50pm UTC](https://community.zammad.org/t/zammad-not-checking-email-but-channel-fetch-works/4918/3 "2020-07-09T20:50:57Z")

</div>

From another thread, I checked this from rails console

```auto
p Scheduler.find_by(name: 'Execute jobs')
#<Scheduler id: 8, name: "Execute jobs", method: "Job.run", period: 300, running: 0, last_run: "2020-07-10 21:30:15", prio: 2, pid: "46941592052720", note: nil, error_message: "", status: "ok", active: true, updated_by_id: 1, created_by_id: 1, created_at: "2020-06-13 17:22:29", updated_at: "2020-07-10 21:30:15">
=> #<Scheduler id: 8, name: "Execute jobs", method: "Job.run", period: 300, running: 0, last_run: "2020-07-10 21:30:15", prio: 2, pid: "46941592052720", note: nil, error_message: "", status: "ok", active: true, updated_by_id: 1, created_by_id: 1, created_at: "2020-06-13 17:22:29", updated_at: "2020-07-10 21:30:15">

```

Well I do not know how the “last run” date is _tomorrow_ but that is what it is right now. So, anything I can do besides wait until 21:30 UTC tomorrow?

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [July 15, 2020, 11:03am UTC](https://community.zammad.org/t/zammad-not-checking-email-but-channel-fetch-works/4918/4 "2020-07-15T11:03:37Z")

</div>

That’s rather odd.  
Did you by chance fiddle with either the systems time (set it grossly to the future) or play around with the jobs period time?

That’s the only two reasons I can think of for such a cause.

---

<div class="post-metadata">

### Author: ![samh](https://community.zammad.org/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@samh](https://community.zammad.org/u/samh)
#### Post date: [July 15, 2020, 1:51pm UTC](https://community.zammad.org/t/zammad-not-checking-email-but-channel-fetch-works/4918/5 "2020-07-15T13:51:50Z")

</div>

It’s running in a VM but there were no issues in other virtual machines or the host that I can detect, and I never saw the time itself shift but of course it is possible.

For future reference is there a way through the Console to update the previously ran time to go back into the past where it belongs?

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [July 16, 2020, 1:12pm UTC](https://community.zammad.org/t/zammad-not-checking-email-but-channel-fetch-works/4918/6 "2020-07-16T13:12:36Z")

</div>

> [@samh](#):
>
> For future reference is there a way through the Console to update the previously ran time to go back into the past where it belongs?

Yes you can force the entry to be more current.  
**However** : The following is everything but tested and might bring other “features” that have not been evaluated by me in anyway. If something gets worse because of the above, please don’t blame me. 🙂

> **Dangerzone**
>
> This doesn’t fix any possible issues in your setup and thus should be your last resort.
> 
> ```auto
> zammad run rails r "Scheduler.find_by(name: 'Execute jobs').update(last_run: Time.now-5.minutes)"
> 
> ```

---

<div class="post-metadata">

### Author: ![samh](https://community.zammad.org/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@samh](https://community.zammad.org/u/samh)
#### Post date: [July 16, 2020, 3:54pm UTC](https://community.zammad.org/t/zammad-not-checking-email-but-channel-fetch-works/4918/7 "2020-07-16T15:54:57Z")

</div>

> [@MrGeneration](#):
>
> `zammad run rails r "Scheduler.find_by(name: 'Execute jobs').update(last_run: Time.now-5.minutes)"`

Thank you - I hope not to need it. I am just getting started learning a little Rails. My experience has all been elsewhere.

---

<div class="post-metadata">

### Author: ![system](https://community.zammad.org/uploads/default/original/1X/5c5afaea2d23f811dbec33cd4edb02fa29d3262f.png) [@system](https://community.zammad.org/u/system)
#### Post date: [November 13, 2020, 4:05pm UTC](https://community.zammad.org/t/zammad-not-checking-email-but-channel-fetch-works/4918/8 "2020-11-13T16:05:59Z")

</div>

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.
