[GH-ISSUE #1345] Cron issue - Refer to closed #983 #1073

Closed
opened 2026-02-27 11:15:06 +03:00 by kerem · 16 comments
Owner

Originally created by @hrx777 on GitHub (Jan 5, 2018).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1345

See https://github.com/modoboa/modoboa/issues/983

Originally created by @hrx777 on GitHub (Jan 5, 2018). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1345 See https://github.com/modoboa/modoboa/issues/983
kerem 2026-02-27 11:15:06 +03:00
Author
Owner

@tonioo commented on GitHub (Jan 8, 2018):

That's really strange... Can you check that your file ends with a newline? What happens if you reintroduce variables?

<!-- gh-comment-id:355947103 --> @tonioo commented on GitHub (Jan 8, 2018): That's really strange... Can you check that your file ends with a newline? What happens if you reintroduce variables?
Author
Owner

@kryskool commented on GitHub (Apr 7, 2018):

ping @hrx777

<!-- gh-comment-id:379462919 --> @kryskool commented on GitHub (Apr 7, 2018): ping @hrx777
Author
Owner

@makakken commented on GitHub (Jul 10, 2018):

i think the problem still exists:

Jul 10 22:23:01 mail cron[893]: (*system*letsencrypt) ERROR (Missing newline before EOF, this crontab file will be ignored)
Jul 10 22:25:01 mail cron[893]: Error: bad username; while reading /etc/cron.d/modoboa
Jul 10 22:25:01 mail cron[893]: (*system*modoboa) ERROR (Syntax error, this crontab file will be ignored)

fresh install using the installer on debian 9.4
is there any solution for that?

<!-- gh-comment-id:403970466 --> @makakken commented on GitHub (Jul 10, 2018): i think the problem still exists: ``` Jul 10 22:23:01 mail cron[893]: (*system*letsencrypt) ERROR (Missing newline before EOF, this crontab file will be ignored) Jul 10 22:25:01 mail cron[893]: Error: bad username; while reading /etc/cron.d/modoboa Jul 10 22:25:01 mail cron[893]: (*system*modoboa) ERROR (Syntax error, this crontab file will be ignored) ``` fresh install using the installer on debian 9.4 is there any solution for that?
Author
Owner

@tonioo commented on GitHub (Jul 11, 2018):

@makakken Thank you for the logs. There is indeed a missing newline in the letsencrypt crontab, I'll fix it. About the modoboa crontab, can you paste the content somewhere? The "bad username" error is explicit but I'd like to know which one...

<!-- gh-comment-id:404099239 --> @tonioo commented on GitHub (Jul 11, 2018): @makakken Thank you for the logs. There is indeed a missing newline in the letsencrypt crontab, I'll fix it. About the modoboa crontab, can you paste the content somewhere? The "bad username" error is explicit but I'd like to know which one...
Author
Owner

@makakken commented on GitHub (Jul 11, 2018):

@tonioo sorry, deleted the test cloud-node ;) currently try to install on ubuntu 18.04. node. if the error still persists, i'll post the content of /etc/cron.d/modoboa

<!-- gh-comment-id:404099882 --> @makakken commented on GitHub (Jul 11, 2018): @tonioo sorry, deleted the test cloud-node ;) currently try to install on ubuntu 18.04. node. if the error still persists, i'll post the content of /etc/cron.d/modoboa
Author
Owner

@makakken commented on GitHub (Jul 11, 2018):

Jul 11 11:06:01 mail cron[1021]: Error: bad username; while reading /etc/cron.d/modoboa
Jul 11 11:06:01 mail cron[1021]: (*system*modoboa) ERROR (Syntax error, this crontab file will be ignored)

how nice, error still exists with ubuntu 18.04 fresh install on cloud-node.
content of cron.d/modoboa

# This file was automatically installed on 2018-07-11T11:05:13.976819
#
# Modoboa specific cron jobs
#
PYTHON=/srv/modoboa/env/bin/python
INSTANCE=/srv/modoboa/instance

# Operations on mailboxes
*       *       *       *       *       vmail   $PYTHON $INSTANCE/manage.py handle_mailbox_operations

# Sessions table cleanup
0       0       *       *       *       root    $PYTHON $INSTANCE/manage.py clearsessions

# Logs table cleanup
0       0       *       *       *       root    $PYTHON $INSTANCE/manage.py cleanlogs

# Quarantine cleanup
0       0       *       *       *       root    $PYTHON $INSTANCE/manage.py qcleanup

# Notifications about pending release requests
0       12      *       *       *       root    $PYTHON $INSTANCE/manage.py amnotify

