Error message when logging into the patient portal

Situation
When logging into the patient portal, this error message appears:

Error: {“success”:false,“message”:“DataAdapter (default) Error Opening DB: Packets out of order. Expected 1 received 0. Packet size=145 in MySQLi.php at line 128 (retry attempts: 0)”,“errors”:[],“stackTrace”:[“0 /var/www/html/openemr/portal/patient/fwk/libs/verysimple/Phreeze/DataAdapter.php(213): DataAdapter->Open()”,“1 /var/www/html/openemr/portal/patient/fwk/libs/verysimple/Phreeze/DataAdapter.php(231): DataAdapter->RequireConnection()”,“2 /var/www/html/openemr/portal/patient/fwk/libs/verysimple/Phreeze/DataSet.php(225): DataAdapter->Select()”,“3 /var/www/html/openemr/portal/patient/fwk/libs/verysimple/Phreeze/DataSet.php(409): DataSet->Count()”,“4 /var/www/html/openemr/portal/patient/libs/Controller/OnsiteDocumentController.php(154): DataSet->GetDataPage()”,"5 /var\

The error is hard to duplicate because it appears when logging in for the fist time after a delay, such as overnight.

OpenEMR Version
I’m using OpenEMR version 6.1.0(1)

Browser:
I’m using: Firefox

Operating System
I’m using: Server Ubuntu 20.04 Client: Windows 10

Logs
Did you check the logs?
Was there anything pertinent in them?
Please paste them here (surround with three backticks (```) for readability.
You can also turn on User Debugging under Administration->Globals->Logging User Debugging Options=>All