I am trying to debug a problem with an application in CI. I have experience in PHP but not with CI. This app was written by someone else. It has been running untouched for the past 4 years. In the past 10 days it started returning errors. I traced it down to a controller. It starts by checking the parameters. These include values plus an attached file and are sent using multipart/form-data.
$post_details = $_POST;
$json_request = json_encode($post_details);
write_to_log($json_request);
if ($post_details && isset($post_details['acc']) && !empty($post_details['acc']) ... ){
...
} else {
die(json_encode("code"=>500,"error"=>"Missing parms");
}
Note: Above is simplified paraphrase of actual code which is bit lengthy.
Anyway, the write_to_log shows all the parameters that were sent to it. Normally, another program on another server calls this function. For my testing, I used Postman.
Now the problem:
When I call the function from Postman in rapid succession, the log shows the parameters.
If I change one value and call again after waiting 30 or so seconds, log shows parameters.
But if I call within a few seconds, log shows that no data was received in $post_details. Also, I don’t get the response in Postman but get a timeout after a while. All subsequent hits then show the parameters.
As I said, this program has been running untouched for years and this started happening only a couple of weeks back.