# Logs parsing
*/5     *       *       *       *       root    $PYTHON $INSTANCE/manage.py logparser &> /dev/null
0       *       *       *       *       root    $PYTHON $INSTANCE/manage.py update_statistics

# Radicale rights file
*/2    *       *       *       *        root    $PYTHON $INSTANCE/manage.py generate_rights

# DNSBL checks
*/30    *       *       *       *       root    $PYTHON $INSTANCE/manage.py modo check_mx

# Public API communication
0       *       *       *       *       root    $PYTHON $INSTANCE/manage.py communicate_with_public_api

# Generate DKIM keys (they will belong to the user running this job)
*       *       *       *       *       opendkim    $PYTHON $INSTANCE/manage.py modo manage_dkim_keys
<!-- gh-comment-id:404102903 --> @makakken commented on GitHub (Jul 11, 2018): ``` Jul 11 11:06:01 mail cron[1021]: Error: bad username; while reading /etc/cron.d/modoboa Jul 11 11:06:01 mail cron[1021]: (*system*modoboa) ERROR (Syntax error, this crontab file will be ignored) ``` how nice, error still exists with ubuntu 18.04 fresh install on cloud-node. content of cron.d/modoboa ``` # This file was automatically installed on 2018-07-11T11:05:13.976819 # # Modoboa specific cron jobs # PYTHON=/srv/modoboa/env/bin/python INSTANCE=/srv/modoboa/instance # Operations on mailboxes * * * * * vmail $PYTHON $INSTANCE/manage.py handle_mailbox_operations # Sessions table cleanup 0 0 * * * root $PYTHON $INSTANCE/manage.py clearsessions # Logs table cleanup 0 0 * * * root $PYTHON $INSTANCE/manage.py cleanlogs # Quarantine cleanup 0 0 * * * root $PYTHON $INSTANCE/manage.py qcleanup # Notifications about pending release requests 0 12 * * * root $PYTHON $INSTANCE/manage.py amnotify # Logs parsing */5 * * * * root $PYTHON $INSTANCE/manage.py logparser &> /dev/null 0 * * * * root $PYTHON $INSTANCE/manage.py update_statistics # Radicale rights file */2 * * * * root $PYTHON $INSTANCE/manage.py generate_rights # DNSBL checks */30 * * * * root $PYTHON $INSTANCE/manage.py modo check_mx # Public API communication 0 * * * * root $PYTHON $INSTANCE/manage.py communicate_with_public_api # Generate DKIM keys (they will belong to the user running this job) * * * * * opendkim $PYTHON $INSTANCE/manage.py modo manage_dkim_keys ```
Author
Owner

@makakken commented on GitHub (Jul 11, 2018):

i checked all the usernames, they exist in the passwd file: root, vmail, opendkim

<!-- gh-comment-id:404103364 --> @makakken commented on GitHub (Jul 11, 2018): i checked all the usernames, they exist in the passwd file: root, vmail, opendkim
Author
Owner

@makakken commented on GitHub (Jul 11, 2018):

@tonioo i cannot see any errors, do you?

<!-- gh-comment-id:404103529 --> @makakken commented on GitHub (Jul 11, 2018): @tonioo i cannot see any errors, do you?
Author
Owner

@tonioo commented on GitHub (Jul 11, 2018):

@makakken no... Can you check if the file contains strange characters? (using cat -v for example) Have you tried to restart the cron daemon?

<!-- gh-comment-id:404104893 --> @tonioo commented on GitHub (Jul 11, 2018): @makakken no... Can you check if the file contains strange characters? (using cat -v for example) Have you tried to restart the cron daemon?
Author
Owner

@makakken commented on GitHub (Jul 11, 2018):

cat -v /etc/cron.d/modoboa

# This file was automatically installed on 2018-07-11T11:05:13.976819
#
# Modoboa specific cron jobs
#
PYTHON=/srv/modoboa/env/bin/python
INSTANCE=/srv/modoboa/instance

# Operations on mailboxes
*       *       *       *       *       vmail   $PYTHON $INSTANCE/manage.py handle_mailbox_operations

# Sessions table cleanup
0       0       *       *       *       root    $PYTHON $INSTANCE/manage.py clearsessions

# Logs table cleanup
0       0       *       *       *       root    $PYTHON $INSTANCE/manage.py cleanlogs

# Quarantine cleanup
0       0       *       *       *       root    $PYTHON $INSTANCE/manage.py qcleanup

# Notifications about pending release requests
0       12      *       *       *       root    $PYTHON $INSTANCE/manage.py amnotify

