Project

General

Profile

Bug #32685

Fix alias bug that prevented certain users from not being added to /etc/aliases

Added by Ix Yps 12 months ago. Updated 10 months ago.

Status:
Done
Priority:
No priority
Assignee:
Waqar Ahmed
Category:
Middleware
Target version:
Seen in:
Severity:
Medium
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No
Tags:

Description

When a Cron Job is configured to run as any user not being mentioned in /etc/aliases, the following error is triggered and logged to /var/log/maillog:

Apr 26 04:14:10 zin /find_alias_for_smtplib.py[92074]: sending mail to -FCronDaemon, -odi, -oem, -oi
From: Cron Daemon <ix@box.local>
To: ix
Subject: Cron <ix@box> PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin" 
Apr 26 04:14:10 zin /find_alias_for_smtplib.py[92074]: No aliases found to send email to ix

Interestingly, manually adding ix: root to /etc/aliases has no effect.

If the cron job is configured to run as an existing user (eg games), to problem does not occur.

Associated revisions

Revision bb28c269 (diff)
Added by Waqar Ahmed 11 months ago

/etc/alias bug fixed - some users were not getting an entry in alias file
Ticket: #32685

Revision 0587bc27 (diff)
Added by Waqar Ahmed 11 months ago

Ticket: #32685
Users not getting email - Bug fix

Revision db111070
Added by Waqar Ahmed 10 months ago

Merge pull request #1198 from freenas/ticket-32685

Ticket: #32685

Revision 8f3752dd (diff)
Added by Waqar Ahmed 10 months ago

Ticket: #32685
Users not getting email - Bug fix

History

#1 Updated by Dru Lavigne 12 months ago

  • Private changed from No to Yes
  • Reason for Blocked set to Need additional information from Author

Please attach a debug (System -> Advanced -> Save Debug).

#2 Updated by Ix Yps 12 months ago

Since it contains sensitive information, could I just send a subset of that debug? Which?

#3 Updated by Dru Lavigne 12 months ago

  • Assignee changed from Release Council to William Grzybowski

William: which logs would be useful?

#4 Updated by William Grzybowski 12 months ago

Why is the user not in aliases? Is that an AD/LDAP user?

#5 Updated by Ix Yps 12 months ago

William Grzybowski wrote:

Why is the user not in aliases? Is that an AD/LDAP user?

The user was created via Account > Users > Add User. Neither modifying the user (changing the email address) nor re-creating it has any effect regarding the issue.

However, after some more tests creating new users with different parameters, I realize that the issue depends on the username:

  • Usernames a, f, g, h remain without an entry in /etc/aliases upon creation.
  • Usernames i, j, x do get an entry in /etc/aliases.

I didn't try others like b, c, d, e or j to w, y, z, but current data could be an indicator for a-h failing and i-z working.

(Note that I actually never had ix as a username in my tests - i was just obfuscating the report. Feel free to change it to any of the failing letters in the initial descripton.)

#6 Updated by William Grzybowski 12 months ago

  • Status changed from Unscreened to Screened
  • Reason for Blocked deleted (Need additional information from Author)

#7 Updated by Ix Yps 12 months ago

Unsure if this is directly related, but I am now running the cron job as a user that does get an /etc/alias entry.

/var/log/maillog says the following, but no email ever reaches the mail server:

May 6 15:52:07 box /find_alias_for_smtplib.py[46866]: sending mail to -FCronDaemon, -odi, -oem, -oi

(Note that the test mail at System > Email > Send Test Mail works just fine.)

#8 Updated by William Grzybowski 12 months ago

  • Assignee changed from William Grzybowski to Waqar Ahmed
  • Target version changed from Backlog to 11.2-RC2

Waqar, could you try to reproduce and investigate that issue, please?

#9 Updated by Waqar Ahmed 11 months ago

  • Status changed from Screened to In Progress

#10 Updated by Waqar Ahmed 11 months ago

Ix Yps wrote:

Unsure if this is directly related, but I am now running the cron job as a user that does get an /etc/alias entry.

/var/log/maillog says the following, but no email ever reaches the mail server:

May 6 15:52:07 box /find_alias_for_smtplib.py[46866]: sending mail to -FCronDaemon, -odi, -oem, -oi

(Note that the test mail at System > Email > Send Test Mail works just fine.)

Hi Ix. Can you kindly share cron file and maillog file. You'll find them under /var/log/. Many thanks. Cheers

#11 Updated by Waqar Ahmed 11 months ago

  • Status changed from In Progress to Blocked
  • Reason for Blocked set to Waiting for feedback

#12 Updated by Waqar Ahmed 11 months ago

Hi Ix, Just checking up. Could you kindly share the logs ? Cheers : )

#13 Updated by Ix Yps 11 months ago

  • File var_log_cron.txt added
  • File var_log_maillog.txt added
  • File etc_crontab.txt added

Hi Ix. Can you kindly share cron file and maillog file. You'll find them under /var/log/. Many thanks. Cheers

Dear Ahmed, please find the files attached.

#14 Updated by Dru Lavigne 11 months ago

  • Status changed from Blocked to Screened
  • Reason for Blocked deleted (Waiting for feedback)

#15 Updated by Waqar Ahmed 11 months ago

  • Status changed from Screened to In Progress

#16 Updated by Waqar Ahmed 11 months ago

