Websites stop working randomly across servers after update

Hello. Lately I’ve been noticing that websites stop working randomly and there are issues all over the place. When investigating the issue, a reocurring thing I see is that the 500/500 process limit I’ve set on accounts have been reached. It’s strange because all they have is a wordpress site + mail accounts.

Checking the tasks it’s filled with things like this:

it’s a new issue that started after I ran dnf update && upcp on the system. How would I resolve this?

For your own information: This issue exists across different apiscp installs / servers

crond is generating an email, which gets sent using $SENDMAIL, /usr/sbin/sendmail in this case. sendmail is a Postfix wrapper that calls postdrop to inject the message into Postfix’s queue in /.socket/postfix/postdrop. postdrop is unable to do so, so let’s work backwards:

First, look for any postdrop errors in /var/log/maillog, e.g. something like this informs you that the user is over quota and thus the file cannot be written to disk:

Feb  1 12:29:22 delta postfix/postdrop[25952]: warning: mail_queue_enter: create file maildrop/383820.25952: Disk quota exceeded

In this case, the user generating the mail delivered onto itself needs more storage. This can be done in User > Manage Users.

Perhaps there’s a permission error - look at /usr/sbin/postdrop within the vfs. This binary requires suid permission:

# ls -la /home/virtual/site12/fst/usr/sbin/postdrop
-rwxr-sr-x 2 root postdrop 294304 Dec 22  2023 /home/virtual/site12/fst/usr/sbin/postdrop

There’s a rare chance crond isn’t seeing the full filesystem; I’m not aware of this being the case any further but you can examine the root directory inode to determine this:

# lsof -p $(cat /home/virtual/site110/fst/var/run/crond.pid)
COMMAND   PID USER   FD      TYPE             DEVICE SIZE/OFF      NODE NAME
crond   16904 root  cwd       DIR               0,50       95  34188985 /home/virtual/site110/fst
crond   16904 root  rtd       DIR               0,50       95  34188985 /home/virtual/site110/fst

If the NAME field reports “deleted” this location no longer exists. Restarting the virtualcron service would clear the file handle:

systemctl restart virtualcron

Hello the maillog is spamming with these messages. I did not know maillog file could grow to 1 GB in a day!

Feb  2 05:19:34 epsilon postfix/postdrop[873378]: warning: mail_queue_enter: create file maildrop/514838.873378: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[640722]: warning: mail_queue_enter: create file maildrop/516616.640722: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[900225]: warning: mail_queue_enter: create file maildrop/518112.900225: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[753669]: warning: mail_queue_enter: create file maildrop/518114.753669: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[753420]: warning: mail_queue_enter: create file maildrop/519636.753420: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[3896776]: warning: mail_queue_enter: create file maildrop/523943.3896776: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[740684]: warning: mail_queue_enter: create file maildrop/526495.740684: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[782618]: warning: mail_queue_enter: create file maildrop/527377.782618: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[127484]: warning: mail_queue_enter: create file maildrop/552822.127484: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[3753322]: warning: mail_queue_enter: create file maildrop/562038.3753322: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[747116]: warning: mail_queue_enter: create file maildrop/562133.747116: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[725334]: warning: mail_queue_enter: create file maildrop/566529.725334: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[640712]: warning: mail_queue_enter: create file maildrop/569877.640712: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[640679]: warning: mail_queue_enter: create file maildrop/570727.640679: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[747147]: warning: mail_queue_enter: create file maildrop/572205.747147: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[879846]: warning: mail_queue_enter: create file maildrop/572442.879846: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[94481]: warning: mail_queue_enter: create file maildrop/572699.94481: Permission denied
Feb  2 05:19:34 epsilon postfix/postdrop[53125]: warning: mail_queue_enter: create file maildrop/574485.53125: Permission denied

ls -la /home/virtual/site268/fst/usr/sbin/postdrop
-rwxr-xr-x 0 root postdrop 312504 22 dec  2023 /home/virtual/site268/fst/usr/sbin/postdrop

Run cpcmd misc:release-fsghost /usr/sbin/postdrop. Given the timestamp of that file and last package release September 2024, it’s an old file handle.

# ls -l /usr/sbin/postdrop /home/virtual/FILESYSTEMTEMPLATE/siteinfo/usr/sbin/postdrop  /home/virtual/site268/{fst,shadow}/usr/sbin/postdrop
ls: cannot access '/home/virtual/site268/shadow/usr/sbin/postdrop': No such file or directory
-rwxr-sr-x 2 root postdrop 312512 Nov 21 23:47 /home/virtual/FILESYSTEMTEMPLATE/siteinfo/usr/sbin/postdrop
-rwxr-sr-x 2 root postdrop 312512 Nov 21 23:47 /home/virtual/site268/fst/usr/sbin/postdrop
-rwxr-sr-x 2 root postdrop 312512 Nov 21 23:47 /usr/sbin/postdrop

File attributes should agree between FST, vfs, and rootfs as in the above example.

The fact there’s zero hardlinks would be your first hint something is askew, which means there’s no physical reference to that file on disk presently. Terminating all processes that hold an open file handle will allow the layer to refresh and that should fix the setuid permissions as well once the updated postdrop binary propagates.

Thank you. is there any chance to automate this task? Thinking about it I know it’s happened before

Runtime of that command isn’t very good right now, so no. Ideally OverlayFS should release stale handles once the process goes out of scope rather than keeping the file in memory.