# Logs parsing
*/5     *       *       *       *       root    $PYTHON $INSTANCE/manage.py logparser &> /dev/null
0       *       *       *       *       root    $PYTHON $INSTANCE/manage.py update_statistics

# Radicale rights file
*/2    *       *       *       *        root    $PYTHON $INSTANCE/manage.py generate_rights

# DNSBL checks
*/30    *       *       *       *       root    $PYTHON $INSTANCE/manage.py modo check_mx

# Public API communication
0       *       *       *       *       root    $PYTHON $INSTANCE/manage.py communicate_with_public_api

# Generate DKIM keys (they will belong to the user running this job)
*       *       *       *       *       opendkim    $PYTHON $INSTANCE/manage.py modo manage_dkim_keys
<!-- gh-comment-id:404105387 --> @makakken commented on GitHub (Jul 11, 2018): cat -v /etc/cron.d/modoboa ``` # This file was automatically installed on 2018-07-11T11:05:13.976819 # # Modoboa specific cron jobs # PYTHON=/srv/modoboa/env/bin/python INSTANCE=/srv/modoboa/instance # Operations on mailboxes * * * * * vmail $PYTHON $INSTANCE/manage.py handle_mailbox_operations # Sessions table cleanup 0 0 * * * root $PYTHON $INSTANCE/manage.py clearsessions # Logs table cleanup 0 0 * * * root $PYTHON $INSTANCE/manage.py cleanlogs # Quarantine cleanup 0 0 * * * root $PYTHON $INSTANCE/manage.py qcleanup # Notifications about pending release requests 0 12 * * * root $PYTHON $INSTANCE/manage.py amnotify # Logs parsing */5 * * * * root $PYTHON $INSTANCE/manage.py logparser &> /dev/null 0 * * * * root $PYTHON $INSTANCE/manage.py update_statistics # Radicale rights file */2 * * * * root $PYTHON $INSTANCE/manage.py generate_rights # DNSBL checks */30 * * * * root $PYTHON $INSTANCE/manage.py modo check_mx # Public API communication 0 * * * * root $PYTHON $INSTANCE/manage.py communicate_with_public_api # Generate DKIM keys (they will belong to the user running this job) * * * * * opendkim $PYTHON $INSTANCE/manage.py modo manage_dkim_keys ```
Author
Owner

@makakken commented on GitHub (Jul 11, 2018):

@tonioo no strange characters i think

<!-- gh-comment-id:404106208 --> @makakken commented on GitHub (Jul 11, 2018): @tonioo no strange characters i think
Author
Owner

@tonioo commented on GitHub (Jul 11, 2018):

No indeed... And reloading the daemon? I wonder if there could be an issue if opendkim and vmail users are added after the cron daemon has been started...

<!-- gh-comment-id:404106483 --> @tonioo commented on GitHub (Jul 11, 2018): No indeed... And reloading the daemon? I wonder if there could be an issue if opendkim and vmail users are added after the cron daemon has been started...
Author
Owner

@makakken commented on GitHub (Jul 11, 2018):

i think you're right, after restarting the daemon, no errors:

Jul 11 11:31:33 mail cron[6264]: (CRON) INFO (pidfile fd = 3) Jul 11 11:31:33 mail cron[6264]: (CRON) INFO (Skipping @reboot jobs -- not system startup)

<!-- gh-comment-id:404106848 --> @makakken commented on GitHub (Jul 11, 2018): i think you're right, after restarting the daemon, no errors: `Jul 11 11:31:33 mail cron[6264]: (CRON) INFO (pidfile fd = 3) Jul 11 11:31:33 mail cron[6264]: (CRON) INFO (Skipping @reboot jobs -- not system startup)`
Author
Owner

@tonioo commented on GitHub (Jul 11, 2018):

Great! I'll fix it in the installer.

<!-- gh-comment-id:404107021 --> @tonioo commented on GitHub (Jul 11, 2018): Great! I'll fix it in the installer.
Author
Owner

@makakken commented on GitHub (Jul 11, 2018):

all processes seem to work now.

<!-- gh-comment-id:404107062 --> @makakken commented on GitHub (Jul 11, 2018): all processes seem to work now.
Author
Owner
<!-- gh-comment-id:404110977 --> @tonioo commented on GitHub (Jul 11, 2018): Fixed by https://github.com/modoboa/modoboa-installer/commit/9eed99d88430918e0ff5c336b36655c5297c4e47 and https://github.com/modoboa/modoboa-installer/commit/d845ce78d0d4849234e2929d23f91fa47da0f003.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1073
No description provided.