# Zammad no more processing emails

**URL:** https://community.zammad.org/t/zammad-no-more-processing-emails/15285
**Category:** Technical assistance
**Created:** [August 22, 2024, 7:04am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285 "2024-08-22T07:04:57Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![fluca1978](https://community.zammad.org/user_avatar/community.zammad.org/fluca1978/32/9236_2.png) [@fluca1978](https://community.zammad.org/u/fluca1978)
#### Post date: [August 22, 2024, 7:04am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285/1 "2024-08-22T07:04:57Z")

</div>

Zammad 6.3.1 on Debian.  
Everything was working fine, but then I ran out of space due to the http\_logs table filling up (see issue [https://community.zammad.org/t/tables-http-logs-and-friends-are-eating-all-my-storage-space/15275/4](https://community.zammad.org/t/tables-http-logs-and-friends-are-eating-all-my-storage-space/15275/4)). I cleaned up the space, make `zammad`, `nginx` and `postgresql` server restarted and everything seems to work, but now the incoming emails are not processed, and remain on the mail server.

What can I search for? Is there a scheduled process that I need to restart?

---

<div class="post-metadata">

### Author: ![fluca1978](https://community.zammad.org/user_avatar/community.zammad.org/fluca1978/32/9236_2.png) [@fluca1978](https://community.zammad.org/u/fluca1978)
#### Post date: [August 22, 2024, 7:35am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285/2 "2024-08-22T07:35:53Z")

</div>

I’ve also rebooted the whole server, without any success: emails are still in the mailbox and not downloaded by zammad.  
The email channels does look good and don’t show errors. Any idea?

---

<div class="post-metadata">

### Author: ![Dennis1993](https://community.zammad.org/user_avatar/community.zammad.org/dennis1993/32/3665_2.png) [@Dennis1993](https://community.zammad.org/u/Dennis1993)
#### Post date: [August 22, 2024, 7:58am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285/3 "2024-08-22T07:58:31Z")

</div>

I‘m not a pro but try to save the mail settings again. All tests ok there?  
If all settings are correct and the connection test is ok, open the production.log and search for any errors. You find it here: /opt/zammad/log

---

<div class="post-metadata">

### Author: ![fluca1978](https://community.zammad.org/user_avatar/community.zammad.org/fluca1978/32/9236_2.png) [@fluca1978](https://community.zammad.org/u/fluca1978)
#### Post date: [August 22, 2024, 8:53am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285/4 "2024-08-22T08:53:56Z")

</div>

@Dennis1993 thanks for the suggestion. I’ve reapplied all the email settings, and in fact the system notifies me that there are five emails in the inbox, so I guess that zammad is able to connect to the mailbox. The settings have been applied with success. However, nothing has changed.

In the logs I don’t find anything related to email:

```auto
$ sudo grep -i error /opt/zammad/log/production.log 
E, [2024-08-22T00:44:45.106250#4089507-310296800] ERROR -- : ImportJob 'Import::Ldap' failed: At least one user needs to have admin permissions.
E, [2024-08-22T00:44:45.106280#4089507-310296800] ERROR -- : At least one user needs to have admin permissions. (Exceptions::UnprocessableEntity)
E, [2024-08-22T01:43:52.503181#4089507-332461040] ERROR -- : ImportJob 'Import::Ldap' failed: At least one user needs to have admin permissions.
E, [2024-08-22T01:43:52.503210#4089507-332461040] ERROR -- : At least one user needs to have admin permissions. (Exceptions::UnprocessableEntity)
E, [2024-08-22T02:44:55.602800#4089507-354589860] ERROR -- : ImportJob 'Import::Ldap' failed: At least one user needs to have admin permissions.
E, [2024-08-22T02:44:55.602830#4089507-354589860] ERROR -- : At least one user needs to have admin permissions. (Exceptions::UnprocessableEntity)
E, [2024-08-22T03:44:02.100459#4089507-376753560] ERROR -- : ImportJob 'Import::Ldap' failed: At least one user needs to have admin permissions.
E, [2024-08-22T03:44:02.100505#4089507-376753560] ERROR -- : At least one user needs to have admin permissions. (Exceptions::UnprocessableEntity)
E, [2024-08-22T04:44:58.168781#4089507-398882300] ERROR -- : ImportJob 'Import::Ldap' failed: At least one user needs to have admin permissions.
E, [2024-08-22T04:44:58.168819#4089507-398882300] ERROR -- : At least one user needs to have admin permissions. (Exceptions::UnprocessableEntity)
E, [2024-08-22T05:47:06.152947#4089507-421011020] ERROR -- : ImportJob 'Import::Ldap' failed: At least one user needs to have admin permissions.
E, [2024-08-22T05:47:06.152978#4089507-421011020] ERROR -- : At least one user needs to have admin permissions. (Exceptions::UnprocessableEntity)
E, [2024-08-22T06:45:28.940354#4089507-443176560] ERROR -- : ImportJob 'Import::Ldap' failed: At least one user needs to have admin permissions.
E, [2024-08-22T06:45:28.940411#4089507-443176560] ERROR -- : At least one user needs to have admin permissions. (Exceptions::UnprocessableEntity)
E, [2024-08-22T07:44:36.161771#4089507-465305400] ERROR -- : ImportJob 'Import::Ldap' failed: At least one user needs to have admin permissions.
E, [2024-08-22T07:44:36.161807#4089507-465305400] ERROR -- : At least one user needs to have admin permissions. (Exceptions::UnprocessableEntity)
E, [2024-08-22T08:45:26.602307#4098252-220500] ERROR -- : ImportJob 'Import::Ldap' failed: At least one user needs to have admin permissions.
E, [2024-08-22T08:45:26.602365#4098252-220500] ERROR -- : At least one user needs to have admin permissions. (Exceptions::UnprocessableEntity)
E, [2024-08-22T09:44:33.508664#595-256600] ERROR -- : ImportJob 'Import::Ldap' failed: At least one user needs to have admin permissions.
E, [2024-08-22T09:44:33.508703#595-256600] ERROR -- : At least one user needs to have admin permissions. (Exceptions::UnprocessableEntity)

```

Since the errors are related to the LDAP integration, I re-validated also that configuration and the system has run again the synchronization.  
So far, nothing has changed, and the system is still not download the emails from the inbox.

---

<div class="post-metadata">

### Author: ![fluca1978](https://community.zammad.org/user_avatar/community.zammad.org/fluca1978/32/9236_2.png) [@fluca1978](https://community.zammad.org/u/fluca1978)
#### Post date: [August 22, 2024, 10:25am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285/5 "2024-08-22T10:25:38Z")

</div>

Just for the records:

- I’ve tried to disable and enable again the Email Channel via the button “disable”
- I’ve tried to change the associated email address and put it back for incoming emails  
Nothing so far has made the mail workflow restart. I’ve followed the reconfiguration of the email channel and I’ve seen Zammad sending and receiving/deleting its test emails, so the problem seems to be not in the configuration rather in some sort of scheduling.

Ideas?

---

<div class="post-metadata">

### Author: ![Dennis1993](https://community.zammad.org/user_avatar/community.zammad.org/dennis1993/32/3665_2.png) [@Dennis1993](https://community.zammad.org/u/Dennis1993)
#### Post date: [August 22, 2024, 10:37am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285/6 "2024-08-22T10:37:06Z")

</div>

You wrote in the other thread you truncated the table. Is the auto\_increment resettet?  
Maybe here is a problem. But I don’t know.  
I know this database design from ILIAS. Here the auto\_increment is saved in another table too and now the IDs doesn’t match. Maybe the same problem here 🤷‍♂️

You know the last ID of the last entry? Then you can test to set this value in the table.

Maybe another technical guy can help here or has an idea. I‘m a user like you and try to help ☺

---

<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: [August 22, 2024, 10:37am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285/7 "2024-08-22T10:37:49Z")

</div>

Does Zammad fetch emails according to log at all?  
`INFO -- : fetching` would be what you’re looking for.

---

<div class="post-metadata">

### Author: ![fluca1978](https://community.zammad.org/user_avatar/community.zammad.org/fluca1978/32/9236_2.png) [@fluca1978](https://community.zammad.org/u/fluca1978)
#### Post date: [August 22, 2024, 10:44am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285/8 "2024-08-22T10:44:12Z")

</div>

@MrGeneration apparently it is not fetching: the lines in the logs are related to when I tried to disable/reenable the email configuration (that as I’ve already written, sent/removed the test email):

```auto
$ sudo grep fetching /opt/zammad/log/*
/opt/zammad/log/production.log:I, [2024-08-22T10:15:22.103893#586-148900] INFO -- : fetching imap (imap.gmail.com/test.email@foo.it port=993,ssl=true,starttls=false,folder=INBOX,keep_on_server=false,auth_type=LOGIN)
/opt/zammad/log/production.log:I, [2024-08-22T10:15:42.373055#586-149480] INFO -- : fetching imap (imap.gmail.com/test.email@foo.it port=993,ssl=true,starttls=false,folder=INBOX,keep_on_server=false,auth_type=LOGIN)
/opt/zammad/log/production.log:I, [2024-08-22T10:59:55.792517#586-149540] INFO -- : fetching imap (imap.gmail.com/test.email@foo.it port=993,ssl=true,starttls=false,folder=INBOX,keep_on_server=false,auth_type=LOGIN)
/opt/zammad/log/production.log:I, [2024-08-22T11:00:08.766660#586-149400] INFO -- : fetching imap (imap.gmail.com/test.email@foo.it port=993,ssl=true,starttls=false,folder=INBOX,keep_on_server=false,auth_type=LOGIN)

$ date
gio 22 ago 2024, 12:41:17, CEST

```

on the PostgreSQL side I’ve (if it helps):

```auto
zammad=# select area, id, active, last_log_in, last_log_out, status_in, status_out from channels;
        area | id | active | last_log_in | last_log_out | status_in | status_out 
---------------------+----+--------+-------------+--------------+-----------+------------
 Email::Notification | 2 | f | | | | ok
 Email::Notification | 1 | t | | | | ok
 Email::Account | 3 | t | | | ok | ok

```

@Dennis1993 the `http_logs` table is already accumulting stuff again, so I don’t believe it is a problem of resetting the autoincrement. However I could reset the sequence if that make sense (please, someone advice).

---

<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: [August 22, 2024, 10:55am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285/9 "2024-08-22T10:55:16Z")

</div>

What does `Scheduler.where(active: false).count` return in a rails console?

---

<div class="post-metadata">

### Author: ![fluca1978](https://community.zammad.org/user_avatar/community.zammad.org/fluca1978/32/9236_2.png) [@fluca1978](https://community.zammad.org/u/fluca1978)
#### Post date: [August 22, 2024, 11:11am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285/10 "2024-08-22T11:11:27Z")

</div>

> [@MrGeneration](#):
>
> Scheduler.where(active: false).count

```auto
$ sudo -u zammad zammad run rails c 
Loading production environment (Rails 7.0.8.4)
[1] pry(main)> Scheduler.where(active: false).count
=> 2
[2] pry(main)> Scheduler.where(active: true).count
=> 27

```

and more in details:

```auto
[3] pry(main)> Scheduler.where(active: false)
=> [#<Scheduler:0x00007f8d64bfc810
  id: 4,
  name: "Check channels.",
  method: "Channel.fetch",
  period: 30,
  running: 0,
  last_run: Sat, 17 Aug 2024 01:22:28.511000000 UTC +00:00,
  prio: 1,
  pid: "149160",
  note: nil,
  error_message: "Failed to run Channel.fetch after 11 tries.",
  status: "error",
  active: false,
  timeplan: {},
  updated_by_id: 33,
  created_by_id: 1,
  created_at: Tue, 30 Jul 2024 07:03:52.031000000 UTC +00:00,
  updated_at: Sat, 17 Aug 2024 01:21:34.244000000 UTC +00:00>,
 #<Scheduler:0x00007f8d64e63ea0
  id: 2,
  name: "Process ticket escalations.",
  method: "Ticket.process_escalation",
  period: 300,
  running: 0,
  last_run: Sat, 17 Aug 2024 01:22:29.514000000 UTC +00:00,
  prio: 1,
  pid: "149180",
  note: nil,
  error_message: "Failed to run Ticket.process_escalation after 11 tries.",
  status: "error",
  active: false,
  timeplan: {},
  updated_by_id: 1,
  created_by_id: 1,
  created_at: Tue, 30 Jul 2024 07:03:52.026000000 UTC +00:00,
  updated_at: Sat, 17 Aug 2024 01:21:40.340000000 UTC +00:00>]

```

Note that `Sat, 17 Aug 2024` is probably when the server did run out of disk space hence avodiing zammad to work correctly.  
Is this something I should remove in order for the scheduler to restart?

---

<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: [August 22, 2024, 11:23am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285/11 "2024-08-22T11:23:56Z")

</div>

Please stop being so in love with removing stuff. You’d brick the system.  
Instead do this…:

`Scheduler.where(status: 'error', active: false).update(status:'ok', error_message: nil, active: true);`

Then restart Zammad.

---

<div class="post-metadata">

### Author: ![fluca1978](https://community.zammad.org/user_avatar/community.zammad.org/fluca1978/32/9236_2.png) [@fluca1978](https://community.zammad.org/u/fluca1978)
#### Post date: [August 22, 2024, 11:36am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285/12 "2024-08-22T11:36:44Z")

</div>

> [@MrGeneration](#):
>
> Scheduler.where(status: ‘error’, active: false).update(status:‘ok’, error\_message: nil, active: true);

It worked, thanks a lot.

By the way, I’m not going to delete anything, I’m trying to understand how Zammad is working internally. Is this scheduling issue/restarting documented somewhere?

---

<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: [August 22, 2024, 11:38am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285/13 "2024-08-22T11:38:18Z")

</div>

> [@fluca1978](#):
>
> Is this scheduling issue/restarting documented somewhere?

Nope. It shouldn’t occur at all usually. I’ve had to use this below 100 times in the last 6 years and basically only on mayor fuck ups system wise.

---

<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: [August 29, 2024, 11:38am UTC](https://community.zammad.org/t/zammad-no-more-processing-emails/15285/14 "2024-08-29T11:38:20Z")

</div>

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