ByteInternet / hypernode-docker

Fast and easy Docker for Magento development
https://community.hypernode.io/hypernode-docker
35 stars 8 forks source link

MailHog getting clogged by failing "hypernode-monitoring-offsite-backup-filesystem" program #82

Closed umizoomi closed 1 year ago

umizoomi commented 1 year ago

Hey @vdloo,

I'm getting the mail below every 15 minutes in MailHog from the Hypernode docker container

Using image: docker.hypernode.com/byteinternet/hypernode-buster-docker-php81-mysql80:latest

From: noreply@hypernode.io (Cron Daemon)
Subject: Cron <root@test> sleep 5; /usr/bin/hypernode-monitoring-offsite-backup-filesystem --write-json
To: root@xxxxx-dummytag-docker.nodes.hypernode.io

Sorry. A fatal ERROR occured:

Selected profile 'hyp' does not resolve to a profile folder in
'/root/.duply/hyp'.

Hints:
Select one of the available profiles: 
 Use 'duply <name> create' to create a new profile.
 Use 'duply usage' to get usage help.

Traceback (most recent call last):
  File "/usr/bin/hypernode-monitoring-offsite-backup-filesystem", line 11, in <module>
    load_entry_point('kamikaze3==20230320.62224', 'console_scripts', 'hypernode-monitoring-offsite-backup-filesystem')()
  File "/usr/lib/python3/dist-packages/kamikaze3/monitoring/check_offsite_backup_filesystem.py", line 156, in main
    state = check_offsite_backup_filesystem()
  File "/usr/lib/python3/dist-packages/kamikaze3/monitoring/check_offsite_backup_filesystem.py", line 132, in check_offsite_backup_filesystem
    if check_most_recent_backup_is_too_old():
  File "/usr/lib/python3/dist-packages/kamikaze3/monitoring/check_offsite_backup_filesystem.py", line 117, in check_most_recent_backup_is_too_old
    duply_output = check_output(["duply", "hyp", "status"])
  File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['duply', 'hyp', 'status']' returned non-zero exit status 255.

It seems that this is coming from a cronjob. So I checked the crontabs. However, I can't seem to figure out where its coming from. I did the following trying to check all the crontabs:


root@test /var/spool/cron/crontabs # cat /var/spool/cron/crontabs/*
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (- installed on Fri Apr  7 04:30:01 2023)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
#Ansible: Automatically rotate logfiles
5 4 * * * sleep 14; flock -n ~/.bd20ae52.lock -c '/usr/bin/chronic /usr/bin/hypernode-auto-logrotate --detect'
0 0 * * * sleep 14; flock -n ~/.94546c18.lock -c '/usr/sbin/logrotate /data/web/hypernode_logrotate.conf --state /data/web/hypernode_logrotate.state' # added by hypernode-auto-logrotate
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontabtySitd installed on Mon Mar 27 11:04:36 2023)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
#Ansible: run nginx config reloader periodically
* * * * * /usr/bin/nginx_config_reloader > /dev/null 2>&1 || true```

Can you point me to where this email might come from and how to disable the execution of this program every 15 mins?

Thanks!
vdloo commented 1 year ago

hi @umizoomi, try rm /etc/cron.d/hypernode-offsite-backup-monitoring. we'll make sure this is disabled in future versions of this image by default.

umizoomi commented 1 year ago

It works, thanks @vdloo !

I wasn't aware of the existence of the /etc/cron.d folder. Learned something new ;)