Error Opening DB: mysqli_real_connect(): SSL: Operation timed out in MySQLi.php - Intermittent Patient Documents Bug

Situation
Patient documents fail to display - Occurs about 90% of attempts

Steps To Reproduce:

  1. Open patient dashboard
  2. Open Documents
  3. Click any Document Category
  4. Click “or Open Module”

At this stage I will sometimes see the actual error message in question:

{"success":false,"message":"DataAdapter (default) Error Opening DB: mysqli_real_connect(): SSL: Operation timed out in MySQLi.php at line 111 (retry attempts: 0)","errors":[],"stackTrace":["0 \/var\/www\/localhost\/htdocs\/openemr\/portal\/patient\/fwk\/libs\/verysimple\/Phreeze\/DataAdapter.php(213): DataAdapter->Open()","1 \/var\/www\/localhost\/htdocs\/openemr\/portal\/patient\/fwk\/libs\/verysimple\/Phreeze\/DataAdapter.php(231): DataAdapter->RequireConnection()","2 \/var\/www\/localhost\/htdocs\/openemr\/portal\/patient\/fwk\/libs\/verysimple\/Phreeze\/DataSet.php(231): DataAdapter->Select()","3 \/var\/www\/localhost\/htdocs\/openemr\/portal\/patient\/fwk\/libs\/verysimple\/Phreeze\/DataSet.php(415): DataSet->Count()","4 \/var\/www\/localhost\/htdocs\/openemr\/portal\/patient\/libs\/Controller\/OnsiteDocumentController.php(153): DataSet->GetDataPage()","5 \/var\/www\/localhost\/htdocs\/openemr\/portal\/patient\/fwk\/libs\/verysimple\/Phreeze\/Dispatcher.php(172): OnsiteDocumentController->Query()","6 \/var\/www\/localhost\/htdocs\/openemr\/portal\/patient\/index.php(54): Dispatcher::Dispatch()","7 {main}"]}
  1. Otherwise select any document

At this stage, about 10% of the time everything will work and the document will render. It seems to be the case that once one document will render, they all will while I remain in the Document Actions view (sometimes pressing the refresh button will help but not always).

The other 90% of the time, clicking the document name will simply have no effect, or the “Chart to Categories” button will appear but the document will not render. Again, when this happens it seems that it will fail to render any documents while I remain in the Document Actions view.

Something interesting I found is that getting the error message does not mean that you have gotten a “cant render documents” session, so maybe this error is separate from the intermittent inability to render documents?

I have tried this on both new and existing patients with the same results.

I saw this behavior in version 7.0.2 (when I originally installed) and it persists after upgrading to 7.0.2 Patch 1

I have tested this in both Firefox and Edge

I am running OpenEMR Cloud Standard Edition - Ubuntu 20.04.6 LTS

I see the following in the logs but I am not sure if this is related:

/var/www/logs # cat error.log
[Sun Sep 29 20:42:17.033964 2024] [php:error] [pid 466] [client 107.77.89.17:7877] script '/var/www/localhost/htdocs/openemr/portal/sign/assets/signit.php' not found or unable to stat
[Sun Sep 29 21:07:14.042636 2024] [php:warn] [pid 475] [client 46.174.191.32:28586] PHP Warning:  Undefined array key "HTTP_HOST" in /var/www/localhost/htdocs/openemr/index.php on line 12
[Sun Sep 29 21:11:03.562772 2024] [php:warn] [pid 477] [client 164.92.228.6:17149] PHP Warning:  Undefined array key "HTTP_HOST" in /var/www/localhost/htdocs/openemr/index.php on line 12
[Sun Sep 29 21:11:03.764562 2024] [php:warn] [pid 440] [client 164.92.228.6:25017] PHP Warning:  Undefined array key "HTTP_HOST" in /var/www/localhost/htdocs/openemr/index.php on line 12
[Sun Sep 29 21:11:04.264713 2024] [php:warn] [pid 442] [client 164.92.228.6:4059] PHP Warning:  Undefined array key "HTTP_HOST" in /var/www/localhost/htdocs/openemr/index.php on line 12
[Sun Sep 29 22:31:21.485598 2024] [allowmethods:error] [pid 484] [client 103.186.101.138:35570] AH01623: client method denied by server configuration: 'CONNECT' to /var/www/localhost/htdocs/openemr/
[Sun Sep 29 22:34:36.870984 2024] [php:warn] [pid 484] [client 205.210.31.186:50635] PHP Warning:  Undefined array key "HTTP_HOST" in /var/www/localhost/htdocs/openemr/index.php on line 12

Any and all assistance is greatly appreciated!

hi @Goddard , what version of mysql is running on the AWS RDS?

8.0.36 is the mysql version currently running on AWS RDS, we are in us-east-2

HUGE thanks for taking a look at this @stephenwaite !

There is a bug with selecting if document doesn’t show in history table when > 20 documents.
I’m fixing now however sort table status to ensure editing status is on top by clicking Review Status table header to sort. Also selecting and calling document from Documents drop down has issues. Best to use Open Module.

I may open a topic to get feedback on this feature for patch.

Just to confirm, I have fewer than 20 documents so I am not sure if this is the same issue but maybe they are related?

Also, I have never seen that “Documents and Forms” header/screen shown in your first image, when I click “or Open Module” this is the screen that comes up, is this the result of a custom module?

Either way, what is the best way for me to know when the 20+ documents fix is complete / available? Is there a GitHub issue I should watch or should I simply wait for the new topic to be created?

Again, MASSIVE THANK YOU for your support and all the work you have put into OpenEMR over the years!

I meant 20+ documents in the activity history when pagination is larger than 20 activities.
Still there are several different issue with this feature.

Mainly what I see with your issue is DB access or script access from a pathing issue.

Still perhaps what I’m doing will address.
Track progress in my PR More Changes and Fixes Modules by sjpadgett · Pull Request #7755 · openemr/openemr · GitHub and changes will be in patch. My screens are different than yours because I have refactored much of the look and feel for the feature.

I started developing this several years ago but just never had the time to finish my end goals which is to have an alternative to LBF. I hope the effort I’m putting in now will get us closer closer.

And you’re welcome. Many times a thank you will go a long way with those of us that maintain the project.

1 Like

I just realized that the script signit.php was removed in v7.0.x unsure which so you are out of date somewhere or how. The signit.php script was included in v6.0.0 and meant for remote app on openemr start!

Look to see if the run application on login in lists (apps) is Active. None should be.

Confirmed - run application on login in lists (apps) is not active for any

@sjpadgett also, I see More Changes and Fixes Modules by sjpadgett · Pull Request #7755 · openemr/openemr · GitHub was merged recently but I do not see a new patch on OpenEMR Patches - OpenEMR Project Wiki or a new tag in Tags · openemr/openemr · GitHub

Are there additional merges that need to happen before the next patch?

Thanks!