Documents jpeg not showing after upgrade from v5 to v7.0.0 (1)

PDF files view fine. The jpeg files only show a square. I have uploaded new images and the same thing happens as the old images.
I checked that imagemagick is installed. Folder permissions are set to www-data:www-data & 0700.
I matched it against the previous install on the other server.
We are on ubuntu 22.04.1 LTS apache 2.4.52.

I have done more testing. I tried downloading the new image file that was uploaded and when trying to open the file on my local windows machine. I get the error that this file format is not supported. Not only are the old image (jpg) files not showing. But any new files that are uploaded are not displaying either in the browser or after downloading the file from the server.

I took a step back and copied the files from the v5 server to the v7 server in to the ~/migration/documents directory. I downloaded and image jpg from from that location to my local machine as I was able to view the file that was transferred to the v7 server. But when I copied the file to the documents fold then downloaded it again. It was unreadable.

Right now, there seems to be an issue with writing any image file to the documents folder by the program or by the command line.

UPDATE: 12/07/2022
I am still digging and some of this is a configuration issue. There is a common occurance that is happening between our install and the OpenEMR demo. There is a page that pops up that did not in v6.

I am not sure what is forcing this open. It is a new file added by @adunsulag . I will try to digest the page as soon as possible. I think this is a side issue and not directly connected to my original issue.

I have concluded it is a code issue. There has been code modification in the code that is not working properly. This is not a server hardware or OS issue. The issue is in the code of OpenEMR. I am searching for the root cause.


What we ended up doing.

  1. We never found the root cause of the issue in the code.
  2. We reapplied all of our changes to the new download of the code.
  3. Tested and everything worked fine.

This is the command that was used to push the files from old server to the new server.

    rsync -razv -e "ssh -i /home/ubuntu/migration/aws_key.pem" /var/www/html/openemr/sites/default/documents ubuntu@

Once the files were pushed to the new server.

  1. The documents folder was removed from under the new install.
  2. Moved the documents folder from the ubuntu/migration folder
  3. Then copied the keys to the migrated documents folder

As far as the preview ccda stuff goes, the preview ccda function only gets called from clicking on a document inside the CCD / CCDA folder (or anything tagged with the LOINC category code for CCDA / CCD) documents. Since a JPG is obviously not a CCDA it will fail. You’re right as its probably a side issue from your original issue.

If we need to be able to store images inside those folders we’ll need to change up the code to skip calling the function if a file that is not an XML file is clicked on.

@adunsulag thanks for the response. However, if you go to the demo site and upload an image then click on that image to view it. This page popups up.

It happens every time. I did a profile on the code but have not tracked down what is calling that linked document code in the document section. I did chase it down and reviewed the code and the linked_document is only to be called in the message feature but something somewhere is calling this function previewCCDADocument. Causing the popup.

I just went to the demo at here and uploaded an image under the patient Haffiza Bano in the Lab Report category. The image uploaded and previews just fine.

I saw that there is an image in the CCDA folder called 2022-12-07 end_of_life_doula.jpg-25 which does indeed break. It breaks because it is an image and NOT an xml file in the CCDA format. We specifically add javascript to change the preview URL for CCD/CCDA files so that it loads up a CCDA file.

I uploaded an example in that Haffiza Bano patient that you can see the CCDA preview file called 2022-12-07 CCDA_Bates_Jeremy_ccd_2022-06-13.xml-30.

That makes perfect sense. That saved me a lot of hours of going nowhere fast