Thanks for the answer.
By the experimental method, I came to the conclusion that the problem was that the volume of the database was completely filled.
Information from the IDE when indexing the database:
Failed to retrieve routines in moodle_db.
[HY000][1021] (conn=374953) Disk full (/tmp/#sql_56c_0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device") and 915 duplicate reports (1 m 30 s 977 ms)
I do not have access to the server, I can not enlarge this volume.
Administrators may in some way decide this question.
For today, twice this problem has appeared and disappeared.
Maybe are thereany methods to reduce the number of entries in some database tables?
P.S. By the way, as soon as MOODLE started to work again. We added a new user and a new error has occurred.
Coding error detected, it must be fixed by a programmer: moodle_database::update_record_raw() id field must be specified.