1

I have a script which runs perfectly in terminal, but when I tried to run that in crontab every "5 minutes", I got following errors in /var/log/messages:

crond: sendmail: fatal: parameter inet_interface: no local interface found for ::1

Crontab entry:

*/5 * * * * /bin/python /scripts/python/account.py >> /script/python/account.log

Note: In my script I am running an aws command (Which might be the reason):

aws cloudwatch put-metric-data <----options and parameters---->

If anyone could shed some light as to why I am getting this error and to what I can do to overcome this, that would be a great help.

Thanks.

update 1

Only command that is trying to send information out of system is the aws one, I am using following code to run that command:

os.system("aws cloudwatch put-metric-data <----options and parameters---->")
  • Posting the full script would be helpfull – Raman Sailopal Nov 8 '17 at 15:51
  • @RamanSailopal, I can't post the whole script due to security reasons, Although if you could tell me what this error is related to, I can provide you with the needed code snippet.. – Amit Nov 8 '17 at 16:18
  • What flavor of sendmail is this? – thrig Nov 8 '17 at 16:19
  • 1
    cron is trying to send email, but the email subsystem isn’t configured correctly. The python script is irrelevant. – Jeff Schaller Nov 8 '17 at 16:22
  • 1
    Maybe it runs successfully but produces some stderr , which isn’t being redirected. – Jeff Schaller Nov 8 '17 at 18:57
1

Here's what resolved my problem

I updated /etc/postfix/main.cf file as:

  1. comment out: inet_interfaces: all
  2. add inet_protocol: ipv4

Now I am not getting any sendmail error at all in /var/log/messages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.