zid1988

Member
Jun 21, 2019
6
0
1
Kolkata
cPanel Access Level
Website Owner
Hello,

I have a PHP cron job that is set to fetch emails from my email address to a CRM. It was working fine earlier but suddenly it stopped working. Not sure why.

However, when I run the PHP script manually by accessing it via domain based link, the script runs and does its job. But I have set it to run automatically in my cPanel, and it's not running automatically.

Cron job path in cPanel - /usr/local/bin/php -q /home/maverick/public_html/script.php

Any help would be greatly appreciated.

Regards,
Om
 

David Colter

Active Member
Jun 30, 2016
40
10
8
USA
cPanel Access Level
Root Administrator
Hello Om,

Try these:

1. What does the cron log say about running the script?
Code:
# grep script.php /var/log/cron
2. What are the time settings shown in the cron panel for the file script.php? Could they have been changed?
 

zid1988

Member
Jun 21, 2019
6
0
1
Kolkata
cPanel Access Level
Website Owner
Hello Om,

Try these:

1. What does the cron log say about running the script?
Code:
# grep script.php /var/log/cron
2. What are the time settings shown in the cron panel for the file script.php? Could they have been changed?
Hi David,

Thank you for your reply.

Please find the output of the grep command below -

Jun 19 09:18:01 av-salk CROND[27437]: (username) CMD (/usr/local/bin/php -q /home/username/public_html/script.php)

Regarding the time in cron panel, it shows (* * * * *) for Minute, Hour, Day, Month, Weekday.

Please advise. I am really confused.

Thanks in advance.
 

zid1988

Member
Jun 21, 2019
6
0
1
Kolkata
cPanel Access Level
Website Owner
How about secure log?

Code:
tail  /var/log/secure
Hi garconcn,

Thanks for your reply.

Here is the output of the tail command -

Code:
Jun 24 10:07:17 av-salk sshd[14425]: pam_succeed_if(sshd:session): conversation failed
Jun 24 10:07:17 av-salk sshd[14425]: pam_succeed_if(sshd:session): auth could not identify password for [username]
Jun 24 10:07:17 av-salk sshd[14425]: pam_unix(sshd:session): session opened for user username by (uid=0)
Jun 24 10:07:36 av-salk sshd[15203]: Invalid user redmine from <some ip address was mentioned here>
Jun 24 10:07:36 av-salk sshd[15205]: input_userauth_request: invalid user redmine
Jun 24 10:07:36 av-salk sshd[15203]: pam_unix(sshd:auth): check pass; user unknown
Jun 24 10:07:36 av-salk sshd[15203]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=<same ip as above>
Jun 24 10:07:38 av-salk sshd[15203]: Failed password for invalid user redmine from <again same ip> port 59152 ssh2
Jun 24 10:07:38 av-salk sshd[15205]: Received disconnect from <same ip>: 11: Bye Bye
Jun 24 10:07:50 av-salk sudo:  username : TTY=pts/0 ; PWD=/home/username ; USER=root ; COMMAND=/bin/bash
Let me know if you need anything else.

Thanks in advance.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
I have set it to run automatically in my cPanel, and it's not running automatically.

How have you determined that it isn't running automatically? My point being, if nothing has changed it seems more likely that the email is not being delivered for some reason, you might check the exim logs to determine if there was an issue with sending the email or if it was rejected.
 

garconcn

Well-Known Member
Oct 29, 2009
172
18
68
Hi garconcn,

Thanks for your reply.

Here is the output of the tail command -

Code:
Jun 24 10:07:17 av-salk sshd[14425]: pam_succeed_if(sshd:session): conversation failed
Jun 24 10:07:17 av-salk sshd[14425]: pam_succeed_if(sshd:session): auth could not identify password for [username]
Jun 24 10:07:17 av-salk sshd[14425]: pam_unix(sshd:session): session opened for user username by (uid=0)
Jun 24 10:07:36 av-salk sshd[15203]: Invalid user redmine from <some ip address was mentioned here>
Jun 24 10:07:36 av-salk sshd[15205]: input_userauth_request: invalid user redmine
Jun 24 10:07:36 av-salk sshd[15203]: pam_unix(sshd:auth): check pass; user unknown
Jun 24 10:07:36 av-salk sshd[15203]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=<same ip as above>
Jun 24 10:07:38 av-salk sshd[15203]: Failed password for invalid user redmine from <again same ip> port 59152 ssh2
Jun 24 10:07:38 av-salk sshd[15205]: Received disconnect from <same ip>: 11: Bye Bye
Jun 24 10:07:50 av-salk sudo:  username : TTY=pts/0 ; PWD=/home/username ; USER=root ; COMMAND=/bin/bash
Let me know if you need anything else.

Thanks in advance.
Thanks for the log. One of my server has exactly same issue since Jun 20th. I just found several other reports from stackexchange, they run WHM/cPanel too.
Sorry, I don't have a solution.

- Removed -
 
Last edited by a moderator:

zid1988

Member
Jun 21, 2019
6
0
1
Kolkata
cPanel Access Level
Website Owner
How have you determined that it isn't running automatically? My point being, if nothing has changed it seems more likely that the email is not being delivered for some reason, you might check the exim logs to determine if there was an issue with sending the email or if it was rejected.
Hi Lauren,

Thank you for your reply on this thread.

Actually, I have a CRM that fetches emails from a domain based email using a PHP script which I have set to run automatically using the cPanel Cron jobs panel. So whenever somebody sends an email to that specific email address, it lands in my CRM.

Now the issue is that I am receiving emails on that email address but nothing is landing in the CRM. But if I go ahead and run the script manually using the direct link (www.example.com/script.php), the email lands into the CRM. Hence, I thought that maybe the Cron job is not running automatically.

P.S.- Our email server was down a few days ago, so I contacted support and they asked me to restart the exim server. Since then this issue is happening.

Let me know your thoughts.

Thanks in advance.
 
Last edited by a moderator:

zid1988

Member
Jun 21, 2019
6
0
1
Kolkata
cPanel Access Level
Website Owner
Thanks for the log. One of my server has exactly same issue since Jun 20th. I just found several other reports from stackexchange, they run WHM/cPanel too.
Sorry, I don't have a solution.

- Removed -

No problem. Thanks for trying though. Appreciate it.
 
Last edited by a moderator:

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
Based on the output from the cron log it looks like the cron is running but, it also would sound like there is an error. While it may be related to the issue @garconcn is referencing none of the entries in your output of /var/log/secure reference an issue with cron, they're all SSH specific.

Do you have selinux enabled on the server? You might check by running the following:

Code:
sestatus
 

zid1988

Member
Jun 21, 2019
6
0
1
Kolkata
cPanel Access Level
Website Owner
Based on the output from the cron log it looks like the cron is running but, it also would sound like there is an error. While it may be related to the issue @garconcn is referencing none of the entries in your output of /var/log/secure reference an issue with cron, they're all SSH specific.

Do you have selinux enabled on the server? You might check by running the following:

Code:
sestatus

selinux status shows as disabled. Do I need to enable it? How do I do that?
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
That's good, It shouldn't be enabled as it can cause issues with cPanel/WHM. If you have root access to the server (which I'm assuming you do) feel free to open a ticket using the link in my signature? Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved.


Thanks!