Hi Ix. Thank you for your response. I have looked at the logs and I would like some more data to assess the failing mails. Could you kindly provide me with middlewared.log as well ? And the output you get from typing ```midclt call core.get_jobs | jq .``` in the shell ? Thank you Ix for your time. Cheers

#17 Updated by Waqar Ahmed 11 months ago

  • Status changed from In Progress to Blocked
  • Reason for Blocked set to Waiting for feedback

#18 Updated by Ix Yps 11 months ago

  • File middlewared.log added
  • File get_jobs.json added

Waqar Ahmed wrote:

Hi Ix. Thank you for your response. I have looked at the logs and I would like some more data to assess the failing mails. Could you kindly provide me with middlewared.log as well ? And the output you get from typing ```midclt call core.get_jobs | jq .``` in the shell ? Thank you Ix for your time. Cheers

Dear Ahmed, please find the files attached.

#19 Updated by Waqar Ahmed 11 months ago

  • Status changed from Blocked to Screened

#20 Updated by Waqar Ahmed 11 months ago

  • Reason for Blocked deleted (Waiting for feedback)

#21 Updated by William Grzybowski 11 months ago

  • Status changed from Screened to Blocked
  • Reason for Blocked set to Waiting for feedback

Both logs provided are truncated.

Please add full output, including all middlewared.log.* (rotated ones).

#22 Updated by Ix Yps 11 months ago

William Grzybowski wrote:

Both logs provided are truncated.

Please add full output, including all middlewared.log.* (rotated ones).

Both logs contain the entire day 24th of May - since var_log_maillog.txt was from that day too. There is only middlewared.log (no rotated ones).

Please let me know what we're looking for. (I cannot provide the entire files with sensitive information.)

#23 Updated by William Grzybowski 11 months ago

Ix Yps wrote:

William Grzybowski wrote:

Both logs provided are truncated.

Please add full output, including all middlewared.log.* (rotated ones).

Both logs contain the entire day 24th of May - since var_log_maillog.txt was from that day too. There is only middlewared.log (no rotated ones).

Please let me know what we're looking for. (I cannot provide the entire files with sensitive information.)

I dont know what we are looking for. Thats the problem, we wont know until we see it, since we cant reproduce the problem. Not having access to all logs makes it more difficult.

The "midclt" command was supposed to have 75 entries, somehow you only have one. middlewared.log was also supposed to have many entries.

Perhaps if you reboot we will have more sane outputs.

#24 Updated by Ix Yps 11 months ago

William Grzybowski wrote:

[...] since we cant reproduce the problem. [...]

I just installed a new system from scratch (to a different machine). There, cron emails are working as expected.

I'll update once I have more data on the disfunctional machine.

#25 Updated by Waqar Ahmed 10 months ago

Hi Ix, doing a follow up. Do you have some more data for us to analyze ? Thank you

#26 Updated by Ix Yps 10 months ago

  • File 20180607_185756_FreeNAS-11.1-U5_8e2a858a1_Update_history.png added

Dear Waqar, I ended up reinstalling FreeNAS. Cron e-mails are working now.

For later reference, I kept a screenshot of the previous update history (attached).

In case the problem reoccurs with other users, it may be useful for reference.

Since I didn't post sensitive information to this bug report, feel free to make it public.

#27 Updated by Dru Lavigne 10 months ago

  • File deleted (var_log_cron.txt)

#28 Updated by Dru Lavigne 10 months ago

  • File deleted (var_log_maillog.txt)

#29 Updated by Dru Lavigne 10 months ago

  • File deleted (etc_crontab.txt)

#30 Updated by Dru Lavigne 10 months ago

  • File deleted (middlewared.log)

#31 Updated by Dru Lavigne 10 months ago

  • File deleted (get_jobs.json)

#32 Updated by Dru Lavigne 10 months ago

  • Status changed from Blocked to Closed
  • Target version changed from 11.2-RC2 to N/A
  • Private changed from Yes to No
  • Reason for Closing set to Cannot Reproduce
  • Reason for Blocked deleted (Waiting for feedback)

#33 Updated by Waqar Ahmed 10 months ago

  • Status changed from Closed to Ready for Testing
  • Target version changed from N/A to Backlog
  • Reason for Closing deleted (Cannot Reproduce)

The issue was partly reproducible, and a PR has been merged into master for that.
PR - https://github.com/freenas/freenas/pull/1198

#34 Updated by Dru Lavigne 10 months ago

  • Subject changed from Mails from Cron fail: "No aliases found to send email to $USER" to Fix alias bug that prevented certain users from not being added to /etc/aliases
  • Target version changed from Backlog to 11.2-BETA1
  • Needs Merging changed from Yes to No

#35 Updated by Dru Lavigne 10 months ago

  • File deleted (20180607_185756_FreeNAS-11.1-U5_8e2a858a1_Update_history.png)

#37 Avatar?id=55038&size=24x24 Updated by Zackary Welch 10 months ago

  • Needs QA changed from No to Yes

#38 Avatar?id=55038&size=24x24 Updated by Zackary Welch 10 months ago

  • Status changed from Ready for Testing to Passed Testing

Unable to reproduce, so this seems fixed.

#39 Avatar?id=55038&size=24x24 Updated by Zackary Welch 10 months ago

  • Needs QA changed from Yes to No

#40 Updated by Dru Lavigne 10 months ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF