0

I work with an open source package call OpenEMR https://github.com/openemr/openemr/.

I am having a problem with the ACL display screen. It displays this error message. ERROR, unable to collect data from server

This is a link to the code in reference. https://github.com/openemr/openemr/blob/2e1087e3c371ee08268cd1e7777c6a76b10e7cfa/interface/usergroup/adminacl.php#L214

I have set traps on the server. The server is send/echoing out the XML. I have captured the XML in a file on the server. So, I know that server side is processing the request and sending a response.

//PROCESS USERNAME REQUESTS
if ($_POST["control"] == "username") {
  if ($_POST["action"] == "list") {
     //return username list with alert if user is not joined to group
      echo username_listings_xml($error);
   }
}

https://github.com/openemr/openemr/blob/2e1087e3c371ee08268cd1e7777c6a76b10e7cfa/library/ajax/adminacl_ajax.php#L51

The server is on AWS and is Ubuntu 20.04. PHP 7.4 Apache 2.x.

So, I was digging into the system so more and what I found is that the response from the server has a blank line inserted into the response.

I found this by looking at the browser XHR.

XHR report

So, what can be causing the blank line to appear in the response. The browsers receives the blank line first and stops because it thinks the response is empty.

I checked the file where the content is being echoed from and there is not a closing ?> tag. I tested the system by file_put_contents into a file and the blank line is not there. I believe this to be a server level issue. Until I can prove different.

2
  • 1
    I found a solution that worked. Added ob_clean(); before the echo command. The blank line is gone and the page works normal again. – user1794918 May 10 at 3:21
  • 1
    It means there is an empty line outside of <?php tags somewhere before this spot. Finding it would require reading through the whole execution path until this point. – Tero Kilkanen May 10 at 19:09

Your Answer

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

Browse other questions tagged or ask your own question.