Error: An error occurred during communication with the server.

Error: An error occurred during communication with the server.

by Daniel Barros -
Number of replies: 9

Currently facing the following errors:

 image.png

Here's some info about my installation:

Here's what has happened to get to this point: I'm working on migrating my site from 3.7 to 4.3. We have a version of our website that is currently running on 3.7, being used by at least over 1500 users. We've created a copy of the Moodle files and its database and put it into another server to work around all the errors we would soon face with the upgrades.

After debugging most of our plugins that were either unsupported or broken in some other way, we eventually got to the following plugins, which we've had to manually fix issues for.

image%20%281%29.png

After fixing most of the issues that were created by those plugins, we found ourselves facing issues related to the fact we did not create a copy of moodledata to start doing this migration. Meaning we've been using a newly created moodledata since the migration started, mostly due to the fact that the moodledata folder is quite big (around 139GB) due to how much data has been created from the years of use the website has faced.

So what we did was create a copy of the moodledata folder and bring it over to the test server to see which issues were caused by missing files stored in moodledata. However, after doing so, we started seeing the error shown in the first screenshot seen on my post here.

Here's a few things we've tried so far with little to no success:

  • Deleted the Cache folders inside moodledata
  • Stopped our Docker from copying moodledata entirely in the hopes it would create a new one
  • Tried running both purge_caches.php and upgrade.php

To be clear, we've followed the procedure where we have to go through certain Moodle versions to get to 4.3. We haven't just changed it to 4.3 expecting it to work.

I should add that before logging in as admin, I can see the front page just fine, and some of the courses as well. But as soon as I try going into the administration settings page, I'm faced with that error, and can't do anything. We haven't meddled with any of the core code as far as I'm aware.

Thanks in advance,

Daniel

Average of ratings: -
In reply to Daniel Barros

Re: Error: An error occurred during communication with the server.

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
'moodledata' and the database IS your Moodle site. They both needed to be in place to do the upgrade. If you do other stuff then your site is going to be in an undefined state. Anything could be going wrong.

Also, I have no idea what all those COPY commands are doing in (presumably) your docker files. I recognise most of those plugins as having working 4.3 versions, so why would you be "fixing" them yourselves? 

If you don't have enough space to do a test migration then you need to get rid of some original data or go and buy a bigger disk.

The highest Moodle version you can upgrade to from 3.7 is 4.11. So, start again, and get a copy of 4.11 working properly. That's the first step.
In reply to Howard Miller

Re: Error: An error occurred during communication with the server.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
> The highest Moodle version you can upgrade to from 3.7 is 4.11.

Is that 4.11 a typo? Didn't you mean 3.11?

The OP could plan his upgrade route from this chart: http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases.
In reply to Visvanath Ratnaweera

Re: Error: An error occurred during communication with the server.

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I'm getting ahead of myself big grin

Yes, 3.11
In reply to Howard Miller

Re: Error: An error occurred during communication with the server.

by Daniel Barros -
I've been leading this upgrade without the original moodledata folder, and most of the content worked fine, except for some PDF files in the courses. I got a copy of the moodledata from the live site to confirm if said missing PDF files were causing the last errors I faced.

I've completed all the required steps from 3.7 to 4.3 and resolved issues with several plugins that in fact don't have working 4.3 versions:

Oembed Filter: Last release 4 years ago, required manual tweaks due to deprecated code.
Almondb: Changes were made after advice from their support team; had to be tweaked.
Verify_certificate: Last release 6 years ago, required tweaks for deprecated code.
Questionnaire: Last release 12 months ago, only updated up to version 4.2 of Moodle, faced issues with deprecated code.

I've left out the Certificate plugin because it's an in-house version. Commenting out any plugin didn't affect the errors I'm facing, suggesting they might not be related.

I find the suggestion to "buy a bigger disk" dismissive. I've already resolved the space issue by copying the moodledata folder as clearly stated in my original post. While I understand that would be the solution, it's already been addressed. I believe there might be a more helpful and respectful approach to this issue.
In reply to Daniel Barros

Re: Error: An error occurred during communication with the server.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
You must have seen Moodle migration, haven't you? I'm asking because you do some unorthodox things:

>  We've created a copy of the Moodle files and its database and put it into another server to work around all the errors we would soon face with the upgrades.

> upgrade without the original moodledata folder

No moodledata, really?

> completed all the required steps from 3.7 to 4.3 

In one long jump? See Upgrading.

I don't see the myoverview block in your lists of additional plug-ins. How did you solve https://moodle.org/mod/forum/discuss.php?d=453701#p1823053 ?

In reply to Visvanath Ratnaweera

Re: Error: An error occurred during communication with the server.

by Daniel Barros -
Thank you for your response. It seems there may have been a misunderstanding regarding the upgrade process. Just to clarify, as I've mentioned in both my reply to Howard and towards the end of my original post, we haven't attempted to jump from Moodle 3.7 straight to 4.3. Instead, we've meticulously gone through each iteration, progressing from 3.7, to 3.11, and then to 4.3.

Regarding the solution to the upgrade issue, if memory serves me right, we found success by (temporarily) removing materialized views. This action significantly streamlined the 'myoverview,' resulting in a much faster upgrade process.
In reply to Daniel Barros

Re: Error: An error occurred during communication with the server.

by Ken Task -
Picture of Particularly helpful Moodlers

Sounds like admin preparation for migration and a moodledata issue to me.

Best way to xfer a large moodledata directory is rsync, me thinks - but that might be water under the bridge by now.   Do know that mdl_files table contenthash column must match moodledata/xx/yy/contenthashvalue or one has problems.

You show you have command line so install moosh - CLI only swiss army knife for Moodle.

https://moodle.org/plugins/view.php?id=522

make sure you get version compat for your current core.

Then have a gander at

https://moosh-online.com/

There are some moosh commands for checking for orphaned files and other things.

Also, there is a script in code/admin/cli/ for un-installing plugins.

You might run that one to assure the tables related to plugins are no longer in the DB.

Good luck!

'SoS', Ken

In reply to Ken Task

Re: Error: An error occurred during communication with the server.

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I think the OP said that he didn't have space for a full copy of moodledata, not that he didn't know how to copy it.

I must admit, I've done stranger things to test stuff but I wouldn't have been surprised if it failed. There are too many "on the edge" things, here.
In reply to Howard Miller

Re: Error: An error occurred during communication with the server.

by Ken Task -
Picture of Particularly helpful Moodlers

"...didn't have space for a full copy of moodledata .."

Guess I missed that.  However, OP shows running Docker on Linux thus one could have setup a mounted data device with enough space for the full moodledata.    Since it's a test instance speed wouldn't be a concern. 

Hind sight now .... but might need to start over! sad

'SoS', Ken