Opening messages pane as administrator results in 504 error for administrator in same browser (SOLVED)

Opening messages pane as administrator results in 504 error for administrator in same browser (SOLVED)

by Doug E. Wray -
Number of replies: 5

This is a duplicate of something I posted on the tracker/issues page. I was asked to post it here to see if anyone had any insights (or similar experiences).

  1. Log in as administrator
  2. Open message pane (with 1651 private messages, 0 starred, 0 group)
  3. Browser shows system calling up the messages (placeholders fade in and out)
  4. (Sometimes) "Undefined" popup appears.
  5. Refreshing page or attempting to go to new page results in 504 (without Cloudflare, 524 with) error for about 10 minutes, but only in the browser from which the request was made. Other browser can be used with administrator account at the same time, and other accounts show no such problem. Sometimes, but not always, three other Moodle installations on the same VPS also stop responding. For example, if administrator account is logged in to with Chrome and the message pane is opened, 504/524 errors occur in Chrome, but the administrator account logged in to on Firefox functions normally and vice versa. Student accounts function normally.

System:

  • Ubuntu 20.04.4 on virtual private server
  • NginX 1.21.4
  • Moodle 3.11.5+, build 20220303
  • mariadb 10.5.15
  • php 7.4.3
  • all recommended extensions installed and without problem reports
  • Fordson theme, but problem obtains with Boost, also

additional plugins (all latest available versions; not currently used in italics):

Activity: Adaptive Quiz; Attendance; Attendance Register; Grouptool; Open Forum; H5P; Mindmap; Peer Work; Questionnaire; Sticky Notes; Student Quiz

Book/Book toolsLucimoo ebook importMicrosoft Word file Import/Export (Book)

Peer Work/Grading calculator methods: WebPA calculator

Quiz/Access rules: Block concurrent session quiz access rule; Proctoring

Blocks: Advanced notifications; Grade Me; Quick User Search; Sharing Cart

Question types: Random select answers; Drag-and-Drop Matching; Freehand drawing (ETH); Gapfill; Multiple True False (ETH); Ordering; Pattern match; Record audio/video; Single Choice (ETH)

Question behaviors: Self-assessment

Question import/export formatsMoodle glossary entries

Atto HTML editor/Atto plugins: Close editor; Corrections; Word count; Font family; Font size; Horizonal rule; More font background colors; More font colors; Sketch; Atto Word Count; Import Word file

Availability restrictions: Restriction by relative date

Course formats: Collapsed Topics

Reports: All backups; Roster

Themes: Fordson

Looking through the system (as far as I can understand it), things get hung up with sending the data to the browser. The mysql/MariaDB SHOW PROCESSLIST gives "Sending data" for the job that's called when I click on the messages popup. (The job starts with "SELECT m.id as messageid, mc.id as id, mc.name as conversationname, mc.type as conversationtype, m.u ".) It also gives a "Sleep" command that seems to start about 64 seconds after the command that gives "Sending data." After something more than 621 seconds the process disappears, and I am able to see the site in the browser again.

Unfortunately, I am between academic years now, so I do not know if any new messages are getting lost. The last time I used the message system normally was on 19 February, at which time I was using either the then-current build or the previous build. The bad effect for me is that I cannot view messages within the Moodle system or send any. I am both the administrator and the sole teacher in the system, and all teacher-role messages are in the account I use as a teacher.

A new student account I created for myself is able to send messages to my administrator account and the administrator account gets a notification, but the message is never visible.

N.B.: I got it working now by running
mysqlcheck --optimize database_name
It's not even slow. The hint was a line in syslog that read
[ERROR] InnoDB: (Duplicate key) writing word node to FTS auxiliary index table 'database_name' 'table_name'
I don't know how this might have happened, but it's possible that having two different languages in the message system with myriad misspelled words might have screwed up the indexing?

Average of ratings: -
In reply to Doug E. Wray

