Cannot get cronjob to run in cpanel
Hi,
I have spend many days trying to get to the bottom of why my cron job wont run in cpanel. I am using a component called Acymailing and the cron jobhas stopped working. I don't know if it is a php thing (I am on php 8.0) or an issue with something on the server (I have a dedicated server).
This is my cronjob:
/usr/bin/wget -O /dev/null " /dev/null 2>&1
I have followed an instruction on here to check what crons are set via the terminal and can see my cron jobs including the one that never runs within my site under the correct username.
The cronjob runs fine from the url it just wont run from the cpanel cronjob.
This is what I ran in the terminal based on a support suggestion in another thread:
[root@****** ~]# crontab -l -u mysite
SHELL="/usr/local/cpanel/bin/jailshell"
0 1,11 * * * /usr/bin/wget -O /dev/null " /dev/null 2>&1
*/10 * * * * /usr/bin/wget -O /dev/null " /dev/null 2>&1
*/14 * * * * /usr/bin/wget -O /dev/null "/dev/null 2>&1
*/12 * * * * /usr/bin/wget -O /dev/null " /dev/null 2>&1
0 0,12 * * * /usr/bin/php /home/mysite/public_html/components/com_osproperty/cron.php >/dev/null 2>&1
*/16 * * * * /usr/bin/php /home/mysite/public_html/components/com_jreviews_addons/queue/worker-many.php >/dev/null 2>&1
0,10 * * * * /usr/bin/php /home/mysite/public_html/jreviewscron.php > /dev/null 2>&1
0,10 * * * * /usr/bin/wget -O /dev/null " /dev/null 2>&1
I am not sure what jailshell is that came back in the results. I also do recall seeing this in emails from the server:
/usr/local/cpanel/bin/jailshell:
-
Why don't you run this with direct paths instead of wget? I think that would be a better solution here. 0 -
Hi, thanks for responding. Could you provide an example what a direct path looks like? I am a complete novice with cronjobs and have tried all sorts of solutions I have found online but none work so far. I also wanted to know if that jailbreak message was anything to be concerned about. Kind regards 0 -
Hi CPrex, thanks for your reply I just tried this: /usr/bin/php /home/mysite/public_html/index.php?option=com_acym&ctrl=cron > /dev/null 2>&1 Is this the correct way to write it? as those other examples go straight to an actual php file where the above is a url link? Do I need this jailshell? Could that be part of the problem why it isn't firing? 0 -
I still think there's some confusion. Let's not worry about jailshell for now. Do you need the PHP scripts to run like they are in a browser? Calling the path with /home isn't a link like what a browser would use. Is this a certain piece of software you purchased? If so, that company may be able to tell you how to run the cron jobs. 0 -
I have been in contact with the component developer acyba.com and this is what they said: "If you want to use your own server cron job instead, you have to properly configure a cron job. Just placing your cron job URL is not good enough because you also need to configure a command which will try to open cron job URL and trigger it that way For example, something like this wget --no-check-certificate -O /dev/null "href=" /dev/null 2>&1 " But i couldn't get that to fire. 0 -
I would guess that's just a formatting issue from the way they sent you the code. Can you try this manually on the command line to see if it worsk for you there? wget --no-check-certificate https://www.mysite.com/index.php?option=com_acym&ctrl=cron > /dev/null 2>&1
0 -
Hi, this is what is returned when I run that in command line: [root@**** ~]# wget --no-check-certificate Resolving www.mysite.com (www.mysite.com)... ***.***.**.** Connecting to www.mysite.com (www.mysite.com)|**.***.**.**|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: "index.php?option=com_acym" [ <=> ] 18,788 --.-K/s in 0s 2022-08-31 18:12:38 (177 MB/s) - "index.php?option=com_acym" saved [18788] 0 -
Have you looked in the file " index.php?option=com_acym " (yea, it's a fully name) and see if there is any output/errors? 0 -
I guess we don't have enough details to know for sure what the intended behavior is. If it's supposed to save that file, then the test we performed is working well and I would also expect that to work in a cron job. 0 -
I am still trying to figure it out sadly. I found that file (i didn't know where it was saving). Anyway, it is a 500 error apparently, but I dont know what is triggering it or ho 0 -
I am still trying to figure it out sadly. I found that file (i didn't know where it was saving). Anyway, it is a 500 error apparently, but I dont know what is triggering it or how to identify. Could it be a permission issue? If yes, how would i be able to check and correct this? I tried to post the output of that files on here but it throws an error and wouldn't save. 0 -
It might be time to poke your hosting provider, as they'd have the necessary credentials to check those errors as the root user and see if it gives more helpful details. 0 -
Thats my problem I am on a dedicated server on my own as my host dont manage dedicated servers. I have root access I just dont know the commands to write to investigate 0 -
Thanks for the additional details. If you're seeing a 500 error, it's best to check the Apache logs while that error is happening with this command: tail -f /etc/apache2/logs/error_log
That will show you the logs in real-time while they are happening, so if you can reproduce the issue and make it happen, you'll see what is logged on the server.0 -
Hi Cprex, thank you! This is what the outcome is of that command (I do not have wordpress so not sure what wp-login.php is) also it wont let me post all the output here so just posting the first 2 lines which are basically repeated: [Thu Sep 01 20:12:07.951424 2022] [:error] [pid 20394:tid 47308845602560] [client 171.244.17.110:34460] File does not exist: /var/www/html/wp-login.php [Thu Sep 01 20:26:23.737416 2022] [proxy_fcgi:error] [pid 31549:tid 47307544590080] [client 179.70.100.34:39474] AH01071: Got error 'Primary script unknown' 0 -
Thanks for that. The first line wouldn't be related, but the second one could be, although it doesn't tell us much. Since you have root access to the server, could you create a support ticket with our team so we can check this out directly on the system? 0 -
Hi Cprex, how do I do that? 0 -
Inside WHM you'll have the "Create a Support Ticket" option that will get the process going for you. 0 -
Ah, I found it. I have hoepfully submitted the support correctly? I have added a link to this thread 0 -
Apologies, I did it by clicking on the link in your reply, shall I do it via WHM? 0 -
I clicked on the link in your reply is that the same thing? If not I will go to WHM support area. 0 -
It all gets you to the same place :D Can you post the ticket number here so I can follow along? 0 -
Hi, just to let you/others know. Cpanel support staff helped identify what the problem was and pointed me where to go to work on the solution. Basically it is a problem with the HelixUlimate Framework system plugin which is part of the template creation component provided by joomshaper.com I have contacted them regarding a fix. Hope this helps others in their troubleshooting. Thanks so much cpanel team for being so helpful and quick to help trouble shoot. If I discover anything more regaeding this that may help I will post back. Once again thanks. On another note there seems to be an issue on these forums when replying to threads, it keeps throwing a whoops error cookies are required - even though they have been accepted and so have to trim down the response. 0 -
I'm glad to hear we were able to help! 0 -
Hi, as promised, I am back with a progress update. Unfortunately it still isn't resolved. It turned out not to be the template plugin as when default Joomla template enabled its still same issue. It seems to be that the server is rejecting the cron jobs and throws 500 errors. Someone suggested it may be a user permissions error but I don't know how to check or correct this (what the command lines are for Terminal). Someone else suggested it may be a timeout issue causing it. My question is, what would be the commands to check/rule out the above to potential causes? What else might cause the cron jobs to be rejected? Finally, what does the jailbreak error I initially mentioned mean? Could that be the issue? Hope someone can help as its nearly 3 weeks on and still not able to get the crons to run automatically. 0 -
Could you reply to the ticket you have open with us so we can take a deeper look there? 0
Please sign in to leave a comment.
Comments
27 comments