CronJobs not retreiving any answer

Website URL

(please specify the URL of the site on which you are experiencing the problem)

Error Message

No response body was captured for this cron job execution.

Could not resolve host: www.epto-project.rf.gd

Other Information

I have this PHP file:

<?php

error_reporting(E_ALL);

header('Cache-Control: no-cache, no-store, must-revalidate');

header('Pragma: no-cache');

header('Expires: 0');

header('Content-Type: application/json;charset=utf-8');

require "../connection.php";

$query = "

UPDATE events

SET `status` = 0

WHERE `status` IN (1, 2)

AND `data` > CURDATE();

UPDATE events

SET `status` = 1

WHERE `status` IN (0, 2)

AND `data` = CURDATE();

UPDATE events

SET `status` = 2

WHERE `status` IN (0, 1)

AND `data` < CURDATE();

";

if (mysqli_multi_query($conn, $query)) {

echo json_encode(TRUE);

} else {

echo json_encode("Error: " . mysqli_error($conn));

}

mysqli_close($conn);

?>

and im getting the response from the cronjob part:
No response body was captured for this cron job execution.

Could not resolve host: www.epto-project.rf.gd

I’m not getting any response, its suposed to get 200 or other response.

I believe cron on free hosting does not work this way.
Read below

4 Likes

The error “Could not resolve host” means that the cron job server could not resolve the DNS of your subdomain. If the server cannot obtain an IP address for your account, it means it cannot start the HTTP request. And if there is no HTTP request, there is no HTTP response, so there is no response body or status code either.

So the data being displayed seems correct, but the fact that half of the cron jobs fail because of a DNS error is not OK. I’ll dive into it and see if I can find what’s causing it.

Please ignore those articles. You seem to have set it up correctly, so the announcement of the feature is irrelevant. And the second article is about the control panel cron jobs, not the client area cron jobs, and scheduling isn’t the issue in the first place.

5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.