Re: Opening messages pane as administrator results in 504 error for administrator in same browser (SOLVED)

by Ken Task -
Picture of Particularly helpful Moodlers

Congrats!  And thank for posting your resolution for others who have similar issues.

A couple of suggestions:

1. in each moodle instance set the cookie prefix to something for that instance ... example: moodle is called 'elearning' set default cookie to include that difference.   That affects admin users who admin all instances.

2. databases can get 'loose' (lack of a better term) and one of the key config tweaks to a moodle server health/performance is/are related to DB server and the db's for the various moodles.   Suggest installing MySQLTuner and run it with superuser credentials.  One of the checks tuner reports is related to tables that need optimizing - also memory, etc.

'SoS', Ken

In reply to Ken Task

Re: Opening messages pane as administrator results in 504 error for administrator in same browser (SOLVED)

by Doug E. Wray -
Thank you for the suggestions: I'll try changing the default cookie thing on one of the test installations later this week. Similarly, I'll have a go with MySQLTuner, though maybe I'll wait until I have time to replicate the databases on an isolated Linux backup: knowing virtually nil about databases, I'm loathe to do much with them for fear of not being able to undo mistakes. (I'd be happy to learn about it if someone paid me, but I'm paid to be a teacher.)
In reply to Doug E. Wray

Re: Opening messages pane as administrator results in 504 error for administrator in same browser (SOLVED)

by Ken Task -
Picture of Particularly helpful Moodlers

While it's a good policy to work on a clone of production server for most things, MySQLtuner can be run on a production server.   It looks at stats (usage) and config of DB server and makes suggestions as to tweaks in config to improve performance.   It won't change any settings ... just makes recommendations as to tweaks to variables and settings that would improve performance.

The tweaks you make to a cloned moodle might not be seen due to usage.

Undoing mistakes is farily easy ... comment out additions you made to my.cnf (config for DB server) and restart service.

The thing about moodles that are all in one servers ... it's a balancing act between the web service and the DB server.   The more one can make the DB server to run databases in memory that one has to work with, the better ... less disk IO.     So it's fine tuning - knowing that one can only go so far (can't get blood out of a turnip!).

Hmmm ...

(I'd be happy to learn about it if someone paid me, but I'm paid to be a teacher.)

Dunno what your position is in your entity - but appears from what you did to resolve your issues, you've learned how 2 do techie server stuff.

When your entity decided to run a Moodle (s) DIY (do it yourself) someone signed on to be an IT person/server tech or find someone who would try/do ... but for a specific purpose ... the moodles.

My background is K12 classroom (Social Studies and a Coach) then adding Instructional Technology ... a pretty far cry from Internet Servers ... but, I learned ... and did so without pay ... because there was 'return' (payment of a different kind) in *teaching* in an online environment.

However, having said that ... maybe you should let those who control 'purse strings' what it's like to be a server admin + Moodle admin.   There is nothing like showing appreciation by increasing one's take home pay! smile

It's a journey ... never ending!   But so is 'life long learning' ... in anything! smile

'SoS', Ken

In reply to Ken Task

Re: Opening messages pane as administrator results in 504 error for administrator in same browser (SOLVED)

by Doug E. Wray -
Thank you for the thoughts. The person who controls the purse strings, though, is me: I pay for everything from my own pocket, running Moodle (a) to keep myself from having to lug stacks of papers and textbooks around to my several adjunct positions and (b) because I think it's better for my students to have materials and earlier work at hand.
In reply to Doug E. Wray

Re: Opening messages pane as administrator results in 504 error for administrator in same browser (SOLVED)

by Ken Task -
Picture of Particularly helpful Moodlers

Ohhhh...well in that case ... you *are* 'paying' yourself ... forward. smile

Do install and run Tuner on production ... no need to run on clone and really better to run on a moodle (s) that are in constant use for they are the ones that will need tweaking.   Better tweaking/performance means more time spent on other things ... like teaching! smile

'SoS', Ken